From 3e3d42f7b94ac6a1f55d42b7f4dc3a87dd366ea8 Mon Sep 17 00:00:00 2001 From: Pratik Tripathy Date: Wed, 10 Apr 2024 16:15:24 +0530 Subject: [PATCH] FZF: Use the latest feature for getting shell completions --- common/.bashrc | 12 +++++------- common/.zshrc | 8 ++++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/common/.bashrc b/common/.bashrc index 06a703a..9a6946b 100644 --- a/common/.bashrc +++ b/common/.bashrc @@ -176,14 +176,12 @@ HISTFILE="$XDG_STATE_HOME/shell/bash_history" [ ! -f "$XDG_CONFIG_HOME/exercism/exercism_completion.bash" ] || source "$XDG_CONFIG_HOME/exercism/exercism_completion.bash" -# [ctrl+r]:replaces shell command search -# [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 -[ -f "$XDG_STATE_HOME/shell/fzf.bash" ] && source "$XDG_STATE_HOME/shell/fzf.bash" +# [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 +command -v fzf >/dev/null && eval "$(fzf --bash)" -if command -v zoxide >/dev/null; then - eval "$(zoxide init --cmd cd bash)" -fi +command -v zoxide >/dev/null && eval "$(zoxide init --cmd cd bash)" # Source aliases and shell functions for alias_file in "$XDG_CONFIG_HOME"/shell/*.sh; do source "$alias_file"; done diff --git a/common/.zshrc b/common/.zshrc index 676158a..5c1b049 100644 --- a/common/.zshrc +++ b/common/.zshrc @@ -98,10 +98,10 @@ zmodload zsh/complist compinit -d "$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION" _comp_options+=(globdots) # Include hidden files -# [ctrl+r]:replaces shell command search -# [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 -[ -f "$XDG_STATE_HOME/shell/fzf.zsh" ] && source "$XDG_STATE_HOME/shell/fzf.zsh" +# [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 +command -v fzf > /dev/null && eval "$(fzf --zsh)" command -v zoxide >/dev/null && eval "$(zoxide init --cmd cd zsh)"