HayMonkey
unread,Dec 28, 2011, 4:10:57 PM12/28/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ack dev/users
Hello all,
Long time listener, first time caller. I currently use ack as my
grepprg in vim and think it's just fantastic for most use cases I
have. Unfortunately there is one issue I am running into
occasionally. I have a large directory structure of user folders that
I often want to do a search and replace across or easily look in
various files. Here's what I would like to do within Vim:
:grep! -g sharedFileName
Navigate quickfix list to see what files hit and optionally open and
examine those files
It returns file name, but vim would only allow me to navigate to those
files from the quickfix list when they are returned in the the
quickfix format that a standard ack call returns (includes file name,
line number, etc).
Is it possible to force returning the format like a standard ack call
from within another program like Vim? It appears that using --pager
is not an option. It would be enough to just list the first line of
the file if possible. I can somewhat get around this
A few other notes:
I could probably get this via some plugin like CommandT but I really
like the flexibility of being able to do all of my file finding
abilities via ack when possible.
I am able to quickly set args or open all files listed in the quickfix
window with some created functions which is another reason I'd prefer
to stay within ack / quickfix.
--------------------------------
=p
After a couple hours of tinkering, I finally got what I wanted:
:grep! --line=1 -G sharedFileName
I still decided to post for informational purposes and to thank you
for creating such a great utility.