vim 에서 go 언어를 지원하는 vim-go 라는 플러그인이 있다. https://github.com/fatih/vim-go에서 패키지를 다운로드 할 수 있으며 이 페이지에서 설명하는 main feature는 다음과 같다.
Compile your package with:GoBuild, install it with:GoInstallor test it with:GoTest. Run a single test with:GoTestFunc).
Quickly execute your current file(s) with:GoRun.
Improved syntax highlighting and folding.
Debug programs with integrateddelvesupport with:GoDebugStart.
Completion and many other features support viagopls.
formatting on save keeps the cursor position and undo history.
Go to symbol/declaration with:GoDef.
Look up documentation with:GoDocor:GoDocBrowser.
Easily import packages via:GoImport, remove them via:GoDrop.
Precise type-safe renaming of identifiers with:GoRename.
See which code is covered by tests with:GoCoverage.
Add or remove tags on struct fields with:GoAddTagsand:GoRemoveTags.
Callgolangci-lintwith:GoMetaLinterto invoke all possible linters (golint,vet,errcheck,deadcode, etc.) and put the result in the quickfix or location list.
Lint your code with:GoLint, run your code through:GoVetto catch static errors, or make sure errors are checked with:GoErrCheck.
Advanced source analysis tools utilizingguru, such as:GoImplements,:GoCallees, and:GoReferrers.
... and many more! Please seedoc/vim-go.txtfor more information.
Thegoplsinstance can be shared with other Vim plugins.
Vim-go's use ofgoplscan be disabled.
vim-go를 설치하기 위해서는 vim 의 플러그인을 관리하는 패키지 매니저를 활용해야 하는데, 이번 포스팅에서는 pathogen 을 이용해서 설치하도록 하겠다.(window 10 환경) vim을 설치하고 다음과 같이 pathogen을 설치한다.
1. vimfiles 폴더 밑에 autoload 폴더와 bundle 폴더를 생성한다. (c:\Users\[userid]\vimfiles)