Mercurial > dotfiles
comparison vim/vimrc @ 160:5997455e475b
Whitespace cleaning.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 03 Jan 2014 19:34:30 -0800 |
parents | 7fd22eb11789 |
children | 254c4f068808 |
comparison
equal
deleted
inserted
replaced
159:9c1c2ffcc7e2 | 160:5997455e475b |
---|---|
256 " File I know are markdown: personal notes & PieCrust pages. | 256 " File I know are markdown: personal notes & PieCrust pages. |
257 autocmd BufRead,BufNewfile */Dropbox/Personal/SimpleNote/* set ft=markdown | 257 autocmd BufRead,BufNewfile */Dropbox/Personal/SimpleNote/* set ft=markdown |
258 autocmd BufRead,BufNewFile */_content/**/*.html set ft=piecrustmarkdown | 258 autocmd BufRead,BufNewFile */_content/**/*.html set ft=piecrustmarkdown |
259 | 259 |
260 augroup END | 260 augroup END |
261 | |
262 augroup VimRCTrailingWhitespaces | |
263 au! | |
264 | |
265 autocmd FileType c,cpp,java,php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces() | |
266 augroup END | |
261 | 267 |
262 endif | 268 endif |
263 | 269 |
264 " }}} | 270 " }}} |
265 | 271 |
409 else | 415 else |
410 setlocal spell nospell | 416 setlocal spell nospell |
411 endif | 417 endif |
412 endfunction | 418 endfunction |
413 | 419 |
420 function! s:StripTrailingWhitespaces() abort | |
421 let l = line(".") | |
422 let c = col(".") | |
423 %s/\s\+$//e | |
424 let @/='' | |
425 call cursor(l, c) | |
426 endfunction | |
427 | |
414 " }}} | 428 " }}} |
415 | 429 |
416 " Temporary stuff {{{ | 430 " Temporary stuff {{{ |
417 | 431 |
418 " Enable debugging Lawrencium | 432 " Enable debugging Lawrencium |