mileszs / ack.vim

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

Don't open first search result directly after search. #176

Closed danbruegge closed 8 years ago

danbruegge commented 8 years ago

Hi,

is there a way to tell ack.vim that it shouldn't open the first file it found after a search?

I've added let g:ackpreview = 0. But in the docs is written that this option only opens files with j and k.

Problem is, that i don't want to fill my buffer with files i don't need.

Regards, Dan.

ches commented 8 years ago

Hi @danbruegge, most of the key commands have bang versions (:Ack!, :AckWindow!, etc.) which do not open the first result. I believe that's what you're seeking?

I wish that had originally been the default, but don't want to change it for sake of backwards compatibility. Using some personal mappings or perhaps abbreviations will help, see #140.

danbruegge commented 8 years ago

Hej. Thanks for the Info with the bang i ignored the obvious with success :D

The mappings looks good for me, i think i'll go with them.

ches commented 8 years ago

By the way, the auto-preview is a different feature that automatically opens matches when you move through the results quickfix list with j/k. It's off by default, so you can leave let g:ackpreview = 0 out of your config if you don't want that feature. If you do like that feature but don't want it making a big mess of your buflist, check out #174 for a suggestion for the time being.

danbruegge commented 8 years ago

I think, then it is a bug for me. Without setting g:ackpreview to zero, it will preview all the files selected with j/k.

This one more line don't bothers me. ;)