aboutsummaryrefslogtreecommitdiff
path: root/config/zsh/plugins/fzf-cd.zsh
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-03-22 17:17:59 +0530
committerAkshay Nair <phenax5@gmail.com>2023-03-22 17:17:59 +0530
commitedc4ef0106f7d4a37d367e81ae9e6470dbdc7087 (patch)
tree2e49381dbfec01b74d3b91bffc3c75e040742cef /config/zsh/plugins/fzf-cd.zsh
parent384f3554cc53cf03fa9a4cf9e1bfa74aaa64a13f (diff)
downloadnixos-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.zsh12
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;