Make every FZF command use ripgrep

Signed-off-by: Marko Korhonen <marko.korhonen@reekynet.com>
This commit is contained in:
Marko Korhonen 2020-01-09 15:10:28 +02:00
parent 5afa59e5d4
commit 6e1288c95c
No known key found for this signature in database
GPG Key ID: 911B85FBC6003FE5
3 changed files with 15 additions and 4 deletions

View File

@ -36,6 +36,14 @@ let g:fzf_layout = { 'window': 'call FloatingFZF()' }
nmap <C-f> :Files<CR>
nmap <C-g> :Rg<CR>
" Files command customization
command! -bang -nargs=* Rg
\ call fzf#vim#files(
\ 'rg --files --hidden 2>/dev/null'.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
" Ripgrep command customization
command! -bang -nargs=* Rg
\ call fzf#vim#grep(

View File

@ -17,6 +17,13 @@ export GOPATH=~/.bin/go
export FZF_DEFAULT_COMMAND='rg --files --hidden 2>/dev/null'
export FZF_COMPLETION_TRIGGER='**'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND='rg --hidden --files --null --sort path 2>/dev/null | xargs -0 dirname | uniq'
_fzf_compgen_dir() {
rg --hidden --files --null --sort path 2>/dev/null | xargs -0 dirname | uniq
}
_fzf_compgen_path() {
rg --files --hidden 2>/dev/null
}
# use lesspipe with less
export LESSOPEN="|lesspipe.sh %s"

View File

@ -30,10 +30,6 @@ zplugin light zsh-users/zsh-completions
zplugin ice wait'1' lucid as'completion'
zplugin snippet https://gist.githubusercontent.com/RPigott/a3efdc08fa4d5fd7df38d091ab5e8532/raw/867ac1884d97d1bd1e5d4037d4eefdf4a004e72b/_swaymsg
# fzf completions
zplugin ice wait'1' lucid as'completion'
zplugin snippet /usr/share/fzf/completion.zsh
# dotdrop completion
zplugin ice wait'1' lucid as'completion'
zplugin snippet $DOTREPO/dotdrop/completion/_dotdrop-completion.zsh