http://icsmile.com/2016/03/31/centos7_go1.6/
在CentOS7下安装golang1.6版本,并进行vim高亮配置
安装
- 卸载之前的版本
yum remove golang
- 下载Golang1.6
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
- 首先安装Vundle
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
- 配置.vimrc
以下是我的配置环境,仅供参考
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
- 安装vim-go
git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
本文介绍如何在CentOS7上安装Golang 1.6版本,并提供了vim编辑器的高亮配置方法。包括卸载旧版、下载新版、设置环境变量、安装Vundle及vim-go插件等步骤。
546

被折叠的 条评论
为什么被折叠?



