温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

安装VIM8和vim-go插件

发布时间:2020-07-19 20:48:51 来源:网络 阅读:1968 作者:zxdevops 栏目:编程语言

安装VIM8

下载源码,编译安装,默认会安装到/usr/local/bin下:

git clone https://github.com/vim/vim.git
cd vim/src
make
make 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.vim
git 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插件文档。

参考资料

  • VIM
    • https://www.vim.org/download.php
    • https://github.com/vim/vim/blob/master/src/INSTALL
  • plug.vim
    • https://github.com/junegunn/vim-plug
  • vim-go
    • https://github.com/fatih/vim-go
    • https://github.com/fatih/vim-go-tutorial
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI