ggreer / the_silver_searcher

A code-searching tool similar to ack, but faster.
http://geoff.greer.fm/ag/
Apache License 2.0
26.13k stars 1.43k forks source link

Output absolute file paths #259

Open martinfinke opened 11 years ago

martinfinke commented 11 years ago

[EDIT] I found out that using :lcd instead of :cd leaves the quickfix paths intact (because it doesn't touch its cwd). So this isn't really needed for this scenario anymore.

ag can be used as grepprg in Vim, but the quickfix doesn't work well once the path is changed (using Vim's cd). Some plugins do this automatically (like vim-rooter), and after that the relative paths in the quickfix window aren't valid anymore.

This also happens when using the Ack.vim or Ag.vim plugins.

Would it be possible to add a command-line option so that ag outputs absolute file paths? Maybe either "~/path/to/my/file.txt" or "/something/outside/the/user/directory.txt", depending on where the file is?

nofxx commented 8 years ago

Hey, this is great... there's also click on terminal open editor scenario ( eg terminator )... very useful.

Beg yr pardon for my naiveness @martinfinke , how to use lcd?

PS.: Thanks you guys for ag!! What a great piece of software.

martinfinke commented 8 years ago

@nofxx I'm not using Vim anymore since several years, and I don't remember. Sorry...

nofxx commented 8 years ago

Ah, it's a vim command, now I see. I don't use it either... Let the suggestion float open for click on terminal anyways, editor independent...

It's just one / or two ~/ chars to prepend to output... so terminal can parse it as clickable.