我在配置vim插件CtrlP时遇到问题。我通常在3种不同的目录(例如C:/A、C:/B/D、J:/A )中处理文件,当我启动vim并尝试查找文件时,CtrlP没有找到任何文件。
那么,如何才能让CtrlP首先查看这些目录呢?其次,我希望CtrlP记住我打开的所有文件,因为我很可能再次打开它们,我如何告诉CtrlP这样做呢?
这是我的配置
"=============================
"=========== CTRLP ===========
"=============================
">>Use this option to change the mapping to invoke CtrlP in |Normal| mode
let g:ctrlp_map = '<c-p>'
">>Set the default opening command to use when pressing the above mapping
let g:ctrlp_cmd = 'CtrlP'
">>searching by filename (as opposed to full path)
let g:ctrlp_by_filename = 0 "in {0,1}
">>When opening a file, if it's already open in a window somewhere, CtrlP will try
" to jump to it instead of opening a new instance
let g:ctrlp_switch_buffer = 'E'
">>Set the directory to store the cache files
let g:ctrlp_cache_dir = 'C:/Travail/Tools/vim-7.4.020-python-2.7-python-3.3-windows-x86/bundle/ctrlp.vim-master/cacheFiles'附加问题:在这个插件中,和其他插件一样,我想提到$VIM,对我来说它就是C:/Travail/Tools/vim-7.4.020-python-2.7-python-3.3-windows-x86,但是在这里,看起来CtrlP不理解它,我如何修改g:ctrlp_cache_dir以使用$VIM
发布于 2013-10-04 15:49:04
您的问题实际上与CtrlP无关,因为它只是试图遵循Vim自己的模式。
其中一个模式是“工作目录”:它是在Vim启动时自动设置的,以后可以更改,但它通常是项目的顶级目录。要使CtrlP和Vim能够找到您的文件,您必须将工作目录设置为三个目录的父目录。这是在:cd /path/to/dir上完成的,但我的印象是,您将无法在Windows上找到这样的dir。
或者,可以将映射添加到您的vimrc中。
nnoremap <key> :CtrlP /path/to/dir1<CR>
nnoremap <key> :CtrlP /path/to/dir2<CR>
nnoremap <key> :CtrlP /path/to/dir3<CR>并使用:CtrlPMRU或:CtrlPMixed。
我同意Ingo的观点,这是问题追踪器的东西。
但是,实际上,你需要的是整合你所有的东西和修正你的工作流程。
https://stackoverflow.com/questions/19184923
复制相似问题