GoLang之Gvim/Vim配置

2013-12-17 wcdj

之前总结过在subl中使用GoLang,《GoLang及Sublime Text 2之Mac OS X 10.8.4开发环境安装 》。其实GoLang的安装包中已经包含了支持Vim的编写插件,配置方法很简单,如下文所述。

Go in Vim

The standard Go distribution includes a Go syntax file for Vim in go/misc/vim/.

Installation Instructions

Place $GOROOT/misc/vim/syntax/go.vim in ~/.vim/syntax/ and put the following in ~/.vim/ftdetect/go.vim:

au BufRead,BufNewFile *.go set filetype=go

Extras and Alternative Files

An alternative indent file for Vim by Alecs King can be found here.

Autocompletion

The gocode daemon by nsf includes a vim script to do autocompletion.

Other

See the vim-golang repo in Github foralternative syntax highlight, auto-indentation, gofmt and other useful scriptsand plugins.

And this reddit post for various ways to integrate gofmt with vim.


参考:

[1] http://go-lang.cat-v.org/text-editors/vim/




本文来自:CSDN博客

感谢作者:delphiwcdj

查看原文:GoLang之Gvim/Vim配置

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。