diff options
Diffstat (limited to 'config/zsh/plugins/fzf-cd.zsh')
| -rw-r--r-- | config/zsh/plugins/fzf-cd.zsh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/config/zsh/plugins/fzf-cd.zsh b/config/zsh/plugins/fzf-cd.zsh index e4b4337..f1897c5 100644 --- a/config/zsh/plugins/fzf-cd.zsh +++ b/config/zsh/plugins/fzf-cd.zsh @@ -1,12 +1,22 @@ + +fzf-change-dir-cwd() { # fzf + cd in cwd + selected=$(find . -maxdepth 1 -type d | fzf); + if [ ! -z "$selected" ] && [ "$selected" != "$(pwd)" ]; then + cd $selected; + fi + zle send-break +} + +zle -N fzf-change-dir-cwd; +bindkey '^O' fzf-change-dir-cwd; + fzf-change-dir() { local result=$(find -type d | fzf); - if ! [[ -z "$result" ]]; then cd "$result" fi - zle send-break } zle -N fzf-change-dir; -bindkey '^P' fzf-change-dir; +bindkey '^F' fzf-change-dir; |
