安装VIM8和vim-go插件
下载源码,编译安装,默认会安装到/usr/local/bin下:
git clone https://github.com/vim/vim.gitcd vim/srcmakemake install
如果make过程中报有关terminal的错误,并提示安装ncurses,则yum安装ncurses-devel后重新make和make install:
yum install ncurses-devel
安装vim-go插件
执行如下命令安装plug.vim插件管理器和vim-go插件:
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vimgit clone https://github.com/fatih/vim-go.git ~/.vim/plugged/vim-go
然后在~/.vimrc里添加如下配置:
call plug#begin()Plug 'fatih/vim-go'call plug#end()
再然后执行vim命令,然后在vim里输入如下命令安装vim-go的依赖,然后退出vim即可:
:GoInstallBinaries
现在再打开go代码文件,就可以看到效果了。更复杂的用法详见vim-go插件文档。
参考资料VIMhttps://www.vim.org/download.phphttps://github.com/vim/vim/blob/master/src/INSTALLplug.vimhttps://github.com/junegunn/vim-plugvim-gohttps://github.com/fatih/vim-gohttps://github.com/fatih/vim-go-tutorial声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。