aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2021-12-10 22:53:19 +0800
committerGuangxiong Lin <[email protected]>2021-12-10 22:53:19 +0800
commit1415fdb5c4e31e417afae60efd722d9ec0d070da (patch)
tree3b573415ce274bb80fbb048a4a3e48c4b980b4f0
parentb2b7587b70ea8ef5c02cb6536b222184b620bf65 (diff)
downloaddotfiles-1415fdb5c4e31e417afae60efd722d9ec0d070da.tar.gz
dotfiles-1415fdb5c4e31e417afae60efd722d9ec0d070da.tar.bz2
dotfiles-1415fdb5c4e31e417afae60efd722d9ec0d070da.zip
Update fzf config
-rw-r--r--.env5
-rw-r--r--.vim/plugin/fzf.vim5
2 files changed, 10 insertions, 0 deletions
diff --git a/.env b/.env
index 8e39ca9..a404b39 100644
--- a/.env
+++ b/.env
@@ -5,3 +5,8 @@ if [[ $TERM =~ 'st' ]]; then
TERMINAL=st
fi
export TERMINAL=$TERMINAL
+
+export FZF_DEFAULT_COMMAND='find . -type f'
+if [ -f /usr/bin/fd ];then
+ export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
+fi
diff --git a/.vim/plugin/fzf.vim b/.vim/plugin/fzf.vim
index 04aaeda..43522f7 100644
--- a/.vim/plugin/fzf.vim
+++ b/.vim/plugin/fzf.vim
@@ -1,5 +1,10 @@
let g:fzf_command_prefix = 'Fzf'
+command! -bang -nargs=* FzfRg
+ \ call fzf#vim#grep(
+ \ 'rg --hidden --column --line-number --no-heading --color=always --smart-case --glob !.git -- '.shellescape(<q-args>), 1,
+ \ fzf#vim#with_preview(), <bang>0)
+
noremap <leader>ff :FzfFiles<CR>
noremap <leader>fgf :FzfGFiles<CR>
noremap <leader>fbf :FzfBuffers<CR>