Ubuntu 16.04 + vim8 + vundle + YouCompleteMe

简介:

【vim8】

1、卸载旧版 vim 。

1.1、查看

1
2
3
walker@ubuntu:~$ 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             amd64        Vi IMproved - enhanced  vi  editor - compact version

1.2、卸载

1
sudo  apt remove --purge  vim-common vim-tiny

2、安装依赖项。

1
sudo  apt  install  gcc  make  libncurses5-dev git python-dev python3-dev

3、下载 vim 源码。

1
git clone --depth=1 https: //github .com /vim/vim .git ~ /vim8git

4、编译安装。

1
2
3
4
5
6
7
8
9
10
cd  ~ /vim8git/
. /configure  --with-features=huge \
             -- enable -multibyte \
             -- enable -cscope  \
             -- enable -pythoninterp= yes  \
             --with-python-config- dir = /usr/lib/python2 .7 /config-x86_64-linux-gnu  \
             -- enable -python3interp= yes  \
             --with-python3-config- dir = /usr/lib/python3 .5 /config-3 .5m-x86_64-linux-gnu
make
sudo  make  install

5、检查。(+为支持,-为不支持)

1
2
3
walker@ubuntu:~ /vim8git $ vim --version |  grep  python
+cryptv          +linebreak       +python /dyn       +vreplace
+cscope          +lispindent      +python3 /dyn      +wildignore




YouCompleteMe

1、安装依赖项。

1
sudo  apt  install  build-essential cmake clang

2、下载。

1
git clone --recursive https: //github .com /Valloric/YouCompleteMe .git ~/.vim /bundle/YouCompleteMe

如果出现异常,进入 ~/.vim/bundle/YouCompleteMe 目录,重复下面的命令直到下载完整。(不用vundle 自己下载 ycm 的原因也是因为这个包大而杂,容易出现异常。)

1
git submodule update --init --recursive

4、编译。

1
2
cd  ~/.vim /bundle/YouCompleteMe
. /install .py --clang-completer --system-libclang




vundle

1、下载。

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

2、将下面内容添加到 ~/.vimrc 的顶部。

1
2
3
4
5
6
7
8
9
10
11
12
set nocompatible              " be iMproved, required
filetype off                  " required
 
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
 
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
 
call vundle#end()            " required
filetype plugin indent on    " required
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'


*** walker ***

本文转自walker snapshot博客51CTO博客,原文链接http://blog.51cto.com/walkerqt/1935024如需转载请自行联系原作者


RQSLT

相关文章
|
20天前
|
Ubuntu 开发工具
Ubuntu vim配置支持鼠标
Ubuntu vim配置支持鼠标
12 0
|
3月前
|
Ubuntu 开发工具
百度搜索:蓝易云【Ubuntu安装vim教程】
现在,你已经成功在Ubuntu上安装了Vim编辑器。你可以在终端中运行 `vim`命令来启动Vim,并开始编辑文本文件。
45 2
|
3月前
|
Ubuntu 开发工具 Windows
vim 在windows系统和ubuntu系统中的配置
vim 在windows系统和ubuntu系统中的配置
|
Ubuntu 开发工具
Ubuntu修改默认编辑器为vim
Ubuntu修改默认编辑器为vim
310 0
Ubuntu修改默认编辑器为vim
|
Ubuntu Linux 开发工具
Linux - ubuntu下Vim安装失败,报The following packages have unmet dependencies: vim : Depends: vim-common
Linux - ubuntu下Vim安装失败,报The following packages have unmet dependencies: vim : Depends: vim-common
485 0
|
Ubuntu Linux 开发工具
Ubuntu之vim:vim编辑工具的简介、安装、使用方法之详细攻略
Ubuntu之vim:vim编辑工具的简介、安装、使用方法之详细攻略
Ubuntu之vim:vim编辑工具的简介、安装、使用方法之详细攻略