diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-10-15 00:51:15 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-10-15 00:51:15 +0530 |
| commit | 32d0bd79637cdc6400798bc033c8e2149ec4c5a6 (patch) | |
| tree | df6f25cb31bb2b93a1af5104b613c96013b823b9 /config/zsh/plugins/fzf-cd.zsh | |
| parent | 4eb5f01f1f7a11527be56bd8a8afecd31d640b15 (diff) | |
| download | nixos-config-32d0bd79637cdc6400798bc033c8e2149ec4c5a6.tar.gz nixos-config-32d0bd79637cdc6400798bc033c8e2149ec4c5a6.zip | |
config sync
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; |
