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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.