This is a creation in Article, where the information may have evolved or changed.
Since the last time you configured the Golang VIM development environment on your Mac, it's basically not moving. Nearly two years later, go has been upgraded to version 1.7, and vim-go has evolved to the 1.8 version so far. The Community's active attention and use, let Vim-go author Fatih Arslan was encouraged, so nearly a year, actively added new features for Vim-go, released a new version, and wrote vim-go detailed tutorial. This made me move the idea of updating the vim-go version, so I have this article.
Remember that the first time you configured Vim-go, the vim-go version number. After nearly two years of development, Vim-go has officially become the standard plugin of the Go development environment under VIM. Go went from 1.4 to 1.7 in that year, and the tools were upgraded together, such as Oracle becoming the guru and the name changed. The editor for Go is also growing and maturing, with support for Golang from initial vim, Liteide, to later Eclipse, IntelliJ idea, Atom, sublime text, and Vscode. This way, no matter what kind of IDE you have before, you can find a handy environment to go into the Golang world.
I personally have been using Vim,sublime Text3 once played, did not play ripe, unloaded. At present the machine also installed a copy of Vscode, feel in the IDE field, Microsoft's influence and maturity is not to be underestimated, Vscode + golang extension from the entry threshold, or very low. Even if vim-go evolved to version 1.8, it is still less convenient than the Vscode installation experience. Of course, this is not all vim-go problem, but the design philosophy of vim caused.
Whether it is vim-go or Vscode Golang plugin, rely on Golang peripheral tools, mainly including Gocode, Goimports, Guru, Godef, Golint, Gometalinter and so on. In this regard, VIM-GO provides a way to install dependent tools ": Goinstallbinaries" or externally via: vim-c "goinstallbinaries"-C "QA" installation (after installing vim-go) While Vscode automatically detects whether the tool it depends on is installed, if it is not installed, it will be prompted under Vscode, and the appropriate tool will be installed if prompted.
BTW, since the recent Golang official website: golang.org do not have to turn over the wall, go get to download golang.org the various tools under the domain name is also a lot simpler, the mainland gopher no longer have to worry about the Go package download problem.
Before upgrading your vim-go, it is recommended that you back up your. vimrc Files First:
cp .vimrc .vimrc.bak.20160908
Vim-go plug-in installation by many methods, in Vim-go tutorial, vim-go author chose Vim-plug, without using the previous VIM plug-in management tool Vundle.vim, the method is similar:
Download Vim-plug:
$curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 67682 100 67682 0 0 7020 0 0:00:09 0:00:09 --:--:-- 12576
Install Vim-go:
Fill in the following in the. VIMRC:
call plug#begin()Plug 'fatih/vim-go'
Then execute ":P luginstall".
During the installation of the dependent tools, it was found that the Mac native Vim (Macvim, also called Mvim, installed in the/usr/local/bin/mvim) version or the 7.3.xx version did not meet the requirements of some tools, so the brew installs Vim (installed in the/usr/ Local/cellar/vim/7.4.2334/bin/vim), and then through the/usr/bin/vim of a symbolic link in the past can be.
$ll /usr/bin|grep vimlrwxr-xr-x 1 root wheel 38 9 8 16:21 vim@ -> /usr/local/Cellar/vim/7.4.2334/bin/vim... ...
Note that in order to install Neocomplete to support real-time completion (completion), VIM requires LUA support, so take the –with-lua parameter when performing a brew install:
brew install vim --with-lua
After installing the Vim-go upgrade, you can follow the steps in Vim-go-tutorial to experience the power of vim-go, while configuring the. VIMRC and installing the missing VIM plug-ins, such as Neocomplete, ultisnips, etc. I configured for vim-go 1.8. VIMRC can be downloaded here.
Specific details here will not mention, if there are any details unclear or the experiment did not succeed, you can go back to reference my article "Golang Development Environment Build-vim chapter."
, Bigwhite. All rights reserved.