summaryrefslogtreecommitdiffstats
path: root/ftplugin/rust.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-07-30 13:18:40 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2016-07-30 13:19:35 +0200
commitab61d2ac8eafc9c10097577736602da48ec568ca (patch)
treec33fcffa647794194376beb91ee35d8d3f8fcc4e /ftplugin/rust.vim
parentf42e1f477ccc8ba4ef756b6d7d16a26686b4b75f (diff)
downloadvim-polyglot-ab61d2ac8eafc9c10097577736602da48ec568ca.tar.gz
vim-polyglot-ab61d2ac8eafc9c10097577736602da48ec568ca.zip
Update
Diffstat (limited to 'ftplugin/rust.vim')
-rw-r--r--ftplugin/rust.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim
index 2023656e..9943e657 100644
--- a/ftplugin/rust.vim
+++ b/ftplugin/rust.vim
@@ -195,6 +195,11 @@ let b:undo_ftplugin = "
" }}}1
+" Code formatting on save
+if get(g:, "rustfmt_autosave", 0)
+ autocmd BufWritePre *.rs call rustfmt#Format()
+endif
+
augroup END
let &cpo = s:save_cpo