From 32d0bd79637cdc6400798bc033c8e2149ec4c5a6 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 15 Oct 2023 00:51:15 +0530 Subject: config sync --- config/zsh/plugins/fzf-cd.zsh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'config/zsh/plugins') 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; -- cgit v1.3.1