Syntax checking for go in vim

449 views
Skip to first unread message

Jim Whitehead II

unread,
Oct 11, 2011, 7:09:33 AM10/11/11
to golang-nuts
The syntastic [1] plugin for vim provides syntax checking on buffer
save/load in vim. The current version has support for Go, but it's
rather limited:

* It uses 6g to check, which isn't portable
* It only checks the current file, which doesn't work for multi-file
packages/commands

I'm interested in updating the Go plugin, but I'd like some opinions
on what makes the most sense. My current version uses the gotype [2]
command to check the directory of the current file (but not
recursively). Additionally, these could be made options to the plugin,
which is probably the best way to go.

What do people think makes the most sense for something like this? My
vim wizardy isn't terribly strong, but I've done a bit of
investigation to see what makes the most sense. Anyone willing to work
with me to provide a better plugin?

- Jim

[1]: https://github.com/scrooloose/syntastic
[2]: http://golang.org/cmd/gotype/

Miek Gieben

unread,
Oct 11, 2011, 7:43:45 AM10/11/11
to golang-nuts
[ Quoting Jim Whitehead II at 12:09 on October 11 in "[go-nuts] Syntax checking for go in"... ]

> What do people think makes the most sense for something like this? My
> vim wizardy isn't terribly strong, but I've done a bit of
> investigation to see what makes the most sense. Anyone willing to work
> with me to provide a better plugin?

I actually use 'gofmt' (wrapped in some vim config for this). And sometimes
I want to save a file even with syntax errors.

That said, don't let me stop you from doing this. :)

grtz,

--
Miek

signature.asc

Jan Mercl

unread,
Oct 11, 2011, 7:56:54 AM10/11/11
to golan...@googlegroups.com
On Tuesday, October 11, 2011 1:09:33 PM UTC+2, Jim Whitehead wrote:

What do people think makes the most sense for something like this?

:mak does syntax/semantic/type checks, puts the cursor on first error. Nothing left on my wishlist.

Jim Whitehead II

unread,
Oct 11, 2011, 8:30:23 AM10/11/11
to golan...@googlegroups.com

Of course I use that as well, but someone asked for this to be done on
the fly, so I'm looking into how it might be done =)

Reply all
Reply to author
Forward
0 new messages