aboutsummaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc4
1 files changed, 4 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 6c38811..62c5cdb 100644
--- a/vimrc
+++ b/vimrc
@@ -112,12 +112,16 @@ source ~/.vim/bundles.vim
""
" Filetypes
+" Some rules regarding indentation on different languages.
autocmd FileType ruby set shiftwidth=2
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 go autocmd BufWritePre <buffer> Fmt
+" Clean up trailing whitespaces on save.
+autocmd BufWritePre * :%s/\s\+$//e
+
""
" Re-mappings