0

Whenever I run an :Ag search on my present working directory, the first entry in the returned results list is always automatically opened in the currently active pane.

Is there any way to disable this from happening? I'd rather scroll through the result list then to select which file, if any, I decide to open on screen.

Thank you for your help, if you need any more info please let me know!

  • VIM 8.0
  • Plug 'rking/ag.vim'
  • sudo apt install silversearcher-ag

1 Answer 1

3

I don't have the plugin but if I'm reading the docs correctly you just need to add bang !...

:Ag[!] [options] {pattern} [{directory}]                                  *:Ag*

    Search recursively in {directory} (which defaults to the current
    directory) for the {pattern}. Behaves just like the |:grep| command, but
    will open the |Quickfix| window for you. **If [!] is not given the first
    error is jumped to.**

Seems to me that the inverse of the last sentence is the behavior you seek...IOW bang it.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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