YouCompleteMe安装教程

2025-05-25 09:57:43

1、安装Vundle插件管理工具git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim在vim的配置文件vimrc里面添加如下内容(vimrc文件位置,命令模式下:echo $VIM)set nocompatible " be iMproved, requiredfiletype off " required" set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()" alternatively, pass a path where Vundle should install plugins"call vundle#begin('~/some/path/here')" let Vundle manage Vundle, requiredPlugin 'gmarik/Vundle.vim'Plugin 'Valloric/YouCompleteMe'" All of your Plugins must be added before the following linecall vundle#end() " requiredfiletype plugin indent on " required" To ignore plugin indent changes, instead use:"filetype plugin on"" Brief help" :PluginList - lists configured plugins" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate" :PluginSearch foo - searches for foo; append `!` to refresh local cache" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal"" see :h vundle for more details or wiki for FAQ" Put your non-Plugin stuff after this line

2、注意,需要注释掉vimrc文件中的 runtime!debian.vim即在此行前加"号Vundle安装完成后就可以开始安装YouCompleteMe了,配置已经在上述的文件中写好打开vim,命令行模式下输入 :PluginInstall然后就可以看到插件正在安装,由于需要下载的文件比较多(主要是下载的比较慢,普通下载速度在10kb左右),需要的时间可能会有些长,一定要耐心等待,比如作者本人就等了三个小时才提示安装完成

3、安装完成YouCompleteMe以后,需要配置方可真正发挥作用在 vimrc文件中添加如下内容:let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'然后重新打开vim即可

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢