Linux系统Vim安装YouCompleteMe插件教程详解
LINUX相信很多用户都很少接触到,而技术人员或是IT人士就会经常接触。而在Linux系统中想要让Vim编辑器发挥更大的作用,就要对给给它安装一些插件。比如说YouCompleteMe插件(名字就很形象)。下面,小编就给大家介绍Linux系统Vim安装YouCompleteMe插件教程详解。
编译配置选项:
。/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 进行自动安装
[page]
进程如下,+号表示已经安装,》表示正在安装。
。 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文件
以上就是Linux系统Vim安装YouCompleteMe插件教程详解,更多精彩内容继续关注系统部落官网。
相关文章
- mobaxterm连接虚拟机linux?
- 科技大V尝试用Linux系统替代微软Windows:日常没问题 游戏很糟糕
- 深度操作系统deepin 20.4发布:升级Linux 5.15内核
- Linux 5.17内核全力优化AMD锐龙:Zen4准备好了!
- Linux Lite 5.8系统正式发布 易用性开始向Windows看齐
- linux系统是什么
- xshell怎么连接linux虚拟机
- Linux如何安装使用GitHub
- linux 版本三种常用方法
- Linux如何在history上添加时间和用户等参数
- 微软大招!三大Linux系统登陆Windows 10:直接安装运行
- Ubuntu赫然进驻Windows 10商店
- Linux不小心删除日志文件syslog的解决方法
- linux关机命令功能键详解
- linux定时关机怎么设置_linux定时关机shutdown命令汇总
- linux系统下使用assert函数的方法介绍
相关推荐
-
WPS Office For Linux V11.1.0.10702 官方安装版
WPS Office For Linux是WPS为Linux系统推出的Office系列办公软件。软件界面支持高分辨率屏幕、自定义外观。该软件内置文档、电子表格、ppt等多种功能,十分使实用,有需要的小伙伴快来下载吧。
-
vim编辑器 V8.2.0582 linux版
vim编辑器能够有效的创建和更改各种类型的文本,无论你是编辑电子邮件还是修改各种不同的配置文件,它全部可以完成,是一款功能强大的文本编辑程序。vim编辑器能够在多个平台跨平台使用,windows、linux等等系统统统兼容,并拥有超好的可扩展性,欢迎体验。
-
Linux Kernel(Linux系统内核) V5.14.14 最新版
Linux Kernel是一款最新版Linux系统内核,支持32位大文件系统,物理内存最大支持可以达到64GB,同时还增强了对USB及3D加速卡的支持,能够更好进行程序的开发,能够直接提高开发的效率,拥有很强的稳定性和移植性,需要的快来下载吧。
-
cdlinux最新破解版
cdlinux不需要抓取握手包、不需要跑字典、不需要客户端在线,能够轻松查看无线路由器的密码,是一款非常实用的无线解锁工具。
-
Net Tools(网络工具) V2.0.0.25 linux版
Net Tools是一款功能强大的网络工具,绿色安全,使用免费,集合了各种常用的网络监测和扫描功能,支持查看所有的TCP连接信息,如本地地址、端口、远程地址、端口等等。软件的操作也是十分的简单,普通用户也能轻松上手。

