autocmd BufWritePre * :%s/\s\+$//e
(add-hook 'before-save-hook 'delete-trailing-whitespace)
http://blogobaggins.com/2009/03/31/waging-war-on-whitespace.html
find . -name '*.rb' | xargs ruby -pi -e 'sub!(/\s+$/, "\n")'
desc "Remove unnecessary whitespace" task :whitespace do sh %Q{find app lib spec -name '.rb' -or -name '.haml' | xargs ruby -pi -e 'sub!(/\s+$/,"\n")'} end