jremmen / vim-ripgrep

Use RipGrep in Vim and display results in a quickfix list
MIT License
541 stars 99 forks source link

How to limit search by file type? #47

Open benfrain opened 4 years ago

benfrain commented 4 years ago

Happy to update the docs with this info if anyone can point in the right direction.

Outside of Vim you can do rg sausages -tcss to search for sausages in any file type of 'css'. How do you pass the same file type limit argument in Vim?

Frydac commented 4 years ago

For me that just works (on linux) :Rg pattern -tcss and :Rg -tcss pattern work. You have to specify pattern, as the script will only expand the current word when there are no arguments (if I understand correctly). You can manually expand the current word under the cursor on the vim command line with <c-r><c-w> (see :h c_<c-r>)