From bd738d6d71ddba88e50ae53c0c79e3e936500c12 Mon Sep 17 00:00:00 2001 From: rayanramoul Date: Wed, 27 Dec 2023 00:23:54 +0100 Subject: [PATCH] :sparkles: refactor fzf ctrl-f keybind to look into both files and directories --- dotfiles/.zshrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc index 47967ca..c8eb04e 100644 --- a/dotfiles/.zshrc +++ b/dotfiles/.zshrc @@ -175,7 +175,9 @@ alias tmux-sessionizer="bash ~/scripts/tmux-sessionizer.sh" #if [ "$TMUX" = "" ]; then exec tmux; fi #bindkey -s '^f' '$(fzf)\n' -bindkey -s '^f' 'selected_dir=$(find . -maxdepth 8 -type d | fzf); [ -n "$selected_dir" ] && cd "$selected_dir"\n' +#bindkey -s '^f' 'selected_dir=$(find . -maxdepth 8 -type d | fzf); [ -n "$selected_dir" ] && cd "$selected_dir"\n' +bindkey -s '^f' 'selected_entry=$(find $HOME -maxdepth 8 -type f -o -type d | fzf); [ -n "$selected_entry" ] && { [ -d "$selected_entry" ] && cd "$selected_entry" || vim "$selected_entry"; }\n' +