如何使用vim-plug安装cscope_maps?

时间:2018-12-08 21:20:15

标签: vim-plugin cscope

我正在使用vim-plug来管理vim(版本7)插件依赖性,并尝试利用these cscope key mappings中的this tutorial

这是我是否需要通过将其复制并粘贴到~/.vim/plugged/目录中而在插件系统之外安装的东西?

1 个答案:

答案 0 :(得分:1)

我从http://cscope.sourceforge.net/cscope_maps.vim创建了一个镜像,并将其提供给我的仓库(https://github.com/dr-kino/cscope-maps)。

首先,您需要安装cscope。之后,您需要将以下行放在.vimrc上:

" Cscope Key Map
call plug#begin('~/.vim/plugged')
Plug 'dr-kino/cscope-maps'
call plug#end()

打开vim并运行:PlugInstall

现在您可以使用键绑定ctrl \ s,ctrl \ f,ctrl \ g等。

不要忘记在您的根项目文件夹中生成CSCOPE数据库,否则将无法正常工作。

示例(http://cscope.sourceforge.net/cscope_vim_tutorial.html):

find /my/project/dir -name '*.c' -o -name '*.h' > /foo/cscope.files
cd /foo
cscope -b
CSCOPE_DB=/foo/cscope.out; export CSCOPE_DB

BR