perf(zsh): fzf integration improvements

- Fzf eval removed from common/.profile: it was already being used as
  zinit plugin
- fzf height increased for better legibility
- zsh: unnecessary keybindings removed
This commit is contained in:
Pratik Tripathy
2024-12-28 00:38:51 +05:30
parent 907ea2bc79
commit 11a166080f
2 changed files with 7 additions and 12 deletions

View File

@@ -25,7 +25,7 @@
##################################################################################
if ! pgrep -u "$USER" ssh-agent >/dev/null; then
eval $(ssh-agent -s) >/dev/null
eval "$(ssh-agent -s)" >/dev/null
fi
# shellcheck disable=SC3045
@@ -84,7 +84,8 @@ export RUSTUP_HOME="${XDG_DATA_HOME}/rust/rustup"
export PATH="$PATH:$CARGO_HOME/bin"
export RUSTC_WRAPPER=sccache
export SCCACHE_CACHE_SIZE="20G"
[ -f "${XDA_DATA_HOME}/rust/cargo/env" ] && . "${XDA_DATA_HOME}/rust/cargo/env"
# shellcheck disable=SC1091
[ -f "${XDG_DATA_HOME}/rust/cargo/env" ] && . "${XDG_DATA_HOME}/rust/cargo/env"
# Setup DotNet
export DOTNET_CLI_TELEMETRY_OPTOUT=1
@@ -120,7 +121,7 @@ export AWS_SHARED_CREDENTIALS_FILE="${XDG_CONFIG_HOME}/aws/credentials"
export DOCKER_CONFIG="${XDG_CONFIG_HOME}/docker"
export FZF_DEFAULT_COMMAND='rg --files --hidden'
export FZF_DEFAULT_OPTS='--layout=reverse --cycle --inline-info --height=~50% --border'
export FZF_DEFAULT_OPTS='--layout=reverse --cycle --inline-info --height=~80% --border'
export TLDR_CACHE_DIR="${XDG_CACHE_HOME}/tldr"

View File

@@ -58,6 +58,7 @@ HISTORY_BASE="$ZSH_STATE_HOME/per-directory-history"
# Zinit Plugins
zinit ice depth=1; zinit light romkatv/powerlevel10k
zinit ice depth=1; zinit light jimhester/per-directory-history
# zinit ice depth=1; zinit light atuinsh/atuin
zinit ice wait lucid depth=1; zinit light zsh-users/zsh-completions
zinit ice wait lucid depth=1; zinit light zsh-users/zsh-autosuggestions
@@ -113,21 +114,14 @@ zstyle ':completion::complete:*' gain-privileges 1 menu select cache-path "$ZCOM
# User configuration # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# [ctrl+r]: Search command history
# [ctrl+t]: fzf & over the files & directories under the current one & paste it to prompt
# [alt+c] : fzf & cd into a directory under the current one
# TODO: Source this as script instead of eval: has impact on zsh startup
command -v fzf > /dev/null && eval "$(fzf --zsh)"
command -v zoxide >/dev/null && eval "$(zoxide init --cmd cd zsh)"
# Source aliases and shell functions
for alias_file in "$XDG_CONFIG_HOME"/shell/*.sh; do source "$alias_file"; done
# Keybindings
bindkey '^f' autosuggest-accept #
bindkey '^p' history-search-backward # Ctrl+p gets the last history match
bindkey '^n' history-search-forward # Ctrl+n gets the next history match
bindkey '^f' autosuggest-accept
# TIP: Following should be executed AFTER aliases are sourced
command -v op >/dev/null && bindkey -s '^o' ' op\n' # Fuzzyfind projects and open in nvim
command -v pnew >/dev/null && bindkey -s '^[o' ' pnew\n' # Create a new project quickly