0

Basically, I'd like the same type of behavior as when you use :grep! vs. :grep. I'm using a find-files plugin that outputs to the quickfix list and I don't want vim to automatically open the first file each time (the plugin does not have an option for this). Is there a way to disable the auto-opening behavior globally?

Edit: the plugin is samoshkin/vim-find-files

It's pretty simple, but does what I need (I like the fd backend). I prefer the quickfix list vs. a buffer because I use another plugin that gives me easy access/navigation to the quickfix list.

3
  • 3
    It probably depends on what the plugin is actually doing. Best to ask the plugin author about it Jul 2 at 11:45
  • 2
    Or at least tell us what plugin and command you are using otherwise it might be hard to help you
    – statox
    Jul 2 at 16:41
  • Based on previous comments, I suspect the answer globally is « no », but there might be a way for the particular plugin (and yes, it’s a shame certain plugins think you want that behavior and won’t let you decide).
    – D. Ben Knoble
    Jul 3 at 12:58
0

I do something similar using mappings (note: I prefer the local window location list as opposed to global quickfix for this. If you prefer the quickfix list, just switch 'grep' for 'lgrep', 'copen' for 'lopen', and 'cgetexpr' for 'lgetexpr')

map   <M-g> :lgrep!<Space><BAR>:lopen<C-Left>
-- or, better yet --
map   <M-g> :lgetexpr system( 'grep -EIRsn --exclude=tags --exclude-dir=.git --exclude-dir=build --exclude-dir=doxygen ""' )<BAR>:lopen<C-Left><C-Left><Right>
0

That plugin samoshkin/vim-find-files uses cexpr to create the quickfix list. :cexpr will always jump to the first error. I believe, you can simply replace :cexpr by :cgetexpr and it will just create a quickfix buffer, without jumping to the error. You could create a PR for that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.