Skip to content

alejandrogallo/vim-ripgrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Just add these lines into your .vimrc

function! Rg(...)
  let l:output = system("rg --vimgrep ".join(a:000, " "))
  let l:list = split(l:output, "\n")
  let l:ql = []
  for l:item in l:list
    let sit = split(l:item, ":")
    call add(l:ql,
        \ {"filename": sit[0], "lnum": sit[1], "col": sit[2], "text": sit[3]})
  endfor
  call setqflist(l:ql, 'r')
  echo 'Rg results: '.len(l:ql)
endfunction
command! -nargs=* Rg call Rg(<q-args>)

and use it like

:Rg something

and browse the results with :cn and :cp.

Releases

No releases published

Packages

No packages published