Make every FZF command use ripgrep
Signed-off-by: Marko Korhonen <marko.korhonen@reekynet.com>
This commit is contained in:
parent
5afa59e5d4
commit
6e1288c95c
3 changed files with 15 additions and 4 deletions
|
@ -36,6 +36,14 @@ let g:fzf_layout = { 'window': 'call FloatingFZF()' }
|
||||||
nmap <C-f> :Files<CR>
|
nmap <C-f> :Files<CR>
|
||||||
nmap <C-g> :Rg<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
|
" Ripgrep command customization
|
||||||
command! -bang -nargs=* Rg
|
command! -bang -nargs=* Rg
|
||||||
\ call fzf#vim#grep(
|
\ call fzf#vim#grep(
|
||||||
|
|
|
@ -17,6 +17,13 @@ export GOPATH=~/.bin/go
|
||||||
export FZF_DEFAULT_COMMAND='rg --files --hidden 2>/dev/null'
|
export FZF_DEFAULT_COMMAND='rg --files --hidden 2>/dev/null'
|
||||||
export FZF_COMPLETION_TRIGGER='**'
|
export FZF_COMPLETION_TRIGGER='**'
|
||||||
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
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
|
# use lesspipe with less
|
||||||
export LESSOPEN="|lesspipe.sh %s"
|
export LESSOPEN="|lesspipe.sh %s"
|
||||||
|
|
|
@ -30,10 +30,6 @@ zplugin light zsh-users/zsh-completions
|
||||||
zplugin ice wait'1' lucid as'completion'
|
zplugin ice wait'1' lucid as'completion'
|
||||||
zplugin snippet https://gist.githubusercontent.com/RPigott/a3efdc08fa4d5fd7df38d091ab5e8532/raw/867ac1884d97d1bd1e5d4037d4eefdf4a004e72b/_swaymsg
|
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
|
# dotdrop completion
|
||||||
zplugin ice wait'1' lucid as'completion'
|
zplugin ice wait'1' lucid as'completion'
|
||||||
zplugin snippet $DOTREPO/dotdrop/completion/_dotdrop-completion.zsh
|
zplugin snippet $DOTREPO/dotdrop/completion/_dotdrop-completion.zsh
|
||||||
|
|
Loading…
Reference in a new issue