From: Andrew Gerrand Date: Thu, 28 Nov 2013 20:04:23 +0000 (+1100) Subject: [release-branch.go1.2] misc/vim: describe how to get gofmt-on-save behaviour. X-Git-Tag: go1.2~2 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a04e34923c06b0f94b54561bac68a024cc37a754;p=gostls13.git [release-branch.go1.2] misc/vim: describe how to get gofmt-on-save behaviour. ««« CL 31770043 / 286f0ddb799b misc/vim: describe how to get gofmt-on-save behaviour. Fixes #6826. R=golang-dev, bradfitz, adg CC=golang-dev https://golang.org/cl/31770043 »»» R=golang-dev CC=golang-dev https://golang.org/cl/34960043 --- diff --git a/misc/vim/readme.txt b/misc/vim/readme.txt index a394cec5a9..b8469f9275 100644 --- a/misc/vim/readme.txt +++ b/misc/vim/readme.txt @@ -14,6 +14,11 @@ To use all the Vim plugins, add these lines to your $HOME/.vimrc. If you want to select fewer plugins, use the instructions in the rest of this file. +A popular configuration is to gofmt Go source files when they are saved. +To do that, add this line to the end of your $HOME/.vimrc. + + autocmd FileType go autocmd BufWritePre Fmt + Vim syntax highlighting -----------------------