mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

Option to switch :Ack and :Ack! #140

Closed jjt closed 9 years ago

jjt commented 10 years ago

99% of the time, I want to search but not open a file. Is there an option to switch the functionality of :Ack and :Ack! so the the bang opens the first result and the bare command doesn't?

LFDM commented 9 years ago

Hey there, I would suggest you just go to Ack through using a proper mapping. Something like this:

" auto-quote
map <leader>fa :Ack ""<left>
" search, but don't open the first result immediately
map <leader>fs :Ack! ""<left>
ches commented 9 years ago

I kind of wish the commands were originally designed the way you prefer, @jjt, but of course changing the default behavior now would irk everyone who upgrades and finds it changed. So backwards compatibility being what it is, I'd have to agree with @LFDM (and I use mappings just like those). I'd rather not add another option when Vim has solutions built-in.

jjt commented 9 years ago

Agreed that reversing it wouldn't be the right option at this point. Mappings it is.

ryansouza commented 9 years ago

I prefer the non-auto-open method as well. Using a command abbreviation I can make Ack always act as Ack! but losing command access to the non-bang version, which is alright for my work-flow.

:ca Ack Ack!