summaryrefslogtreecommitdiffstats
path: root/ftplugin/go/fmt.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2013-11-02 23:27:57 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2013-11-02 23:27:57 +0100
commit30c1920e4fa4e612238e1f435907c40ecfa47f33 (patch)
treef88ffb408895a5baf93fe81fdd12acba17f32d44 /ftplugin/go/fmt.vim
parent57cfac7ae384466c3ff2543a9200319dc1d459a0 (diff)
downloadvim-polyglot-1.4.1.tar.gz
vim-polyglot-1.4.1.zip
Massive update :)v1.4.1
Diffstat (limited to 'ftplugin/go/fmt.vim')
-rw-r--r--ftplugin/go/fmt.vim16
1 files changed, 15 insertions, 1 deletions
diff --git a/ftplugin/go/fmt.vim b/ftplugin/go/fmt.vim
index 30814fdf..5447d457 100644
--- a/ftplugin/go/fmt.vim
+++ b/ftplugin/go/fmt.vim
@@ -12,11 +12,25 @@
" It tries to preserve cursor position and avoids
" replacing the buffer with stderr output.
"
+" Options:
+"
+" g:go_fmt_commands [default=1]
+"
+" Flag to indicate whether to enable the commands listed above.
+"
if exists("b:did_ftplugin_go_fmt")
finish
endif
-command! -buffer Fmt call s:GoFormat()
+
+if !exists("g:go_fmt_commands")
+ let g:go_fmt_commands = 1
+endif
+
+
+if g:go_fmt_commands
+ command! -buffer Fmt call s:GoFormat()
+endif
function! s:GoFormat()
let view = winsaveview()