Vundle
- 直接从github上拉下来
git clone [https://github.com/VundleVim/Vundle.vim.git](https://github.com/VundleVim/Vundle.vim.git) ~/.vim/bundle/Vundle.vim
- 根目录下vim .vimrc
- 在.vimrc中增加描述如下, 最后命令行输入 :wp保存退出
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end()
- 打开vim ,命令行输入“:PluginInstall”
- 等到命令行提示Done,即可;
Tagbar(Ubuntu 18.04.6 LTS && 非root权限)
- 该插件依赖ctags,所以需要安装的插件总共两个,Tagbar && ctags
- 安装ctags,根据以下步骤:
①#从git下载
②执行以下指令git clone https://github.com/universal-ctags/ctags.git
#打开ctags/ $ cd ctags/ #执行以下指令 $ ./autogen.sh $ ./configure --prefix=/where/you/want # defaults to /usr/local #特别注意如果是非root权限执行make install会报错,因为需要把一些文件写入用到sudo权限 #非root权限替换为./configure --prefix=$HOME/.local $ make $ make install #end 至此完成ctags安装
- 安装tagbar,在.vimrc增加如下描述
#安装插件 call vundle#begin() Plugin 'majutsushi/tagbar' call vundle#end() #配置 let tagbar_left =1 let tagbar_width =40 #侧边栏显示行码 let g:tagbar_show_linenumbers = 1 let g:tagbar_ctags_bin='/usr/bin/ctags' #快捷键"tt"打开函数列表 nnoremap tt :TagbarToggle<cr><C-W>h #快捷键"oo"当前操作窗口切换到函数列表框 nnoremap oo :TagbarOpen fj<cr><C-W>h autocmd BufReadPost *.cpp,*.c,*.h,*.hpp,*.cc,*.cxx call tagbar#autoopen()
- 打开vim ,命令行输入“:PluginInstall”
- 等到命令行提示Done,即可;
Ctrlp插件
1.打开.vimrc,写入
call vundle#begin()
Plugin 'kien/ctrlp.vim’
call vundle#end()
#配置
nmap ,, :CtrlP getcwd()<cr> #快捷键",,"启动ctrlp
#ctrl+B 可以切换搜索的范围是 当前目录还是 搜索历史
- 打开vim ,命令行输入“:PluginInstall”
- 等到命令行提示Done,即可