aboutsummaryrefslogtreecommitdiff
path: root/config/zsh/plugins/fzf-cd.zsh
diff options
context:
space:
mode:
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;