How do I exclude files and directories from a project in vim (using janus)?
Asked Answered
C

3

9

I'm moving from Textmate to vim (with janus) and want to exclude some directories from Ack in particular, and also NERDTree.

The reason I want to do this is that Ack is useless (takes minutes to run, and produces no results) with one of my large projects which contains a directory full of marshalled db data (with many subdirectories and hundreds of thousands of files).

I know how to exclude files (not directories) from NERDTree, and also exclude patterns from CommandT. Neither of these solve my Ack issue.

I'm a complete vim n00b. Thanks for reading.

Chancy answered 27/6, 2011 at 9:47 Comment(1)
What options do you use for Ack? --ignore-dir=nameOfDirectory will ignore nameOfDirectory.Ozoniferous
W
10

By default, ack only checks your ~/.ackrc file for it’s default switches. You can have per directory ack settings if you add this to your .bash_profile:

export ACKRC=".ackrc"

http://www.rustyrazorblade.com/2012/03/making-better-use-of-your-ackrc-file/

Wilmawilmar answered 26/4, 2012 at 23:12 Comment(1)
Actually ack looks in multiple locations for .ackrc. Not just ~/.ackrc. Please refer to the ack documentation beyondgrep.com/documentation/…. It looks at all the locations, global, user and project.Sympathizer
P
4

For NerdTree, use NERDTreeIgnore setting.

as for Ack - you can set --ignore-dir flag in your .ackrc (as explained in Ack's man page)

Ptah answered 9/10, 2011 at 12:38 Comment(3)
Thanks. So it's not possible to do exclude directories from Ack on a per-project basis?Chancy
You could create a wrapper script which sets ACK_OPTIONS per project basis, so it would be something like ACK_OPTIONS=--ignore-dir=lolwut ack $1 and use it instead of ack command.Ptah
I think this is the best I can get. Thanks!Chancy
S
0

I only had to create a .ackrc in my top directory with the following:

--ignore-dir=log/
Saintjust answered 22/5, 2015 at 6:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.