Windows下YouCompleteMe安装教程

简介

YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for Vim.
参考: https://github.com/Valloric/YouCompleteMe#full-installation-guide
本篇文章默认读者知道什么是 unix/linux,vim/vi, YouCompleteMe,如果有不清楚的,Search engine is your friend 或者留言讨论。YouCompleteMe 简称 YCM 以下都称为 YCM

安装步骤:

1. 确保 vim 版本是 7.4.143 或以上,并且支持 python 2/3 脚本

输入vim –version
这里写图片描述
在 vim 中键入命令 :echo has(‘python’) || has(‘python3’),若结果是 1 则证明是支持的。

2. 通过 Vundle 来安装 YCM(官方推荐)

在 vim 的配置文件 ~/.vimrc 中添加一行(在call vundle#begin() 和 call vundle#end() 之间)

call vundle#begin()
. . . 
Plugin 'Valloric/YouCompleteMe’
. . .
call vundle#end()

然后保存运行 vim 命令 :PluginInstall 安装 需要特别注意的是这个时候可能等的时间会相当的长

~/.vimrc添加以下内容

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim

call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

Plugin 'tpope/vim-fugitive'
Plugin 'Valloric/YouCompleteMe'

Plugin 'git://git.wincent.com/command-t.git'

Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
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

3.安装完成YCM

> 安装完成后基本上可以使用但当前不支持C、JavaScript、Go等语言的语义补全

4.下载cmake

下载cmake用于构建具体添加方法参见
https://github.com/Valloric/YouCompleteMe

5.参考链接:http://www.jianshu.com/p/d908ce81017a?nomobile=yes

猜你喜欢

转载自blog.csdn.net/qq_22989777/article/details/78465325