]> Cypherpunks repositories - gostls13.git/commitdiff
misc/vim: Disable automatic line wrapping by textwidth.
authorDavid Barnett <dbarnett@google.com>
Wed, 26 Mar 2014 02:51:16 +0000 (13:51 +1100)
committerDavid Symonds <dsymonds@golang.org>
Wed, 26 Mar 2014 02:51:16 +0000 (13:51 +1100)
If someone configures a 'textwidth' in go files, vim will by default insert
newlines into long lines as you type, which breaks syntax and doesn't really
make sense for go code. This fixes the default.

LGTM=dsymonds
R=golang-codereviews, gobot, dsymonds
CC=golang-codereviews
https://golang.org/cl/76890046

misc/vim/ftplugin/go.vim

index 8066733cf868da7712e7964ce22a3aa8a6babac1..532fb172363dafa9c5be02c633f86877595c1bea 100644 (file)
@@ -9,9 +9,11 @@ if exists("b:did_ftplugin")
 endif
 let b:did_ftplugin = 1
 
+setlocal formatoptions-=t
+
 setlocal comments=s1:/*,mb:*,ex:*/,://
 setlocal commentstring=//\ %s
 
-let b:undo_ftplugin = "setl com< cms<"
+let b:undo_ftplugin = "setl fo< com< cms<"
 
 " vim:ts=4:sw=4:et