rking / ag.vim

Vim plugin for the_silver_searcher, 'ag', a replacement for the Perl module / CLI script 'ack'
1.74k stars 131 forks source link

Create option for setting default "open style" with Ag or Ag! #119

Open typeoneerror opened 8 years ago

typeoneerror commented 8 years ago

:Ag! is handy if you don't want to open the first result in the search. It'd be great if we could set an option in the settings for ag.vim to make Ag perform the search in this manner. With this option, perhaps Ag! would just be the opposite of whatever you've defined your default to be.

danihodovic commented 8 years ago

@typeoneerror Wow, I was looking all over the place for this option. Why isn't this documented? Thank you!

mattnworb commented 8 years ago

A setting for this behavior would be really great instead of having to remember to use the non-default command each time.

lfilho commented 8 years ago

+1 And that behaviour should also be replciated to AgFile, AgBuffer, etc

superDross commented 5 years ago

let g:ag_default_open_style = 'noreplace' did not work for me.

However, the below snippets did make Ag! the default behaviour.

cnoreabbrev Ag Ag!
nnoremap <Leader>a :Ag!<Space>