如何避免emacs中调用ag搜索elpa中的文件
path/to/.agignore:
/elpa
没看懂,
在你的目标搜索目录下建一个名为.agignore
的文件,然后文件内容是/elpa
.
如果想全局配置的话应该要配置一个类似于xxxx-ag-base-command
的变量,我不用helm所以不知道具体名称。但是你应该在那里面填上你需要的ignore参数
还是不行,我在想想吧
根据 manpage , .agignore
应该需要放在 $HOME
下:
IGNORING FILES
By default, ag will ignore files whose names match patterns in .gitignore, .hgignore, or .ignore. These files can be anywhere
in the directories being searched. Binary files are ignored by default as well. Finally, ag looks in $HOME/.agignore for
ignore patterns.
If you want to ignore .gitignore and .hgignore, but still take .ignore into account, use -U.
Use the -t option to search all text files; -a to search all files; and -u to search all, including hidden files.
另外,可以先在终端中测试,排除 Emacs, Helm 的影响。
谢谢大家的帮忙,问题解决了,添加.agignore文件并且需要在customize-group helm-ag 中设置一下就可以了
具体怎么做呢