dotfiles
dotfiles copied to clipboard
Grep operator
<Leader>gt;
would be cool: http://learnvimscriptthehardway.stevelosh.com/chapters/33.html
For what it's worth I use https://github.com/rgrinberg/vim-operator-gsearch, which provides exactly this (if I'm reading this issue right :) )
I have this mapped to gr
for :grep
and gl
for :lgrep
: https://github.com/teoljungberg/vim-grep-motion
@teoljungberg Thank you for the dotfiles help today 😄!
According to :help lgrep
, it searches the location list, which is "a window-local quickfix list".
I've never used the location list, and I'm not sure when (or why) it's better than the quickfix list. When would you use lgrep
instead of grep
?
@bobwhitelock Thank you for the pointer! 🎉
The quickfix list is shared globally, between all tabs and windows. And the location list is specific to a given window, as the name suggests. Meaning if I :lgrep
for something from a window, and move away - my location list is then reset.
My use-case for the location list is to quickly grep up where some token comes from, questions who's answers doesn't need to stick around than the scope of the current window.
I have been toying with the workflow of running linters through :lmake
, but I haven't done that fully just yet.