YouCompleteMe_Installation

来源:互联网 发布:iphone蓝牙不支持mac 编辑:程序博客网 时间:2024/05/21 12:15

YouCompleteMe安装教程


1. 安装vundle

Vundle用于vim插件管理软件,安装过程如下:
* 下载Vundle

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  • ​设置Vundle
    .vimrc开头添加如下内容:
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 'VundleVim/Vundle.vim'" All of your Plugins must be added before the following linecall vundle#end()            " requiredfiletype plugin indent on    " required

之后运行vim并且运行:PluginInstall

2. 利用Vundle安装YouCompleteMe

继续在.vimrc添加如下内容,表示安装YouComplete插件

Plugin 'Valloric/YouCompleteMe'

打开vim并且运行:PluginInstall

3. 编译YCM

  • 需要安装编译工具:
sudo apt-get install build-essential cmake

和Python头文件:

sudo apt-get install python-dev python3-dev
  • 编译YCM
cd ~/.vim/bundle/YouCompleteMe./install.py --clang-completer

其中的--clang-completer表示开启对C系列语言的支持。
此外它还支持GoJavaScript等,编译选项分别为:--gocode-completer--tern-completer
或者使用--all开启全部的选项。

参考网址

  1. https://github.com/VundleVim/Vundle.vim#about
  2. https://github.com/Valloric/YouCompleteMe
0 0
原创粉丝点击