Vim安装YouCompleteMe

操作系统版本:Ubuntu 18.04(64位)


下载Vundle

Terminal command
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

~/.vimrc中增加如下内容

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

Plugin 'Valloric/YouCompleteMe'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype 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

安装插件
在vim中使用命令:BundleInstall

安装YouCompleteMe

Terminal command
$ sudo apt install build-essential cmake python3-dev
$ cd ~/.vim/bundle/YouCompleteMe
$ python3 install.py --clang-completer

配置YouCompleteMe
$ cp ~/.vim/bundle/YouCompleteMe/third_party/ycmd/examples/.ycm_extra_conf.py ~/.vim/
let g:ycm_server_python_interpreter=’/usr/bin/python’
let g:ycm_global_ycm_extra_conf=’~/.vim/.ycm_extra_conf.py’

你可能感兴趣的:(Ubuntu)