Files
dotfiles/vim/.vim/prefs/ripgrep.vim
Christian Nieves 89aff8fc53 Update vim prefs
2022-06-03 17:52:18 +00:00

14 lines
502 B
VimL

Plug 'kyoh86/vim-ripgrep'
" command! -nargs=+ -complete=file Rg :call ripgrep#search(<q-args>)
command! -nargs=+ -complete=file Rg :call s:ripgrep(<q-args>)
function s:ripgrep(searchterm)
let l:dir = fnameescape(expand("%:p:h")."/")
let l:rel = ripgrep#path#rel(l:dir)
" echomsg 'DIR: ' . l:dir . '\tREL: ' . l:rel
call ripgrep#call('rg --smart-case --json ' . a:searchterm, l:dir, l:rel)
endfunction
nnoremap <leader>rg :Rg<Space>
let g:rg_root_marks = ['BUILD', 'METADATA', '.git']