我如何才能忽略 *.orig 文件?
我把它放在我的 .ackrc 中:
--type-set=DUMB=*.orig
--noDUMB
...但我仍然在我的 ack 结果中看到像 main.py.orig 这样的文件。我也尝试过 --type-set=DUMB=*.*.orig
,但这也不起作用。
更多信息
从我的命令行运行(OSX Snow Leopard 使用:
timmfin at lorien in ~/dev/performable/rafa on landing-pages-csv-and-more!
± ack modules --python | grep '.orig'
src/rafa/main.py.orig:25:import rafa.ui.modules.helpers
src/rafa/main.py.orig:26:from rafa.ui.modules.performable_form import PerformableForm
src/rafa/main.py.orig:27:from rafa.ui.modules.page_form import PageEditForm
src/rafa/main.py.orig:28:from rafa.ui.modules.settings_form import SettingsForm
....
timmfin at lorien in ~/dev/performable/rafa on landing-pages-csv-and-more!
± cat ~/.ackrc
--color
--sort-files
--smart-case
--type-set=sass=.sass
--type-set=coffee=.coffee
--ignore-dir=rafa/static
--ignore-dir=compiled
--ignore-dir=compressed
--ignore-dir=venv
--ignore-dir=build
timmfin at lorien in ~/dev/performable/rafa on landing-pages-csv-and-more!
± ack --version
ack 1.94
Running under Perl 5.10.0 at /usr/bin/perl
I put this in my .ackrc:
--type-set=DUMB=*.orig
--noDUMB
... but I'm still seeing files like main.py.orig in my ack results. I tried doing --type-set=DUMB=*.*.orig
too, but that didn't work either.
More info
Run from my command line (OSX Snow Leopard with :
timmfin at lorien in ~/dev/performable/rafa on landing-pages-csv-and-more!
± ack modules --python | grep '.orig'
src/rafa/main.py.orig:25:import rafa.ui.modules.helpers
src/rafa/main.py.orig:26:from rafa.ui.modules.performable_form import PerformableForm
src/rafa/main.py.orig:27:from rafa.ui.modules.page_form import PageEditForm
src/rafa/main.py.orig:28:from rafa.ui.modules.settings_form import SettingsForm
....
timmfin at lorien in ~/dev/performable/rafa on landing-pages-csv-and-more!
± cat ~/.ackrc
--color
--sort-files
--smart-case
--type-set=sass=.sass
--type-set=coffee=.coffee
--ignore-dir=rafa/static
--ignore-dir=compiled
--ignore-dir=compressed
--ignore-dir=venv
--ignore-dir=build
timmfin at lorien in ~/dev/performable/rafa on landing-pages-csv-and-more!
± ack --version
ack 1.94
Running under Perl 5.10.0 at /usr/bin/perl
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
现在 ack 2.0 可用:
可以通过命令行或
.ackrc
。可以按名称忽略文件。要忽略 ctags 生成的文件:
可以在文档中找到不同用途的过滤器。
Now that ack 2.0 is available:
, either on command line or
.ackrc
.It is possible to ignore files by name. To ignore ctags generated files:
Filters for different uses can be found on documentation.
对于 ack 版本 1.x
我发现如果我删除星号(来自 Ackmate wiki)
您可以通过运行查看 ackmate 支持哪些类型的文件(包括您在 ~/.ackrc 中指定的文件):
For ack version 1.x
I found this worked if I removed the asterisk (from the Ackmate wiki)
You can see what types of file ackmate supports by running (including those you've specified in ~/.ackrc):
对于 ack 版本 1.x,请使用以下内容。就我而言,我想忽略 .css 文件。我必须设置名为“SOMETHING”的类型。然后将其设置为 --noSOMETHING 以将其从搜索中删除。
For ack version 1.x use the following. In my case, I want to ignore .css files. I have to set the type called SOMETHING. Then set it to --noSOMETHING to remove it from search.
ack 首先无法识别 .orig 文件。我猜您正在以某种方式从
ackrc
或ACK_OPTIONS
调用ack -a
。ack doesn't recognize .orig files in the first place. I'm guessing you are somehow invoking
ack -a
either from yourackrc
orACK_OPTIONS
.