aboutsummaryrefslogtreecommitdiff
path: root/vim/autocmd.vim
diff options
context:
space:
mode:
authorMiquel Sabaté <mikisabate@gmail.com>2014-08-29 14:52:05 +0200
committerMiquel Sabaté <mikisabate@gmail.com>2014-08-29 14:52:05 +0200
commit7d1268f31b50060d99dc450bb564a1392d4d74f9 (patch)
tree72ece7252020e37fd1a02e9ffb9faa32d240764f /vim/autocmd.vim
parent303c0fa42eb70a5f5d06997de6c52a5908e4d488 (diff)
downloaddotfiles-7d1268f31b50060d99dc450bb564a1392d4d74f9.tar.gz
dotfiles-7d1268f31b50060d99dc450bb564a1392d4d74f9.zip
vim: all the calls to autocmd are now in a separate file.
Diffstat (limited to 'vim/autocmd.vim')
-rw-r--r--vim/autocmd.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/vim/autocmd.vim b/vim/autocmd.vim
new file mode 100644
index 0000000..5cebac3
--- /dev/null
+++ b/vim/autocmd.vim
@@ -0,0 +1,19 @@
+
+" Indentation rules for different languages.
+
+" Some rules regarding indentation on different languages.
+autocmd FileType perl set shiftwidth=4 tabstop=4
+autocmd FileType c set shiftwidth=4 tabstop=4
+autocmd FileType yacc set shiftwidth=4 tabstop=4
+autocmd FileType go set shiftwidth=4 tabstop=4
+autocmd FileType ruby set shiftwidth=2 tabstop=2
+autocmd FileType cpp set shiftwidth=4 tabstop=4
+autocmd FileType php set shiftwidth=2 tabstop=2
+autocmd FileType javascript set shiftwidth=2 tabstop=2
+
+" Call gofmt on save.
+autocmd FileType go autocmd BufWritePre <buffer> Fmt
+
+" Clean up trailing whitespaces on save.
+autocmd BufWritePre * :%s/\s\+$//e
+