2013-12-17 wcdj@H_403_1@
之前总结过在subl中使用GoLang,《GoLang及Sublime Text 2之Mac OS X 10.8.4开发环境安装 》。其实GoLang的安装包中已经包含了支持Vim的编写插件,配置方法很简单,如下文所述。
@H_403_1@
Go in Vim
The standard Go distribution includes a Go Syntax file for Vim in go/misc/vim/
.@H_403_1@
Installation Instructions
Place $GOROOT/misc/vim/Syntax/go.vim
in ~/.vim/Syntax/
and put the following in ~/.vim/ftdetect/go.vim
:@H_403_1@
au BufRead,BufNewFile *.go set filetype=go
Extras and Alternative Files
An alternative indent file for Vim by Alecs King can be found here.@H_403_1@
Autocompletion
The gocode daemon by nsf includes a vim script to do autocompletion.@H_403_1@
Other
See the vim-golang repo in Github foralternative Syntax highlight,auto-indentation,gofmt and other useful scriptsand plugins.@H_403_1@
And this reddit post for varIoUs ways to integrate gofmt
with vim.@H_403_1@
参考:@H_403_1@