changeset 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
files vim/vimrc
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/vim/vimrc	Fri Feb 20 11:44:04 2015 -0800
+++ b/vim/vimrc	Fri Feb 20 11:45:54 2015 -0800
@@ -169,9 +169,6 @@
 " How to show invisible characters
 set listchars=eol:$,tab:>-,trail:-,extends:>,precedes:<,nbsp:%,conceal:.
 
-" Folds are defined by markers in the text.
-set foldmethod=marker
-
 " Nice auto-complete menu.
 set completeopt=longest,menuone,preview
 
@@ -350,7 +347,7 @@
 
 augroup VimRCFileType_c
     au!
-    autocmd FileType c,c++ setlocal foldmethod=marker foldmarker={,}
+    autocmd FileType c,c++,cpp setlocal foldmethod=syntax
 augroup END
 
 augroup VimRCFileType_css
@@ -370,7 +367,7 @@
 
 augroup VimRCTrailingWhitespaces
     au!
-    autocmd FileType c,cpp,java,php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
+    autocmd FileType php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
 augroup END       
 
 " }}}
@@ -491,8 +488,8 @@
 
 " Folding {{{
 
-" Always start with all folds closed.
-set foldlevelstart=0
+" Folds are defined by markers in the text.
+set foldmethod=marker
 
 " Toggle folds with <space>.
 nnoremap <space> za