给vim安装YouCompleteMe
要安装YouCompleteMe ,vim须支持python。看是否支持,可以在vim中:version 查看, 如果python前有+号,就是支持,减号就是不支持。
如果不支持,需要以编译安装方式重新安装vim。
编译配置选项:
./configure --with-features=huge --enable-pythoninterp --enable-python3interp --enable-luainterp --enable-multibyte --enable-sniff --enable-fontset
在我的机器上装有python2.7.5 和 python3.3, 但加了enable-python3interp参数依然没有支持py3,不知何故,先不管,YouCompleteMe 只要求有py2.6以上。
安装vundle插件
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
在.vimrc中配置
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'
保存退出,打开vim,输入 :BundleInstall 进行自动安装
进程如下,+号表示已经安装,>表示正在安装。
. Plugin 'gmarik/vundle' |~
+ Plugin 'tpope/vim-fugitive' |~
+ Plugin 'Lokaltog/vim-easymotion' |~
+ Plugin 'tpope/vim-rails.git' |~
+ Plugin 'rstacruz/sparkup' |~
+ Plugin 'L9' |~
+ Plugin 'FuzzyFinder' |~
> Plugin 'git://git.wincent.com/command-|~
t.git' |~
Plugin 'file:///home/gmarik/path/to/pl|~
ugin' |~
Plugin 'Valloric/YouCompleteMe' |~
Helptags
结束时有个错误,这是正常的,因为ycm需要手工编译出库文件
Done! With errors; press l to view log
ycm_client_support.[so|pyd|dll] and ycm_core.[so|pyd|dll] not detected; you need
to compile YCM before using it. Read the docs!
到 .vim/bundle/YouCompleteMe 下跑
./install.sh --clang-completer
参数是为了支持c/c++ 的补全。
安装完成后进行一些简单的配置就可以使用。
YouCompleteMe 的补全配置文件在/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py,这是个隐藏文件。
默认会使用这个文件,也可以把这个文件copy到工程的根目录中作修改,打开工程文件时会优先使用当前目录下的配置文件。
如果找不到,会根据配置中的ycm_global_ycm_extra_conf 进行查找。
在.vimrc 中添加
let mapleader = "," " 这个leader就映射为逗号“,”
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py' “配置默认的ycm_extra_conf.py
nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR> “按,jd 会跳转到定义
let g:ycm_confirm_extra_conf=0 “打开vim时不再询问是否加载ycm_extra_conf.py配置
let g:ycm_collect_identifiers_from_tag_files = 1 "使用ctags生成的tags文件
给vim安装YouCompleteMe的更多相关文章
- vim安装YouCompleteMe 插件
要安装YouCompleteMe ,vim须支持python.看是否支持,可以在vim中:version 查看, 如果python前有+号,就是支持,减号就是不支持. 如果不支持,需要以编译安装方式重 ...
- Vim 安装 YouCompleteMe
Vim 下的自动补全,最好的工具莫过于 YouCompleteMe,官方文档在这里 http://valloric.github.io/YouCompleteMe/ 安装稍显复杂,以下记录我的过程. ...
- UBuntu14.04 --vim安装YouCompleteMe插件
说明 我电脑的系统参数(用 uname -a命令查看)如下: Linux avyn-Lenovo --generic #-Ubuntu SMP Tue Mar :: UTC i686 i686 i68 ...
- Vim+Vundle+YouCompleteMe 安装
这段时间在Centos 7上开发c++程序,想为vim安装YouCompleteMe插件,参照几个博客无果,果断上官网找解决方案.功夫不负苦心人,终于搞定. 学习东西还是要多上官网. 下面送上本次的收 ...
- vim 安装
Ubuntu 16.04 下 Vim安装及配置 默认已经安装了VIM-tiny linuxidc@linuxidc:~$ locate vi | grep 'vi$' |xargs ls -al lr ...
- Ubuntu16.04安装vim插件YouCompleteMe
原文 1 下载 git clone --recursive git://github.com/Valloric/YouCompleteMe 如果执行该命令没报错, 就ok了. 但是中途有可能会断掉, ...
- 解决安装YouCompleteMe与Vim版本不兼容问题
用vim 7.4.4版本装YouCompleMe的时候提示这样的信息: YouCompleteMe unavailable: requires Vim 7.4.1578+.明明版本比它要求的还高,居然 ...
- Vim中YouCompleteMe插件安装
背景 YouCompleteMe需要使用GCC进行编译,然而Centos 6.7默认的GCC版本太低,所以需要使用devtools-2,用来安装多个版本GCC手动编译安装GCC的坑简直不要太多(类似于 ...
- 【转】ubuntu 12.04 下 Vim 插件 YouCompleteMe 的安装
原文网址:http://www.cnblogs.com/jostree/p/4137402.html 作者:jostree 转载请注明出处 http://www.cnblogs.com/jostree ...
随机推荐
- 单源最短路径spfa模板(pascal)洛谷P3371
题目描述 如题,给出一个有向图,请输出从某一点出发到所有点的最短路径长度. 输入输出格式 输入格式: 第一行包含三个整数N.M.S,分别表示点的个数.有向边的个数.出发点的编号. 接下来M行每行包含三 ...
- 【bzoj4897】[Thu Summer Camp2016]成绩单 区间dp
题目描述 给你一个数列,每次你可以选择连续的一段,付出 $a+b\times 极差^2$ 的代价将其删去,剩余部分拼到一起成为新的数列继续进行此操作.求将原序列全部删去需要的最小总代价是多少. 输入 ...
- C++解析(29):类型识别
0.目录 1.类型识别 2.动态类型识别 3.类型识别关键字 4.小结 1.类型识别 在面向对象中可能出现下面的情况: 基类指针指向子类对象 基类引用成为子类对象的别名 静态类型--变量(对象)自身的 ...
- c++字符串排序
在主函数中输入10个等长的字符串,用另一函数对它们排序.然后在主函数输出这10个已排好序的字符串. 用两种方法完成. 方法一:用二维数组做函数参数: 方法二:用指向一维数组的指针做函数参数. 方法一: ...
- 【NOIP考试范围】
※号为可能考察的算法[历年有出现过,但概率小,但最好掌握] [本图片仅作参考] 梦想总是要有的,万一实现了呢?
- listen() 函数
声明:本文来自网络博文的合并,文后有链接. 一.listen函数仅由TCP服务器调用 它做两件事: 1.当socket函数创建一个套接字时,它被假设为一个主动套接字,也就是说,它是一个将调用conne ...
- linux 递归删除目录文件
比如删.svn文件 >find . -name ".svn" | xargs -exec rm -rf
- 框架----Django之ModelForm组件
ModelForm a. class Meta: model, # 对应Model的 fields=None, # 字段 exclude=None, # 排除字段 labels=None, # 提示信 ...
- Git入门指南
git学习资源: Pro Git(中文版) Learn Git in your browser for free with Try Git. Git常用命令 Reference 常用 Git 命令清单 ...
- BMP格式图像读取与存储
全局变量: 1 #include "stdafx.h" #include <windows.h> /*BMP位图数据是4字节对齐*/ #define WIDTHBYTE ...