For some reason I get, what I call an "uneven" output from Ack/Ag in the quickfix list window.
My project directory structure is the following:
/home/user/projects/myproject
|
---- llvm-or1k
|
---- clang-or1k
I did a search with Ag using the following command:
:ag --nogroup --nocolor --column -S -U BuildSchedGraph /home/user/projects/myproject
And got the following output (snippet)
...
/home/user/projects/myproject/llvm-or1k/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h|176 col 63| /// BuildSchedUnits, AddSchedEdges - Helper functions for BuildSchedGraph.
llvm-or1k/lib/CodeGen/SelectionDAG/ScheduleDAGVLIW.cpp|100 col 3| BuildSchedGraph(AA);
/home/user/projects/myproject/llvm-or1k/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp|336 col 3| BuildSchedGraph(NULL);
...
I can't understand why the first and the last "finds" have /home/user/projects/myproject prepended to the path while the second one doesn't.
This is becoming quite annoying.
Any help is appreciated.
ack/agto callfnamemodify(file, ':~:.')on all filenames before feeding it back to be parsed witherrorformat. This would involve replacingmakeprgandmake(orMakefromdispatch) withsystem()andcgetexpr. Not really a complicated change, but it would involve a change in the philosophical approach to the problem. :) – lcd047 Sep 23 '15 at 07:44fnamemodify(file, ':~:.'), etc. I know asking to help on this is a long shot but I've never done anything like this before and would greatly appreciate the help. – flashburn Sep 23 '15 at 16:13:ls), it would have a relative path name. Any quickfix "hits" to files already in my buffer list would appear in the quickfix list with the names used for the buffers, i.e., relative path names. Any quickfix "hits" to files not in the buffer list would be added to the buffer list (visible using:ls!; note the!) with the names as given by the program creating the list, usually full path names. So the initial difference in appearance was due to whether or not I had already opened the file. – garyjohn Sep 23 '15 at 17:20:echomsgcommands in ack.vim and look in the message history to see what's happening. Or, you could use Vim's debug features (:help debug-scripts). – garyjohn Sep 23 '15 at 17:42find,ctags,gtagsandgrep. I usefindin a script with some other filters to build lists of files forctagsandgtags, then run those programs to build their indexes. Thectagsindex is sorted so that Vim can use a fast binary search. I usegtags-cscopeas a bettercscope. I use a Vim script to make an easier interface to Vim'scscopecommands. I haven't seen any advantage to usingackinstead ofgrep. When I'm not looking for a symbol withctagsorgtags, I usually want to search every file in the project. Otherwise, I usegrep's--include=option. – garyjohn Sep 23 '15 at 18:25