Remove trailing whitespace on save
b8c53d20267f8068fdb2f3a6453630300bf2ee29
1 parent
d966d9ba
.vimrc
+9 -0
| 61 | 61 | au FileType javascript set sts=4 sw=4 expandtab |
|
| 62 | 62 | au FileType go set ts=4 sw=4 noexpandtab |
|
| 63 | 63 | au FileType c set sw=4 noexpandtab |
|
| 64 | 64 | au FileType lua set sw=2 expandtab |
|
| 65 | 65 | ||
| 66 | + | " Remove trailing whitespace on save |
|
| 67 | + | autocmd BufWritePre * call s:StripTrailing() |
|
| 68 | + | function! s:StripTrailing() |
|
| 69 | + | let l = line(".") |
|
| 70 | + | let c = col(".") |
|
| 71 | + | %s/\s\+$//e |
|
| 72 | + | call cursor(l, c) |
|
| 73 | + | endfunction |
|
| 74 | + | ||
| 66 | 75 | " Haskell |
|
| 67 | 76 | let g:haskellmode_completion_ghc = 0 |
|
| 68 | 77 | let g:haskell_enable_quantification = 1 |
|
| 69 | 78 | let g:haskell_indent_where = 2 |
|
| 70 | 79 | let g:haskell_indent_case = 4 |