|
233 | 233 | set pastetoggle=<F12> " pastetoggle (sane indentation on pastes)
|
234 | 234 | "set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
|
235 | 235 | " Remove trailing whitespaces and ^M chars
|
236 |
| - autocmd FileType c,cpp,java,go,php,javascript,python,twig,xml,yml autocmd BufWritePre <buffer> call StripTrailingWhitespace() |
| 236 | + " To disable the stripping of whitespace, add the following to your |
| 237 | + " .vimrc.before.local file: |
| 238 | + " let g:spf13_keep_trailing_whitespace = 1 |
| 239 | + autocmd FileType c,cpp,java,go,php,javascript,python,twig,xml,yml autocmd BufWritePre <buffer> if !exists('g:spf13_keep_trailing_whitespace') | call StripTrailingWhitespace() | endif |
237 | 240 | autocmd FileType go autocmd BufWritePre <buffer> Fmt
|
238 | 241 | autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
239 | 242 | autocmd FileType haskell setlocal expandtab shiftwidth=2 softtabstop=2
|
|
890 | 893 |
|
891 | 894 | " Strip whitespace {
|
892 | 895 | function! StripTrailingWhitespace()
|
893 |
| - " To disable the stripping of whitespace, add the following to your |
894 |
| - " .vimrc.before.local file: |
895 |
| - " let g:spf13_keep_trailing_whitespace = 1 |
896 |
| - if !exists('g:spf13_keep_trailing_whitespace') |
897 |
| - " Preparation: save last search, and cursor position. |
898 |
| - let _s=@/ |
899 |
| - let l = line(".") |
900 |
| - let c = col(".") |
901 |
| - " do the business: |
902 |
| - %s/\s\+$//e |
903 |
| - " clean up: restore previous search history, and cursor position |
904 |
| - let @/=_s |
905 |
| - call cursor(l, c) |
906 |
| - endif |
| 896 | + " Preparation: save last search, and cursor position. |
| 897 | + let _s=@/ |
| 898 | + let l = line(".") |
| 899 | + let c = col(".") |
| 900 | + " do the business: |
| 901 | + %s/\s\+$//e |
| 902 | + " clean up: restore previous search history, and cursor position |
| 903 | + let @/=_s |
| 904 | + call cursor(l, c) |
907 | 905 | endfunction
|
908 | 906 | " }
|
909 | 907 |
|
|
0 commit comments