Easy setup of the Go language vim environment

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

The installation steps for the Vundle.vim are as follows:

mkdir ~/.vim/bundle
git clone https:// github.com/gmarik/vundle.vim.git ~/.vim/bundle/vundle.vim                                                                          

To create the ~/.vimrc file (if you don't have one), add the configuration about Vundle.vim at the top of the file:

Set nocompatible "be improved, required
FileType off "required

Set the runtime path to include Vundle and initialize
Set Rtp+=~/.vim/bundle/vundle.vim
Call Vundle#begin ()

"Let Vundle manage Vundle, required
Plugin ' Gmarik/vundle.vim '

"All of your Plugins must is added before the following line
Call Vundle#end () "Required
FileType plugin indent on "required

At this point vim only installs the Vundle.vim plugin. Editing hellogolang.go is no different than editing a plain text file, and everything is the default property of Vim.


Edit ~/.VIMRCto add a line between Vundle#begin and vundle#end :

Plugin ' Fatih/vim-go '

Execute the plugininstallwithin Vim,

Vundle.vim will open a Vundle Installer Preview Sub-window on the left, the window will prompt:"processing ' fatih/vim-go '", after the installation is complete, the prompt message becomes "done !”。

At this point, we can see. vim/bundle a Vim-go folder:

$ ls. vim/bundle/
vim-go/vundle.vim/

At this point, edit the Hellogolang.go again, syntax highlighting , save the Automatic format(using $GOBIN/GOFMT) also has, but other advanced features, such as the automatic import missing package, Auto-Completion still no, we have to continue to install some of the stuff.


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.