CentOS 8 搭建Vim golang环境 && YouCompleteMe Golang安装支持

CentOS 8 搭建Vim golang环境

Vim搭建Golang IDE

1. Vundle安装

Vundle是vim的插件管理工具,用它可以自动管理安装后面用到的插件,从GitHub安装

cd
mkdir .vim/bundle
cd .vim/bundle
git clone https://github.com/Valloric/YouCompleteMe.git

安装完成后修改~/.vimrc启用

" .vimrc
" vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end()

2. 安装vim插件

插件管理软件安装好了,接下来安装需要的插件:

使用vundle自动安装,修改.vimrc

" vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'fatih/vim-go'
Plugin 'Valloric/YouCompleteMe'
Plugin 'Tagbar'
Plugin 'scrooloose/nerdtree'
call vundle#end()

保存,然后vim打开任意文件,输入:PluginInstall自动开始安装
这个过程异常漫长,特别是YouCompleteMe,可以手动安装

cd ~/.vim/bundle

git clone https://github.com/fatih/vim-go
git clone https://github.com/majutsushi/tagbar
git clone https://github.com/scrooloose/nerdtree
git clone https://github.com/Valloric/YouCompleteMe

cd YouCompleteMe
git submodule update --init --recursive

YouCompleteMe递归安装很多依赖包,需很长时间,并且下载完成后还需要编译安装,见下一节

Tagbar需要ctags/gotags支持

yum install ctags -y
go get -u github.com/jstemmer/gotags

3. 安装完成后配置.vimrc

参考:
https://www.jianshu.com/p/2a0ccc86ee31

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值