vi安装Vundle+YouCompleteMe+注释快捷Bundle 'scrooloose/nerdcommenter'

  • Vundle

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

Set up Vundle:

  • git上下载vundle

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

  • Configure Plugins

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如果要添加bundle就按如下的格式进行添加

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‘}

" All of your
Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent
changes, instead use:
"filetype plugin on
"
" Brief help下面是vi中的命令
" :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

如果要简单配置一下的话,这一步里可以直接   cp
~/.vim/bundle/Vundle.vim/test/vimrc ~/.vimrc,test里有写好的简单测试配置用例,下面是另一些vi的配置示例

set
number

set
autoindent

set
cindent

syntax
enable

syntax
on

"set
c_Co=256

set
backspace=indent,eol,start

set
tabstop=4

set
shiftwidth=4

set
smarttab

"set
softabstop=4

set
expandtab

set
encoding=utf-8

set
fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1

filetype
on

filetype
indent on

filetype
plugin indent on

3. ~/.vimrc中添加


1


Bundle ‘Valloric/YouCompleteMe‘

YouCompleteMe

4. 打开vim,输入命令


1


:BundleInstall

此时会自动下载~/.vimrc中添加的bundle,这里就是YouCompleteMe

5. 安装完成后,需要对YouCompleteMe进行编译安装


1

2


cd ~/.vim/bundle/YouCompleteMe

./install --clang-completer

这里如果出错并且报python库出错,可能需要安装python-dev

打开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‘,然后重新打开vim即可

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

下面这部分没改

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

  1. ‘-isystem‘,
  2. ‘/usr/include‘,
  3. ‘-isystem‘,
  4. ‘/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/>

Bundle ‘scrooloose/nerdcommenter‘

这个插件是注释用插件,可以\cc注释,用\cu取消注释

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

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

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

例如  let
leader=",‘

nnoremap <leader>jd :YcmCompleter
GoToDefinitionElseDeclaration<CR>本来需要按\jd转到变量的定义,那么现在只要按,jd就可以了

设置注释的颜色

highlight Comment ctermfg=green guifg=green

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

vi安装Vundle+YouCompleteMe+注释快捷Bundle 'scrooloose/nerdcommenter'

时间: 2024-08-03 07:59:41

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

Ubuntu 16.04 + vim8 + vundle + YouCompleteMe

[vim8] 1.卸载旧版 vim . 1.1.查看 [email protected]:~$ dpkg -l | grep vim ii  vim-common                         2:7.4.1689-3ubuntu1.2             amd64        Vi IMproved - Common files ii  vim-tiny                           2:7.4.1689-3ubuntu1.2          

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

原文网址:http://www.cnblogs.com/csuftzzk/p/3435710.html 序言 使用Ubuntu和vim已经有一段时间了,对于Vim下的插件应用,我总是抱着一股狂热的态度.这次,又在网上闲逛着,发现了一个个人博客提到了Vim代码补全这回事,并提到了YouCompleteMe这个插件.顿时激起了我折腾的欲望.以前我都是使用Ctags+<C-n>或<C-p>来进行补全,然而其命中率却比较低,有时候根本就乱匹配.于是决定将YouCompleteMe这个插件安

将成功安装的YouCompleteMe移植到同平台机器里

将成功安装的YouCompleteMe移植到同平台机器里 已经成功测试,将CentOS 6.5 x86 已经安装YouCompleteMe的副本复制到其他CentOS 6.5 x86 完美运行! 需要准备的文件: 原机器的.vimrc 文件放在新机器家目录下面 原机器的.vim目录复制到 新机器 家目录下面 原机器的 libstdc++.so.6.0.22放在新机器/usr/lib/目录下面 [[email protected] ~]# vim main.c   #尝试创建文件 YouCompl

Vim Vundle YouCompleteMe

/************************************************************************************** * Vim Vundle YouCompleteMe * 说明: * 之前在Vim中安装YCM出了问题,装不了,这次花点时间再折腾一下,可以了. * * 2016-8-14 深圳 南山平山村 曾剑锋 **************************************************************

在树莓派上安装YCM(YouCompleteMe)

? 太折腾了!如果你搜索到了这篇文章,建议直接使用SpaceVim作为替代品. 0x0.第一个坑--不支持Python ? 我的树莓派的系统是基于Debian Stretch的Raspbian Stretch.使用apt-get安装的vim不支持python脚本.你可以通过输入: 1 vim --version | grep python 来检查,如果发现python/python3前面出现了加号,恭喜你,你可以跳过本步骤了.它说明你的vim支持python.如果都是减号,你需要重新编译安装vi

Ubuntu 使用 vim_plug 安装插件 YouCompleteMe 报错“ycmd server SHUT DOWN”

前言 最近在捣鼓 vim ,因为之前的 vim 自动补全等等功能太菜了,所以在在自己的客户端上部署了 github 上一个高星的 vim 配置 -- k-vim .但在最后安装的 YouCompleteMe 插件时却失败了.我翻了一翻 YCM 的 ISSUSE ,终于知道了 why -- Ubuntu 16.04 的 vim 使用过程中连接 YCM SERVER 时需要 python 支持,否则会出现 "ycmd server SHUT DOWN" 的字样. 解决办法 参考了 YCM

eclipse安装maven插件-解决requires ‘bundle org.slf4j.api 1.6.2′

eclipse安装maven插件-解决requires 'bundle org.slf4j.api 1.6.2′ [转载]http://robin.sh/html/1526_eclipse-maven.html 给eclipse安装maven插件,网上教程已经很多,不在累述.关键是安装过程中报错:requires 'bundle org.slf4j.api 1.6.2' but it could not be found. 这个错误很难搞,网上提供的解决方案绝大部分都不起作用.可能跟eclips

简单vi配置:YouCompleteMe

下图就是我的VI: 按F5 F6分别调出左右的窗口: 按C-P点出CtrlP搜索,直接查找工程中的文件: 自动补全用的YouCompleteMe,超级强悍: 先发3个有用的连接: https://github.com/humiaozuzu/dot-vimrc https://github.com/spf13/spf13-vim https://github.com/amix/vimrc . 我就是先根据第一个连接做的, 然后又加入了以下修改(是不是很懒 哈哈哈): 在.vimrc 中加入以下代码

debian下安装vundle出现unknow function begin 错误解决

首先说下我的原因 是因为配置中 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 wh