Add auto-remove-whitespace

git-svn-id: http://photonzero.com/dotfiles/trunk@103 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
michener 2011-08-26 21:55:26 +00:00
parent a9e9e6d6ba
commit 18fd920110
2 changed files with 27 additions and 1 deletions

18
.vimrc
View file

@ -258,6 +258,15 @@ if g:google != 0
augroup filetypedetect
au WinEnter,BufNewFile,BufRead * call HighlightTooLongLines()
augroup END
if filereadable("/home/williasr/.vim.d/blaze.vim")
source /home/williasr/.vim.d/blaze.vim
" Load Blaze errors into quickfix mode
nmap <Leader>bl :call LoadBlazeErrors():cc
" Run the most appropriate blaze command on the target for the current file.
nmap <Leader>bb :call BlazeDwim()
" Run update_deps on the target for the current file.
nmap <Leader>bu :call UpdateDepsDwim()
endif
endif
if filereadable("/home/build/nonconf/google3/tools/tags/gtags.vim")
@ -316,3 +325,12 @@ function! AutoHighlightToggle()
endif
endfunction
" Removes trailing spaces
function AutoTrimWhitespace()
if b:auto_trim_whitespace == 1
%s/\s\+$//e
''
endif
endfunction
autocmd BufWritePre * :call AutoTrimWhitespace()