TA的每日心情 | 开心 2020-6-18 22:00 |
---|
签到天数: 1 天 [LV.1]初来乍到
管理员
  
- 积分
- 1645
|
1、安装cmake,因为YCM需要cmake的支持:
- [root@hellowld bundle]# yum install cmake
- ... ...
- 已安装:
- cmake.x86_64 0:2.8.12.2-4.el6
- 完毕!
复制代码
2、切换到目录~/.vim/bundle/
3、命令行执行如下命令(确保git已安装,否则执行不成功):
- git clone https://github.com/gmarik/vundle.git
复制代码 4、等待vundle安装成功(下面是安装过程中输出的信息):
- [root@hellowld bundle]# git clone https://github.com/gmarik/vundle.git
- Initialized empty Git repository in /root/.vim/bundle/vundle/.git/
- remote: Counting objects: 3081, done.
- remote: Total 3081 (delta 0), reused 0 (delta 0), pack-reused 3081
- Receiving objects: 100% (3081/3081), 918.71 KiB | 45 KiB/s, done.
- Resolving deltas: 100% (1076/1076), done.
复制代码 5、编辑.vimrc,在vimrc中加入如下内容:
- <pre>set nocompatible " be iMproved, required
- filetype off " required</pre>set rtp+=~/.vim/bundle/vundle/
- call vundle#rc()
- Bundle 'gmarik/vundle'
- <pre>filetype plugin indent on " required</pre><pre>Bundle 'Valloric/YouCompleteMe'</pre>
复制代码 有的资料里是这样写的,里面还包含了几个不知道的插件:
- set nocompatible " be iMproved, required
- filetype off " required
- " set the runtime path to include Vundle and initialize
- set rtp+=~/.vim/bundle/vundle/
- call vundle#rc()
- " alternatively, pass a path where Vundle should install plugins
- "let path = '~/some/path/here'
- "call vundle#rc(path)
- " let Vundle manage Vundle, required
- Plugin 'gmarik/vundle'
- " The following are examples of different formats supported.
- " Keep Plugin commands between here and filetype plugin indent on.
- " scripts on GitHub repos
- Plugin 'tpope/vim-fugitive'
- Plugin 'Lokaltog/vim-easymotion'
- Plugin 'tpope/vim-rails.git'
- " The sparkup vim script is in a subdirectory of this repo called vim.
- " Pass the path to set the runtimepath properly.
- Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
- " scripts from http://vim-scripts.org/vim/scripts.html
- Plugin 'L9'
- Plugin 'FuzzyFinder'
- " scripts not on GitHub
- Plugin 'git://git.wincent.com/command-t.git'
- " git repos on your local machine (i.e. when working on your own plugin)
- Plugin 'file:///home/gmarik/path/to/plugin'
- " ...
- filetype plugin indent on " required
- Bundle 'Valloric/YouCompleteMe'
复制代码
6、安装插件,打开一个空白的vim编辑窗口,执行命令BundleInstall:
等待下载完成... ...
7、切换到~/.vim/bundle/YouCompleteMe/
8、执行下列安装命令
- [root@hellowld YouCompleteMe]# ./install.sh --clang-completer --omnisharp-completer
复制代码 YCM开始装,这里的两个参数--clang-completer支持c/c++。--omnisharp-completer支持c#
|
|