CentOS 6 64位系统中编译安装vim8

2020/06/2511:52:57CentOS 6 64位系统中编译安装vim8已关闭评论

VIM8发布也很长一段时间了,目前基本趋于稳定,刚好最近也在学习go,对于go的语法支持插件需要vim8,而我用的CentOS 6中VIM版本为7.4,果断开始折腾。

1、下载vim8源码

mkdir /opt/vim8
cd /opt/vim8
git clone https://github.com/vim/vim.git

2、编译vim8

废话不多说,看操作:

cd /opt/vim8/vim
# 需要python3的支持,这里我们安装epel源,同时安装python34和ruby开发包
yum install epel-release -y
yum install python34 python34-devel
# 开始编译vim
./configure --prefix=/usr/local/vim8 \
--with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-pythoninterp=yes \
--with-python-config-dir=/usr/lib64/python2.6/config \
--enable-python3interp=yes \
--with-python3-config-dir=/usr/lib64/python3.4/config-3.4m \
--enable-luainterp=yes \
--enable-gui=gtk2 \
--with-ruby-command=$(which ruby) \
--enable-cscope
# 编译
make
# 安装
make install

3、配置8

治病还是得看操作:

# 添加环境变量至/etc/profile,最后一行添加
export PATH=/usr/local/vim8/bin:$PATH
# 安装vundle.vim插件,用于安装go插件
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
添加~/.vimrc文件,内容如下:
syntax on
set nu
"set nocompatible              " be iMproved, required
filetype off                  " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'fatih/vim-go'
" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=4
开始安装插件,命令模式下输入PluginInstall,即可自动安装完成

3、测试go插件

编写一个简单的hello world,颜色也漂亮了

  • 微信扫码赞助
  • weinxin
  • 支付宝赞助
  • weinxin
  • A+
所属分类:VIM