Re:Vim setup for Go
by sinatra on Thursday September 24, 2015 @10:53AM
(#10271936)
I've been using vim-go for about one year now. The combination of vim-go, gofmt and YouCompleteMe is all you need for a perfect Go setup. Thanks to Fatih and Val!
[ Parent
| on HN ]
I suggest you try https://github.com/garyburd/go-explorer too! (From creator of godoc.org.) In short words, it's godoc with hyperlinks (in your vim). I use it both for doc (so I don't have to switch to browser), and for project-wide navigation.
:GeDoc net/http --> opens a "gedoc" split
:GeDoc fmt Printf --> + jump to specific identifier
(note: full TAB-completion)
:GeDoc \html_template --> + resolve import alias like:
import html_template "html/template"
zM --> fold all
zo --> unfold current
zc --> fold current
Ctrl-] --> "follow link under cursor"
Ctrl-A --> show all! (i.e. unexported too)YouCompleteMe crashes frequently on my mac. I can't find a solution. Does someone here have a solution?
I switched from YCM to neocomplete[1] a few months ago and haven't looked back, performance is much better. I'm on Arch and never really had crashes with YCM, but if the crashes are performance related it might help.
I need to use YouCompleteMe for C++ autocomplete.
goimports is so dang nice, too. If for some reason you overlooked it on the README:
Enable goimports to automatically insert import paths instead of gofmt:
let g:go_fmt_command = "goimports"
Yes I do use goimports. Also very useful.