我想填写下面elsif的部分.vimrc,任何人都可以帮助我使用正确的Windows语法吗?
if executable( 'ag' )
if has( 'unix' )
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
elsif has( 'win32' )
" ?
endif
endif
Run Code Online (Sandbox Code Playgroud)
Unix版本在我的Windows gvim中不起作用.
除了@ amos的答案之外,你还可以在CtrlP中使用ag来增加一点,如下所述:
" 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
Run Code Online (Sandbox Code Playgroud)