gvim 安裝YouCompleteMe插件

能夠參考:YouCompleteMe#full-installation-guidephp

能夠直接下載:python

http://pan.baidu.com/s/1dDIq2Al 密碼: si5qgit

確保vim支持python

1. 去vim官網下載7.4以上的gvim版本。github

2. 去官網下載python2.7vim

3. 把python的路徑添加到環境變量裏,主要是 xxx\Python27\libs 這個路徑添加進去。windows

4. 檢驗方法,在vim裏輸入下面指令,若是返回1說明沒問題,不然就是環境路徑沒有設置正確。python2.7

:echo has('python') || has('python3')

不是1就不用往下看了。ide

安裝git 及 Vundle

1. 去git官網下載並安裝git。ui

2. 使用git下載vundle。(對於windows, 在個人電腦上, ~表明C:\Users\Administrator)url

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

3. 修改vim的vimrc文件,windows下是_vimrc文件,在最頂上添加:

set nocompatible              " be iMproved, required
filetype off                  " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end()            " required
filetype plugin indent on    " required

4. 進入vim,輸入下面命令,自此,vundle安裝完成。

:PluginInstall

安裝YCM插件

1. 使用git下載插件:

git clone https://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe

2. 而後進行下面操做:

cd ~/.vim/bundle/YouCompleteMe
git submodule update --init --recursive

3. 修改vim的_vimrc文件,在Plugin 'VundleVim/Vundle.vim'後添加:Plugin 'Valloric/YouCompleteMe',最後的內容像這樣:

set nocompatible              " be iMproved, required
filetype off                  " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
call vundle#end()            " required
filetype plugin indent on    " required

4. 進入vim,輸入下面命令,自此,YMC安裝完成。

:PluginInstall

這時,打開一個文件,會提示錯誤,這是由於尚未作完。

編譯 ycm_core 庫

1. 下載安裝Cmake

2. 安裝Visual Studio,免費社區版便可。

3. 新建一個文件夾 ycm_build

cd ~
mkdir ycm_build
cd ycm_build

 4. 開始編譯, 下面的12根據你的安裝版本,32位的把win64刪掉

cmake -G "Visual Studio 12 Win64" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp

 若是編譯不成功,那麼就使用cmake的ui一個個的試

相關文章
相關標籤/搜索