diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-03-22 17:17:59 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-03-22 17:17:59 +0530 |
| commit | edc4ef0106f7d4a37d367e81ae9e6470dbdc7087 (patch) | |
| tree | 2e49381dbfec01b74d3b91bffc3c75e040742cef /config/zsh/plugins/fzf-cd.zsh | |
| parent | 384f3554cc53cf03fa9a4cf9e1bfa74aaa64a13f (diff) | |
| download | nixos-config-edc4ef0106f7d4a37d367e81ae9e6470dbdc7087.tar.gz nixos-config-edc4ef0106f7d4a37d367e81ae9e6470dbdc7087.zip | |
chore: config sync
Diffstat (limited to 'config/zsh/plugins/fzf-cd.zsh')
| -rw-r--r-- | config/zsh/plugins/fzf-cd.zsh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/config/zsh/plugins/fzf-cd.zsh b/config/zsh/plugins/fzf-cd.zsh new file mode 100644 index 0000000..e4b4337 --- /dev/null +++ b/config/zsh/plugins/fzf-cd.zsh @@ -0,0 +1,12 @@ +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; |
