码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu16.04安装vim8

时间:2018-05-15 01:53:29      阅读:399      评论:0      收藏:0      [点我收藏+]

标签:git   sni   code   sorl   upd   search   clojure   www.   roo   

Ubuntu16.04安装vim8

在Ubuntu16.04下编译安装vim8,并配置vim-plug插件管理器,以及安装YouCompleteMe等插件。

安装依赖

sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev     libgtk2.0-dev libatk1.0-dev libbonoboui2-dev     libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev     python3-dev ruby-dev liblua5.1 lua5.1-dev libperl-dev git

需要注意的是在Ubuntu16.04中Lua应该为liblua5.1-dev,而在其它版本中应为lua5.1-dev

删除已有vim相关包

dpkg -l | grep vim
sudo apt remove vim vim-common vim-runtime vim-tiny

下载最新vim并编译安装

git clone https://github.com/vim/vim.git 


./configure --with-features=huge             --enable-multibyte             --enable-rubyinterp=yes             --enable-pythoninterp=yes             --with-python-config-dir=/usr/lib/python2.7/config             --enable-perlinterp=yes             --enable-luainterp=yes             --enable-gui=gtk2 --enable-cscope --prefix=/usr

make VIMRUNTIMEDIR=/usr/share/vim/vim80  -j5

sudo make install

配置vim

不配置vim的话会比较难用,增加一些插件和个人习惯性的定制能提升编码效率。

在下载安装vim插件这件事儿上,Vundle很慢,基于异步的vim-plug则非常快。上手吧:

" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')

" Make sure you use single quotes

" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'

" Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'

" Multiple Plug commands can be written in a single line using | separators
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'

" On-demand loading
Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }

" Using a non-master branch
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }

" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug 'fatih/vim-go', { 'tag': '*' }

" Plugin options
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }

" Plugin outside ~/.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }

" Unmanaged plugin (manually installed and updated)
Plug '~/my-prototype-plugin'

" Initialize plugin system
call plug#end()

"" 个人定制的一些配置,不喜欢、不习惯可以自行修改
set nu
set tags=./.tags;.tags
set cursorline
set showmatch
set hlsearch
set incsearch
hi CursorLine cterm=NONE ctermbg=black ctermfg=green guibg=NONE guifg=NONE

关闭vim,再次vim ~/.vimrc,敲入:PlugInstall,开始下载插件:可以看到各个插件是同时在下载的,速度很快。

其中YouCompleteMe因为有很多submodule,很容易下载失败,所以手动处理一下:

cd ~/.vim/plugged/YouCompleteMe

git submodule update --init --recursive

python install.py

参考

Ubuntu16.04安装vim8

标签:git   sni   code   sorl   upd   search   clojure   www.   roo   

原文地址:https://www.cnblogs.com/zjutzz/p/9038871.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!