我遇到了很棒的ctrlp.vim插件.它是我之前使用过的Command-T插件的一个很好的替代品.我对Command-T不喜欢的是,在启动vim后第一次调用文件时,重新扫描文件大约需要20-30秒.
CtrlP的工作速度要快得多,但它似乎不会自动重新扫描新创建的文件.我该如何手动触发重新扫描?
谢谢!
Jee*_*eet 273
从文档:
<F5>
- Refresh the match window and purge the cache for the current directory.
- Remove deleted files from MRU list.
Run Code Online (Sandbox Code Playgroud)
这假设你已经处于ctrl-p模式.请注意,您可以在查询中间点击F5,即,您可以键入几个字符,发现它与最近更新的文件不匹配,然后点击F5进行刷新.如果文件刚刚添加到ctrl-p缓存中,它会自动显示匹配项.
如果需要,您可以在保存发生时自动破坏缓存,因此在下次使用时将强制刷新.
把它放在你的vimrc(信用docwhat):
" CtrlP auto cache clearing.
" ----------------------------------------------------------------------------
function! SetupCtrlP()
if exists("g:loaded_ctrlp") && g:loaded_ctrlp
augroup CtrlPExtension
autocmd!
autocmd FocusGained * CtrlPClearCache
autocmd BufWritePost * CtrlPClearCache
augroup END
endif
endfunction
if has("autocmd")
autocmd VimEnter * :call SetupCtrlP()
endif
Run Code Online (Sandbox Code Playgroud)
不幸的是,没有办法在后台自动保持缓存新鲜.