37

我把它放在我的 .ackrc 中:

--type-set=DUMB=*.orig
--noDUMB

...但我仍然在我的确认结果中看到 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
4

4 回答 4

88

现在 ack 2.0 可用:

--ignore-file=ext:orig

,在命令行或.ackrc.

可以按名称忽略文件。要忽略 ctags 生成的文件:

--ignore-file=is:tags

不同用途的过滤器可以在文档中找到。

于 2013-10-24T12:29:10.190 回答
20

对于 ack 版本 1.x

如果我删除了星号(来自Ackmate wiki) ,我发现这很有效

--type-set=DUMB=.orig
--noDUMB

您可以通过运行查看 ackmate 支持的文件类型(包括您在 ~/.ackrc 中指定的文件):

~/Library/Application\ Support/TextMate/PlugIns/AckMate.tmplugin/Contents/Resources/ackmate_ack --help type
于 2011-05-17T19:06:22.303 回答
1

对于 ack 版本 1.x,请使用以下内容。就我而言,我想忽略 .css 文件。我必须设置名为 SOMETHING 的类型。然后将其设置为 --noSOMETHING 以将其从搜索中删除。

 ack --type-set=SOMETHING=.css --noSOMETHING "My Bitcoin."

在此处输入图像描述

于 2016-03-16T14:26:58.343 回答
0

ack 首先不识别 .orig 文件。我猜你是以某种方式ack -a从你的ackrcor调用ACK_OPTIONS

于 2011-02-28T21:51:37.937 回答