2018年09月05日 18:02:36 zhouxiangbai 阅读数:401
[操作系统]
安装时选用的CentOS版本:CentOS-7-x86_64-Minimal-1708
[root@zbs-client vim-7.4.2367]# uname -a
Linux zbs-client 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@zbs-client vim-7.4.2367]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[vim-go对VIM的版本要求]
vim-go requires Vim 7.4.2009 or Neovim, but you’re using an older version. Please update your Vim for the best vim-go experience.
[更新VIM]
1. 载必要组件
[root@zbs-client ~]# yum install -y gcc gcc-c++ ruby ruby-devel lua lua-devel \
ctags git python python-devel \
tcl-devel ncurses-devel \
perl perl-devel perl-ExtUtils-ParseXS \
perl-ExtUtils-CBuilder \
perl-ExtUtils-Embed
安装VIM:
[root@zbs-client ~]# tar zxvf vim-7.4.2367.tar.gz
[root@zbs-client ~]# cd vim-7.4.2367
[root@zbs-client vim-7.4.2367]# ./configure –with-features=huge \
–enable-multibyte \
–enable-rubyinterp=yes \
–enable-pythoninterp=yes \
–with-python-config-dir=/usr/lib64/python2.7/config \
–enable-perlinterp=yes \
–enable-luainterp=yes \
–enable-cscope \
–prefix=/usr/local
[root@zbs-client vim-7.4.2367]# make
[root@zbs-client vim-7.4.2367]# make install
查看版本号:
[root@zbs-client vim-7.4.2367]# vim –version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 5 2018 17:19:11)
包含补丁: 1-2367
在CentOS7下安装golang1.6版本,并进行vim高亮配置
安装
yum remove golang
wget http://www.golangtc.com/static/go/1.6/go1.6.linux-amd64.tar.gz
tar -zxvf go1.6.linux-amd64.tar.gz
修改环境变量文件和工作环境
由于个人喜好,我的工作目录都在opt下,故设置golang的工作目录为/opt/golang
mkdir /opt/golang
vim ~/.bash_profile
export GOPATH=/opt/golang
export GOROOT=/root/golang
export PATH=$PATH:$GOROOT/bin
source ~/.bash_profile
go version
#go version go1.6 linux/amd64
配置vim
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
以下是我的配置环境,仅供参考
vim ~/.vimrc
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'fatih/vim-go'
call vundle#end() " required
filetype plugin indent on " required
syntax on
git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
安装完成!