wincent/ferret

Implement :Lacks, analogous to :Acks but applying to the location-list

wincent opened this issue · 3 comments

Using :ldo or :lfdo (with a corresponding g:FerretLacksCommand setting) and a fallback to some location-list-specific equivalent of :Qargs.

What's the motivation behind this (use case), ie, why quickfix and location-list?

@nomasprime: You can have only one quickfix list at a time (global to Vim), but N location lists (1 per window).

So, if you only use quickfix list the only way to search for multiple things "at the same time" is to run multiple searches in series, and then move back and forth between the search results with :colder and :newer.

If you use the location list as well, you can additionally have N searches truly at the same time (ie. no switching required) and you can use :lnewer and :lolder (which cutely abbreviates to :lol), which basically means that you can juggle as many concurrent searches as you want at once, limited only by your mind.

In practice, I mostly just use the quickfix list, but on rare occasions when I need to throw in location list searches as well, it is incredibly useful. A concrete example: maybe you are refactoring and you search for FooBar in the quickfix listing. As you navigate from result to result, you occasionally need to do side-searches and you investigate angles, and you don't want to blow away your "main" search view, so you do a location list search for those.

@wincent Thanks for the detailed explanation.

Thought that might be the reason but couldn't imagine why I wouldn't reuse quickfix. Haven't integrated more automated search and replace into my workflow before though, I'm sure I'll run into a situation where I want to put results in the location-list at some point.

Also, thanks for the plug-in, certainly makes adding global search and replace less painful.