mileszs / ack.vim

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

ag (the_silver_searcher) support? #57

Closed rking closed 11 years ago

rking commented 11 years ago

What do you think about preferring ag if it is installed?

(Or, perhaps we could add an :Ag command?)

I profiled it and it's a bazillion times faster.

ku1ik commented 11 years ago

@rking just put following in your .vimrc:

let g:ackprg = 'ag --nogroup --nocolor --column'

Works fine for me.

rking commented 11 years ago

https://github.com/rking/ag.vim#readme

janbaer commented 6 years ago

I tried to use ag instead of ack with activating the config from @rking and I tried also the config with --vimgrep but whenever I activate it, it finds nothing. When I undo my changes and use ack instead it works fine. Ag works fine from the command line, so I don't see where the problem could be. Any tips, how I could find out, why I get no search results with using ag in VIM?

ches commented 6 years ago

@janbaer When enabling let g:ackprg = 'ag --vimgrep' and saying you get no results, are you running it from a project with a version control system?

Common problem: ag walks up the directory structure looking for files like .gitignore and tries to use them; if your home directory is a Git repo (for your personal config files) that ignores everything not explicitly/forcefully added, then you run ag in some subdirectory of your home dir that is not a VCS repo itself, you'll be implicitly ignoring everything. Try adding --skip-vcs-ignores or --unrestricted to debug.

janbaer commented 6 years ago

I'm not sure why, but it's working now, aaaand it's blazing fast...