comparison vim/vimrc @ 287:44c9d65cfa74

Readjust some Vim config stuff around folding. Don't remove trailing space in C++ files because other people don't.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 20 Feb 2015 11:45:54 -0800
parents a29080fb35d9
children 25b672f0f6bd
comparison
equal deleted inserted replaced
286:a29080fb35d9 287:44c9d65cfa74
166 " Going left and right let you go to other lines. 166 " Going left and right let you go to other lines.
167 set whichwrap+=<,>,h,l 167 set whichwrap+=<,>,h,l
168 168
169 " How to show invisible characters 169 " How to show invisible characters
170 set listchars=eol:$,tab:>-,trail:-,extends:>,precedes:<,nbsp:%,conceal:. 170 set listchars=eol:$,tab:>-,trail:-,extends:>,precedes:<,nbsp:%,conceal:.
171
172 " Folds are defined by markers in the text.
173 set foldmethod=marker
174 171
175 " Nice auto-complete menu. 172 " Nice auto-complete menu.
176 set completeopt=longest,menuone,preview 173 set completeopt=longest,menuone,preview
177 174
178 " Column indicators. 175 " Column indicators.
348 autocmd FileType php setlocal matchpairs-=<:> 345 autocmd FileType php setlocal matchpairs-=<:>
349 augroup END 346 augroup END
350 347
351 augroup VimRCFileType_c 348 augroup VimRCFileType_c
352 au! 349 au!
353 autocmd FileType c,c++ setlocal foldmethod=marker foldmarker={,} 350 autocmd FileType c,c++,cpp setlocal foldmethod=syntax
354 augroup END 351 augroup END
355 352
356 augroup VimRCFileType_css 353 augroup VimRCFileType_css
357 au! 354 au!
358 autocmd BufNewFile,BufRead *.less setlocal filetype=less 355 autocmd BufNewFile,BufRead *.less setlocal filetype=less
368 "autocmd FileType python if exists('python_space_error_highlight')|unlet python_space_error_highlight|endif 365 "autocmd FileType python if exists('python_space_error_highlight')|unlet python_space_error_highlight|endif
369 augroup END 366 augroup END
370 367
371 augroup VimRCTrailingWhitespaces 368 augroup VimRCTrailingWhitespaces
372 au! 369 au!
373 autocmd FileType c,cpp,java,php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces() 370 autocmd FileType php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
374 augroup END 371 augroup END
375 372
376 " }}} 373 " }}}
377 374
378 " Mappings {{{ 375 " Mappings {{{
489 486
490 " }}} 487 " }}}
491 488
492 " Folding {{{ 489 " Folding {{{
493 490
494 " Always start with all folds closed. 491 " Folds are defined by markers in the text.
495 set foldlevelstart=0 492 set foldmethod=marker
496 493
497 " Toggle folds with <space>. 494 " Toggle folds with <space>.
498 nnoremap <space> za 495 nnoremap <space> za
499 496
500 " Create folds with <space> (in visual mode). 497 " Create folds with <space> (in visual mode).