Archlinux 安装和配置vim补全插件YouCompleteMe的过程。

參考:

https://github.com/Valloric/YouCompleteMe

https://github.com/gmarik/Vundle.vim

http://www.cnblogs.com/zhongcq/p/3630047.html

先上图,看效果!

YouCompleteMe的C++自己主动补全, syntastic的实时语法检測!

另外,里面还有缩进对齐显示的插件'Yggdroot/indentLine',以及好看的状态栏显示插件'Lokaltog/vim-powerline'

1.用vundle下载YouCompleteMe,syntastic,indentLine和vim-powerline

Bundle 'Valloric/YouCompleteMe'

Bundle 'scrooloose/syntastic'

Bundle 'Lokaltog/vim-powerline'

Bundle 'Yggdroot/indentLine'

2.下载并安装clang

pacman -S clang (编译会得到/usr/lib/libclang.so)

3. 使用上一步编译得到的libclang库

cd ~
mkdir ycm_build
cd ycm_build


cmake -G "Unix Makefiles" -DEXTERNAL_LIBCLANG_PATH=/usr/lib/libclang.so. ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
make ycm_support_libs

4.配置.vimrc
""""""""""syntastic""""""""""""
let g:syntastic_check_on_open = 1
let g:syntastic_cpp_include_dirs = ['/usr/include/']
let g:syntastic_cpp_remove_include_errors = 1
let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = '-std=c++11 -stdlib=libstdc++'
"set error or warning signs
let g:syntastic_error_symbol = '✗'
let g:syntastic_warning_symbol = '⚠'
"whether to show balloons
let g:syntastic_enable_balloons = 1 """"""""""""YCM""""""""""""""""""""
"let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'
"let g:ycm_collect_identifiers_from_tags_files = 1
set completeopt=longest,menu "让Vim的补全菜单行为与一般IDE一致(參考VimTip1228)
autocmd InsertLeave * if pumvisible() == 0|pclose|endif "离开插入模式后自己主动关闭预览窗体
inoremap <expr> <space>       pumvisible() ? "\<C-y>" : "\<space>"
"按空格键即选中当前项
let g:ycm_cache_omnifunc=0 " 禁止缓存匹配项,每次都又一次生成匹配项
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_confirm_extra_conf = 0
"在凝视输入中也能补全
let g:ycm_complete_in_comments = 1
"在字符串输入中也能补全
let g:ycm_complete_in_strings = 1
"凝视和字符串中的文字也会被收入补全
let g:ycm_collect_identifiers_from_comments_and_strings = 0 nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR> 
" 跳转到定义处
"""""""""""""""""""""""""""""""""""""""""
""""""""""syntastic""""""""""""
let g:syntastic_check_on_open = 1
let g:syntastic_cpp_include_dirs = ['/usr/include/']
let g:syntastic_cpp_remove_include_errors = 1
let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = '-std=c++11 -stdlib=libstdc++'
"set error or warning signs
let g:syntastic_error_symbol = '✗'
let g:syntastic_warning_symbol = '⚠'
"whether to show balloons
let g:syntastic_enable_balloons = 1 """"""""""""YCM""""""""""""""""""""
"let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'
"let g:ycm_collect_identifiers_from_tags_files = 1
set completeopt=longest,menu "让Vim的补全菜单行为与一般IDE一致(參考VimTip1228)
autocmd InsertLeave * if pumvisible() == 0|pclose|endif "离开插入模式后自己主动关闭预览窗体
inoremap <expr> <CR>       pumvisible() ? "\<C-y>" : "\<CR>"
"回车即选中当前项
let g:ycm_cache_omnifunc=0 " 禁止缓存匹配项,每次都又一次生成匹配项
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_confirm_extra_conf = 0
"在凝视输入中也能补全
let g:ycm_complete_in_comments = 1
"在字符串输入中也能补全
let g:ycm_complete_in_strings = 1
"凝视和字符串中的文字也会被收入补全
let g:ycm_collect_identifiers_from_comments_and_strings = 0 nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR> 
" 跳转到定义处
""""""""""""""""""""""""""""""""""""""""" """"""""vimPowerline""""""""'
"if want to use fancy,need to add font patch -> git clone git://gist.github.com/1630581.git ~/.fonts/ttf-dejavu-powerline
"let g:Powerline_symbols = 'fancy'
let g:Powerline_symbols = 'unicode'
"'''''''''''''''''''''''''''''''''''''''''
"

Archlinux YouCompleteMe+syntastic vim自己主动补全插件,显示缩进和状态栏美化,爽心悦目的vim的更多相关文章

  1. 新时代的Vim C++自动补全插件 clang_complete

    Vimer的福音 新时代的Vim C++自动补全插件 clang_complete   使用vim的各位肯定尝试过各种各样的自动补全插件,比如说大名鼎鼎的 OmniCppComplete .这一类的插 ...

  2. vim python自动补全插件:pydiction

    vim python自动补全插件:pydiction 可以实现下面python代码的自动补全: 1.简单python关键词补全 2.python 函数补全带括号 3.python 模块补全 4.pyt ...

  3. vim中自动补全插件snipmate使用

    vim中自动补全插件snipmate使用 1.下载snipMatezip:https://github.com/msanders/snipmate.vim/archive/master.zip 2.解 ...

  4. Vimer的福音 新时代的Vim C++自动补全插件 clang_complete

    使用vim的各位肯定尝试过各种各样的自动补全插件,比如说大名鼎鼎的 OmniCppComplete .这一类的插件都是对 Ctags 生成的符号表进行字符串匹配来获得可能的补全项.他们在编写 C 代码 ...

  5. Linux VIM python 自动补全插件:pydiction

    Pydiction 可以是我们使用Tab键自动补全Python代码在Vim,是一款非常不错的插件. Pydiction不需要安装,所有没有任何依赖包问题,Pydiction主要包含三个文件. pyth ...

  6. vim安装自动补全插件

    1. 先安装Pathogen,以便后续的插件安装. 打开网址https://github.com/tpope/vim-pathogen可以查看具体安装方法. a.创建目标并安装: mkdir -p ~ ...

  7. fedora 20下安装vim的C++补全插件clang_complete

    1.安装clang yum install clang 2.安装clang_complete插件 git clone https://github.com/Rip-Rip/clang_complete ...

  8. 辛星深入分析vim的自己主动补全功能以及vim的映射

    曾经对于vim的自己主动补全功能,都是须要的时候从网上下载点配置项,然后复制到自己的vimrc上去,自己也不知道是什么意思.结果发现搜索到的非常多自己主动补全的方式都非常另类,有的喜欢在补全大括号的时 ...

  9. VIM自动补全插件 - YouCompleteMe--"大神级vim补全插件"

    VIM自动补全插件 - YouCompleteMe 序言 vim 之所以被称为编辑器之神多半归功于其丰富的可DIY的灵活插件功能,( 例如vim下的这款神级般的代码补全插件YouCompleteMe) ...

随机推荐

  1. UVA 11992 - Fast Matrix Operations(段树)

    UVA 11992 - Fast Matrix Operations 题目链接 题意:给定一个矩阵,3种操作,在一个矩阵中加入值a,设置值a.查询和 思路:因为最多20列,所以全然能够当作20个线段树 ...

  2. 好的安排小明(南阳19)(DFS)

    擅长排列的小明 时间限制:1000 ms  |  内存限制:65535 KB 难度:4 描写叙述 小明十分聪明,并且十分擅长排列计算.比方给小明一个数字5,他能立马给出1-5按字典序的全排列,假设你想 ...

  3. linux并发连接数查看

    1.查看Webserver(Nginx Apache)的并发请求数及其TCP连接状态: netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) pri ...

  4. 《Tips for Optimizing C/C++ Code》译文

    前不久在微博上看到一篇非常好的短文讲怎样对C/C++进行性能优化,尽管其面向的领域是图形学中的光线跟踪,可是还是具有普遍的意义,将其翻译成中文,希望对大家写高质量代码有帮助. 1.     牢记阿姆达 ...

  5. CentOS7 防火墙 firewall-cmd

    最小化安装 CentOS7 后,很多端口默认是不打开的,需要通过  firewall-cmd   把这些端口打开. 检查防火墙状态 # firewall-cmd --state running 关闭防 ...

  6. 付款页面DEMO

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveHRxdWVlbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA ...

  7. MVC 使用IBatis.net

    IBatis.net在asp.net MVC下的使用 IBatis.net 是2001年发起的开源项目,它是一个轻量级的ORM框架,现在IBatisNET已经是属于Apache下的一个子项目了,最新版 ...

  8. IOS经典的书籍推荐

    基础 objective-c基础教程 iphone 开发秘籍 进阶篇 iOS 6编程实战 Objective-C 高级编程:iOS与OS X多线程和内存管理 Effective Objective-C ...

  9. Android学习小Demo(20)关于Fragment的应用

    Android在3.0之后引入了Fragment的概念,我推測其想法可能仅仅是想更好地兼容大屏幕或者平板的开发,由于大屏幕能够展示很多其它的内容,而内容一多,逻辑有可能就乱,而利用Fragment,则 ...

  10. bcp sqlcmd bulkinsert在unicode问题,Unexpected EOF encountered in BCP data-file

    senario 进入sqlcmd使用:out xxx产生的数据文件,因为sqlcmd export to file 默认情况下,中国的乱码.因此,使用-u(unicode)开关 @echo off & ...