mileszs / ack.vim

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

How can I ignore a folder from the search? #210

Closed kaiomagalhaes closed 7 years ago

kaiomagalhaes commented 7 years ago

I'm currently working with Golang and we have a vendors folder with all the libraries we are using on the project. I would like to ignore this folder when using ack.vim, is it possible? If so, how can I do it?

Thanks

ches commented 7 years ago

There are several ways to approach this. I suggest using the config files supported by the search tools, then there's nothing to do for ack.vim itself, it will Just Work.

If you're using Ack, it supports project-local config files. You can do this:

# your/project/dir/.ackrc
--ignore-dir=vendor

If you're using The Silver Searcher, it supports .ignore files in addition to .gitignore, in case your team wants to track vendor in Git but you want to ignore it with ag.

# your/project/dir/.ignore
vendor/

You can put .ignore in your global Git ignores (git help gitignore) so everyone on your projects doesn't have to care that you use ag.

Check the documentation/man pages of the tools for more details.