Created
April 3, 2020 18:48
-
-
Save hrfuller/1c2a1a9838566cd7f87c9d6a0d7d77c8 to your computer and use it in GitHub Desktop.
Setting up vim fzf with ripgrep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" need ripgrep and fzf installed. Both these plugins are needed by vim. | |
Plugin 'junegunn/fzf' | |
Plugin 'junegunn/fzf.vim' | |
" Map ctrl-p to FZF | |
nnoremap <silent> <C-p> :GFiles <CR> | |
"Quick ripgrep word under cursor | |
command! -bang -nargs=0 RgCWord | |
\ call fzf#vim#grep( | |
\ 'rg --column --line-number --no-heading --color=always --smart-case '.shellescape(expand('<cword>')), 1, | |
\ fzf#vim#with_preview(), <bang>0) | |
nnoremap <C-g> :RgCWord<CR> |
Wow never heard maniobras de meñiques before 😃. No reason not to use a different leader other than consistency with Ctrl-p for files search. You could change both of them to your preferred leader.
Me exercising the pinky-finger's-worth of Spanish in my brain, and a healthy dictionary reliance. Thanks for the hot config tip, which I finally put into el .vimrc. Rg es sexi.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you make use of the leader mapping? Any reason not to use
\
instead ofCtrl
here? Both feel like maniobras de meñiques, anyways.