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!
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)
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.
It's really nice, but lack specific feature of auto-importing packages while typing. Like, if you type `fmt.` and package is not imported yet, you'll not see any completions.
On the flipside, what implements this functionality you speak of? I ask, because you mention it being a deal breaker for vim-go, so i'm curious what you currently use?
Why? I code Go in Vim every day, and I think goimports is perfect. I don't even think about the import ( ... ) block at the top - I just use what packages I want, save my code, and let the machine take care of the imports. If you have your GOPATH set up properly, it works 100% of the time.
Looks like I was not clear enough. goimports works perfectly, but only on buffer save event (or by manual trigger).
Take an example, start from scratch:
package main
func main() {
fmt|
}
Cursor is at |, and when I type ., I immediatelly have fmt package imported and see completion menu for fmt package (without leaving insert mode or saving file, just by typing dot).
Author here. Vim doesn't have type by completion support, however it imho has completion, but it needs to be triggered manually with a key shortcut(such as C-X C-O). Plugins like YCM changes this behavior to on the fly completion.
For gifs, I have couple of screencasts already (all in Wiki: https://github.com/fatih/vim-go/wiki/Screencasts), but yeah we could definitely add a GIF, but my time is limited for this kind of stuff :)
I am not a vim user and I've been using IntelliJ IDEA to code in GoLang for about an year now and I find it extremely powerful. It is powered using the GoLang IntelliJ plugin : https://github.com/go-lang-plugin-org/go-lang-idea-plugin
It provides :
1) Error Highlighting,
2) Auto Completion,
3) Click-to-Navigate,
4) Auto Formatting,
5) Auto Importing, among other features.
This. I've seen my teammates try other Go IDE integrations but this just beats the pants off all of them and our whole team wound up standardizing on it.
It combines well with Tim Pope's dispatch plugin for doing an async 'go build' or 'go test' while you code:
36 comments
[ 3.3 ms ] story [ 79.5 ms ] threadEnable goimports to automatically insert import paths instead of gofmt:
let g:go_fmt_command = "goimports"
[1] https://github.com/Shougo/neocomplete.vim
good alternative : (Dockerfile) Sublime Text 3 for Go
https://github.com/jgautheron/dockerfiles/blob/master/sublim...
https://github.com/joefitzgerald/go-plus
So, I've implemented it a while ago in separate coding-helping plugin, see the gif: https://github.com/reconquest/vim-pythonx#autoimport
UPD: also, some gifs, showing how coding routine I believe should be done (Golang taken as example): https://github.com/reconquest/snippets#let-me-show. Type less, get more.
> Enable goimports to automatically insert import paths instead of gofmt:
> let g:go_fmt_command = "goimports"
It's deal breaker for me, I want to see completions immediately, not by entering `fmt.`, saving file, backspacing, re-entering `.`.
Take an example, start from scratch:
Cursor is at |, and when I type ., I immediatelly have fmt package imported and see completion menu for fmt package (without leaving insert mode or saving file, just by typing dot).Out of the box vim-go doesn't provide that.
For gifs, I have couple of screencasts already (all in Wiki: https://github.com/fatih/vim-go/wiki/Screencasts), but yeah we could definitely add a GIF, but my time is limited for this kind of stuff :)
It provides : 1) Error Highlighting, 2) Auto Completion, 3) Click-to-Navigate, 4) Auto Formatting, 5) Auto Importing, among other features.
It combines well with Tim Pope's dispatch plugin for doing an async 'go build' or 'go test' while you code:
https://github.com/tpope/vim-dispatch