Golang VIM Environment Setup

Source: Internet
Author: User
Tags autoload install go

The main use is Golang's vim plug-in vim-go,

Installation method:

(1) To configure their own gopath and goroot;

(2) Set up SRC, pkg, main, bin four directories under the Gopath directory;

(3) Install the plugin manager pathogen,

(a) on pathogen's homepage http://www.vim.org/scripts/script.php?script_id=2332 download;

(b) Copy the extracted AutoLoad directory to ~/.vim/autoload, and if it does not, create a new one;

(c) Edit the ~/.VIMRC file and add rows at the top call pathogen#infect() .

(4) Installing the Vim-go plug-in

(a) ~/.vim/bundle execute commands after entering the cataloguegit clone https://github.com/fatih/vim-go.git;

(b) Edit ~/.vimrc the file, add the following, if there are some configuration items have been before, ensure that the same configuration on the line;

       syntax enable

       filetype plugin on

       let g:go_disable_autoinstall = 0

(5) Install Go tools

The Go tools here refer mainly to Godef, Goimports, Godoc and other tools (configured in/users/wangjiajia/.vim/bundle/vim-go/plugin/go.vim)

(a) Open a. Go file at any one, and then run: goinstallbinaries, which is the automatic download tool for the binary package to install, but because the go code is much on GitHub and golang.org,

Issues related to walls. Automatic installation may fail. Of course, if you have a ladder, except;

(b) Manual installation of the steps, into the Gopath src directory, run the following command

git clone https://github.com/golang/tools Golang.org/x/tools then use the previous step: Goinstallbinaries can

Golang VIM Environment Setup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.