Make every FZF command use ripgrep

Signed-off-by: Marko Korhonen <marko.korhonen@reekynet.com>
main
Marko Korhonen 5 years ago
parent 662d63a3c8
commit 239de02dc7

@ -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(

@ -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"

@ -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

Loading…
Cancel
Save