Make Vim a Golang IDE

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

The decision to discard the mouse starts, so be prepared to use VIM.

So how to build Golang environment in VIM?

With Git in vogue, it's so easy to build a vim environment.

And when Vim is built, it's basically no different from the IDE.

Highlighting, auto-completion, automatic formatting, viewing definition jumps, grammar detection, etc.

  • Improved Syntax highlighting with items such as Functions, Operators, Methods.
  • Auto Completion Support viagocode
  • Better on gofmt save, which keeps cursor position and doesn ' t break your undo history
  • Go to Symbol/declaration with:GoDef
  • Look up documentation with :GoDoc inside Vim or open it in browser
  • Automatically import packages via :GoImport or plug it into AutoSave
  • Compile your package :GoBuild with, install it with :GoInstall or test them with :GoTest (also supports running single tests via )
  • Quickly execute your current file/files with:GoRun
  • Automatic GOPATH detection based on the directory structure (i.e. projects gb , godep vendored projects)
  • Change or display with GOPATH:GoPath
  • Create a coverage profile and display annotated source code in browser to see which functions is covered with:GoCoverage
  • Call gometalinter :GoMetaLinter with, which invokes all possible linters (Golint, vet, Errcheck, Deadcode, etc ...) and shows the warning S/errors
  • Lint Your code with:GoLint
  • Run your code through to :GoVet catch static errors
  • Advanced Source analysis tools utilizing Oracle, such as :GoImplements , :GoCallees , and:GoReferrers
  • Precise Type-safe renaming of identifiers with:GoRename
  • List all source files and dependencies
  • Unchecked Error checking with:GoErrCheck
  • Integrated and improved snippets, supporting ultisnips orneosnippet
  • Share your current code to play.golang.org with:GoPlay
  • On-the-fly type information about the word under the cursor. Plug it into your custom vim function.
  • Go asm Formatting on save
  • Tagbar support to show tags of the source code in a sidebar withgotags
  • Custom Vim text objects such as a function or inner function list.
  • A Async launcher for the GO command was implemented for Neovim, fully async building and testing (Beta).
  • Integrated with the Neovim terminal, launch and other :GoRun go commands in their own new terminal. (Beta)
  • Alternate between implementation and test code with:GoAlternate

Installation is also very convenient, just a few three lines of code:

#下载安装
git clone git@github.com:farazdagi/vim-go-ide.git ~/.vim_go_runtimesh ~/.vim_go_runtime/bin/install# run Vim-u ~/. Vimrc.go

Ps:

A) This requires vim to open LUA:

Brew install VIM--with-lua--override-system-vim

b) If you need class resolution, you need to turn Ctag

Original: http://farazdagi.com/blog/2015/vim-as-golang-ide/

The effect is as follows:

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.