]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.2] misc/vim: describe how to get gofmt-on-save behaviour.
authorAndrew Gerrand <adg@golang.org>
Thu, 28 Nov 2013 20:04:23 +0000 (07:04 +1100)
committerAndrew Gerrand <adg@golang.org>
Thu, 28 Nov 2013 20:04:23 +0000 (07:04 +1100)
««« 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

misc/vim/readme.txt

index a394cec5a9be4fdad21fde090c34e791b7a27667..b8469f92750d2c4b3275399c9c1fe3405eb8b180 100644 (file)
@@ -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 <buffer> Fmt
+
 
 Vim syntax highlighting
 -----------------------