Closed AndrewRayCode closed 10 years ago
Use :Ack!
instead of :Ack
:)
:Ack! word
"No ! allowed"
That should work, see here: https://github.com/mileszs/ack.vim/blob/master/doc/ack.txt
:Ack[!] [options] {pattern} [{directory}] *:Ack*
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.
Hm, I don't know. I'll check to see if there's time before dinner.
(I'm probably using an older version)
Ah, this isn't in the official version on vim.org yet. That would be a nice thing to update.
I just wrote issue 38 about this feature, as I was having a problem using this script in MacVim: https://github.com/mileszs/ack.vim/issues/38
Fixed it by removing the if-else block around the assignment of the ack script
I use to have this problem too, I change the set switchbuf=useopen,usetab,newtab
. This way if the first occurrence is on an existing buffer, vim will move to this buffer, if not vim will open in a newtab
.
When I'm acking for something it is VERY rare that I want to lose my current place in my open tab, I just want to see the usages of some word or phrase. By default Ack will overwrite your buffer with the first match and I can't seem to find a way to turn this off. It's very annoying frankly, if I forget to open a new tab before acking I lose my place and have to go buffer hunting.