News for hackers. Stuff that matters.
Re:Vim setup for Go by jweir on Thursday September 24, 2015 @12:55PM (#10272808)
It does, just not by default, and only on save – not while typing.

> Enable goimports to automatically insert import paths instead of gofmt:

> let g:go_fmt_command = "goimports"

Re:Vim setup for Go by seletskiy on Thursday September 24, 2015 @01:17PM (#10272978)
Yeah, only on save.

It's deal breaker for me, I want to see completions immediately, not by entering `fmt.`, saving file, backspacing, re-entering `.`.

Re:Vim setup for Go by fizzbatter on Thursday September 24, 2015 @01:43PM (#10273192)
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?
Re:Vim setup for Go by seletskiy on Thursday September 24, 2015 @02:08PM (#10273393)
I'm using vim-go, I just implemented autoimport functionality on top of it.
Re:Vim setup for Go by artursapek on Thursday September 24, 2015 @02:35PM (#10273616)
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.
Re:Vim setup for Go by seletskiy on Friday September 25, 2015 @01:51AM (#10276559)
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).

Out of the box vim-go doesn't provide that.

Re:Vim setup for Go by artursapek on Friday September 25, 2015 @07:59AM (#10277606)
Ah, you want the full package exports available for autocomplete? Have you found a way to do that?