Custom ripgrep - 01-11-20

In the past I used full plugin level text searching solutions the likes of :Rg, :Grep, :Ag from the vim grep plugin. Recently I’ve found it faster and more customizable to just run :term do my searching from there and then opening file under cursor in new split with <C-W><f>. Doing the searches directly in terminal builds more on all the tricks I’ve devolved outside of vim world. However launching terminals all the time is also has it’s pain points, so now I’ve come up with a simple key mapping to run searches in a new scratch window without having to go full term.

yank the search term then <Leader><s> pulls up a new scratch buffer with the search pre-filled but with the ability to still edit and add further customisations.

nnoremap <Leader>s :Sscratch<CR>:read ! rg -i <C-R>"

here I use the technique to search for all snippet files tagged with vim


demo of using the jump list


\- [ vim, search ]