From 51643beddfcc403b13d2c32a25a6b48723eccb02 Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Sun, 8 Nov 2020 03:19:40 +0100 Subject: [PATCH] fzf: Add DEFAULT_COMMAND and vim :Files mapping Add FZF_DEFAULT_COMMAND that displays hidden files as well, but ignores .git directories. Add :Files mapping in vim. Because it is bound to f, the leader key mapping had to be moved to the top of the file. --- .config/vim/vimrc | 6 ++++-- .config/zsh/.zprofile | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index fcb586b..226c633 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -1,3 +1,6 @@ +" Set leader key +let mapleader = "\" + " Plugins ###################################################################### " Auto completion " needs vim >= 8.1.1719 to support features like popup and text property. @@ -10,6 +13,7 @@ packadd! delimitMate " Fuzzy finder packadd! fzf packadd! fzf.vim +nmap f :Files " Theme packadd! onedark.vim " Git information @@ -83,8 +87,6 @@ set list set listchars=tab:>ยท " Keybindings ################################################################## -" Set leader key -let mapleader = "\" " Stop highlighting search result when pressing Return nnoremap :nohlsearch diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 0573c36..8d00a9e 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -56,5 +56,9 @@ else export LESS_TERMCAP_us=$'\e[1;4;31m' fi +# Show also hidden files per default but ignore files in '.git' directories. +FZF_DEFAULT_COMMAND="find . -name '.git' -prune -o \( -type f -a -print \)" +export FZF_DEFAULT_COMMAND + # Automatically start X on login after boot. [[ -n $DISPLAY || $XDG_VTNR -ne 1 ]] || exec startx