]> Cypherpunks repositories - gostls13.git/commitdiff
misc/vim: describe how to get gofmt-on-save behaviour.
authorDavid Symonds <dsymonds@golang.org>
Mon, 25 Nov 2013 00:03:47 +0000 (11:03 +1100)
committerDavid Symonds <dsymonds@golang.org>
Mon, 25 Nov 2013 00:03:47 +0000 (11:03 +1100)
Fixes #6826.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/31770043

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
 -----------------------