Vim Ctrlp无法正确解析Ag(银色搜索) – 标注选项
发布时间:2020-12-16 01:35:59 所属栏目:安全 来源:网络整理
导读:在命令行上使用ag时,如下所示: $ ag. –ignore =“* node_modules / * / node_modules”-l –nocolor -f -U -g“” 我能够避免在我的节点服务中搜索多个深度级别的任何node_modules目录,这是所需的行为. 但是,当我在我的vimrc中使用以下内容时,不会忽略多个
在命令行上使用ag时,如下所示:
$> ag. –ignore =“* node_modules / * / node_modules”-l –nocolor -f -U -g“” 我能够避免在我的节点服务中搜索多个深度级别的任何node_modules目录,这是所需的行为. 但是,当我在我的vimrc中使用以下内容时,不会忽略多个深度级别的node_modules目录: " Use The Silver Searcher https://github.com/ggreer/the_silver_searcher if executable('ag') " Use Ag over Grep set grepprg=ag --nogroup --nocolor " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore let g:ctrlp_user_command = 'ag %s --ignore="*node_modules/*/node_modules" -l --nocolor -f -U -g ""' endif 如何设置ag和ctrlp以正确忽略这些目录? 我没有把它放在野外的原因是我的.gitignore中忽略了node_modules,所以我使用-U选项忽略任何vcs文件(从而允许ag搜索node_modules) – 但这个选项似乎也是绕过荒地.
像你一样,我使用这两种工具,但我忽略文件夹的方式是不同的
对于Ag我使用.agignore文件,它与.gitignore具有相同的sintax,就像它一样,它可以放在你的主文件夹或项目文件夹中. 不确定这是否能解决你的问题,在任何情况下它对我来说已经很快了所以我使用正常的忽略变量,如下所示: let g:ctrlp_custom_ignore = { 'dir': 'v[/](doc|tmp|node_modules)', 'file': 'v.(exe|so|dll)$', } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |