vim - 什么是正确的 Vim/Ag g :ctrlp_user_command value for Windows?

标签 vim ctrlp ag

我要填写elsif在我的 .vimrc 部分下面,谁能帮我正确的 Windows 语法?

if executable( 'ag' )
    if has( 'unix' )
        let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
    elsif has( 'win32' )
        " ?
    endif
endif

Unix 版本在我的 Windows gvim 中不起作用。

最佳答案

除了@amos 的回答之外,您实际上还可以在 CtrlP 中添加更多使用 ag 的内容,如前所述 here:

" 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 -l --nocolor -g ""'

  " ag is fast enough that CtrlP doesn't need to cache
  let g:ctrlp_use_caching = 0
endif

关于vim - 什么是正确的 Vim/Ag g :ctrlp_user_command value for Windows?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28260090/

相关文章:

Vim 不按空格缩进

grep - ag(silver searcher)与 grep 的 --line-buffered 类似的选项是什么?

regex - 如何使用 ag 或 rg(PCRE/Rust 正则表达式)在不同行中匹配包含 word1 和 word2 的所有文件

ruby - (Mac) 当语法设置为 Ruby 时 Vim 相当慢

linux - 通过 Vim 保存平面文件向创建新行的文件添加一个不可见的字节

vim - gvim 的 CtrlP 找不到我的文件,max_files 参数已设置

vim - ctrlp 仍然搜索被忽略的目录

vim - 如何重新索引 CtrlP Vim 插件?

ag - 如何向 'ag' 添加持久配置选项?

svn:使用vim合并冲突