gabebw / dotfiles

:tulip:
https://gabebw.com
230 stars 23 forks source link

Grep operator #105

Open gabebw opened 6 years ago

gabebw commented 6 years ago

<Leader>gt; would be cool: http://learnvimscriptthehardway.stevelosh.com/chapters/33.html

bobwhitelock commented 6 years ago

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 :) )

teoljungberg commented 6 years ago

I have this mapped to gr for :grep and gl for :lgrep: https://github.com/teoljungberg/vim-grep-motion

gabebw commented 6 years ago

@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?

gabebw commented 6 years ago

@bobwhitelock Thank you for the pointer! 🎉

teoljungberg commented 6 years ago

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.