Vundle is short for Vim bundle and is a Vim plugin manager.

  • git上下载vundle

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

  • 配置vundle插件
    1. Put this at the top of your .vimrc to use Vundle. Remove plugins you don't need, they are for illustration purposes.

      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' " The following are examples of different formats supported.
      " Keep Plugin commands between vundle#begin/end.
      " plugin on GitHub repo
      Plugin 'tpope/vim-fugitive'
      " plugin from http://vim-scripts.org/vim/scripts.html
      Plugin 'L9'
      " Git plugin not hosted 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'
      " 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/'}
      " Install L9 and avoid a Naming conflict if you've already installed a
      " different version somewhere else.
      Plugin 'ascenator/L9', {'name': 'newL9'}
      "下面这行是添加YouCompleteMe插件
      Bundle 'Valloric/YouCompleteMe'
      "下面这行是添加注释插件,可以\cc注释,用\cu取消注注释
      Bundle 'scrooloose/nerdcommenter'
      " 所有vundle管理的插件都要在下面这行结束之前写好
      call vundle#end() " required
      filetype plugin indent on " required
      " To ignore plugin indent changes, instead use:
      "filetype plugin on
      "
      " Brief help 下面是vi中的命令,可以打开vim之后命令模式下输入执行
      " :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
      " 下面可以加一些其它的自定义vi配置,比如说:
      set number
      set autoindent
      set cindent
      syntax enable
      syntax on
      "set c_Coo=256
      set backspace=indent,eol,start
      set tabstop=4
      set shiftwidth=4
      set smarttabet
      "set softabstop=4
      set expandtab
      set encoding=utf-8
      set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,lantin1
      filetype on
      filetype indent on
      filetype plugin indent on
    2. 下载插件:

      打开vim并运行命令 :PluginInstall,会自动把上面添加的YouCompleteMe下载到~/.vim/bundle/YouCompleteMe

      To install from command line: vim +PluginInstall +qall

 

  • 下载完成YouCompleteMe后,需要对其进行编译安装

    cd ~/.vim/bundle/YouCompleteMe
    ./install --clang-completer 

这里需要安装有python-dev和cmake包

打开vim时提示No .ycm_extra_conf.py file detected, so no compile flags are available. Thus no semantic support for C/C++/ObjC/ObjC++.。只需要设置.ycm_extra_conf.py文件的位置即可,在.virmc文件中添加如下内容let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py',如果该路径下没有,有可能 在let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py',然后重新打开vim即可。  

From <http://hahaya.github.io/build-YouCompleteMe/>

  • 配置YouCompleteMe

"下面这部分没改

为了补全C++代码,在Linux下我们需要修改.ycm_extra_conf.py文件中的flags部分,使用-isystem添加系统的头文件进行解析,使用-I添加第三方的头文件进行解析,在flags部分后添加如下内容:

'-isystem',

'/usr/include',

'-isystem',

'/usr/include/c++/4.8',

10. '-isystem',

11. '/usr/include',

12. '/usr/include/x86_64-linux-gun/c++',                        

From <http://hahaya.github.io/build-YouCompleteMe/>

使用YouCompleteMe进行代码跳转可以通过绑定一个快捷键:nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>,很好理解,先跳到定义,如果没找到,则跳到声明处。\jd                               

From <http://feihu.me/blog/2014/intro-to-vim/>

:help map可以进入vi的快捷键的相关帮助文档

例如,本来需要按\jd转到变量的定义,那么现在只要按,jd就可以了

~/.vimrc:
let leader=','
letg:mapleader=','
nnoremap <leader>jd:Ycmcompleter GoToDefinitionElseDeclaration<CR>

设置注释的颜色

highlight Comment ctermfg=green guifg=green                      

From <http://blog.csdn.net/bendanban/article/details/7968055>

vi安装Vundle+YouCompleteMe+注释快捷'scrooloose/nerdcommenter'的更多相关文章

  1. Vim Vundle YouCompleteMe

    /************************************************************************************** * Vim Vundle ...

  2. windows下安装vundle

    windows下安装vundle ## 前言 windows下安装vundle和linux下稍微有些不一样,虽然官网给出了 安装说明,但是有些问题的. E117: Unknown function: ...

  3. Vim+Vundle+YouCompleteMe 安装

    这段时间在Centos 7上开发c++程序,想为vim安装YouCompleteMe插件,参照几个博客无果,果断上官网找解决方案.功夫不负苦心人,终于搞定. 学习东西还是要多上官网. 下面送上本次的收 ...

  4. Ubuntu13.04配置:Vim+Syntastic+Vundle+YouCompleteMe

    序言 使用Ubuntu和vim已经有一段时间了,对于Vim下的插件应用,我总是抱着一股狂热的态度.这次,又在网上闲逛着,发现了一个个人博客提到了Vim代码补全这回事,并提到了YouCompleteMe ...

  5. 【转】Ubuntu13.04配置:Vim+Syntastic+Vundle+YouCompleteMe

    原文网址:http://www.cnblogs.com/csuftzzk/p/3435710.html 序言 使用Ubuntu和vim已经有一段时间了,对于Vim下的插件应用,我总是抱着一股狂热的态度 ...

  6. 简单vi配置:YouCompleteMe

    下图就是我的VI: 按F5 F6分别调出左右的窗体: 按C-P点出CtrlP搜索,直接查找project中的文件: 自己主动补全用的YouCompleteMe.超级强悍: watermark/2/te ...

  7. win下gvim或者linux下的vim安装vundle都适用的配置文件 - 在当前目录及其子目录下**, 的所有文件* 中, 搜索当前光标所在的单词

    gvim下的普通配置: if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" set fileencodings=utf-8,g ...

  8. vim插件的安装方式 -- vim注释插件和doxygen函数注释生成插件-ctrlp插件-tabular等号对齐 插件

    使用unzip的时候 指定 -d选项, 是说明解压到的 目标地址. 这个参数还是比较方便的, 比直接unzip到当前目录, 然后在去拷贝到目标目录, 然后再删除当前目录中的解压文件夹, 方便多了. 使 ...

  9. vim实战:插件安装(Vundle,NerdTree)

    一:插件管理器Vundle 1.简介 Vundle是vim的一个插件管理器, 同时它本身也是vim的一个插件.插件管理器用于方便.快速的安装.删除.Vim更新插件.vim Vundle插件官方地址:h ...

随机推荐

  1. 设置eclipse中自动添加get,set的注释为字段属性的注释

    一:说明 首先具体来看一下是什么效果,上图可能会更清楚一点 就是在get/set中自动加上属性的注释,那我们要怎么配置呢? 二:配置 2.1:下载附件 下载附件 2.2:替换class 原生的ecli ...

  2. 今天我们来认识一下JSP的九大内置对象

    虽然现在基本上我们都是使用SpringMVC+AJAX进行开发了Java Web了,但是还是很有必要了解一下JSP的九大内置对象的.像request.response.session这些对象,即便使用 ...

  3. Java之多态(一)

    package test05; public class DuoTai_Test { /** * 一个对象,多种形态 * WQQ → Student.Worker.Friend 1).一个对象,多种形 ...

  4. 《Web开发中块级元素与行内元素的区分》

    一.块级元素的特性: 占据一整行,总是重起一行并且后面的元素也必须另起一行显示. HTML中块级元素列举如下: address(联系方式信息) article(文章内容) aside(伴随内容) au ...

  5. jquery的选择器

    一.基本选择器 1.$("#id") id选择器,返回单个元素 2.$(".class") class选择器,返回集合元素 3.$("element& ...

  6. 批量处理sql 数据存入xml类型列

    个人记录 需求:当表T1 ItemCode和表T2 ItemName的数据相等时,将表T2所对应的ID和ItemName列的数据分别存入表T1 CAOZUO字段的id元素和text元素的文本中. 下面 ...

  7. react-echarts之折线图的显示

    react中想要实现折线图和饼图的功能,需要引入react-echarts包,然后再实现折线图的功能.我这里引用的版本是:0.1.1.其他的写法参echarts官网即可.下面详细讲解的是我在react ...

  8. Java输入输出常用类Scanner

    Scaner类,使用获取键盘输入. public boolean DemoTest(){ Scanner input = new Scanner(System.in); System.out.prin ...

  9. Log4j记录日志步骤

    记录日志对调试Bug很有帮助  亲身体会 个人习惯用Log4J,大家可以在apache网站:jakarta.apache.org/log4j 可以免费下载到Log4j最新版本的软件包. Log4j支持 ...

  10. Mybatis环境

    第一步:下载jar包并导入 1.mysql驱动包 2.mybatis环境包 第二步:创建MYSQL数据库 由于这是用于测试,只创建了test-usreinfo数据表 第三步:在src文件夹中创建myb ...