rdfs:comment
| - You can add folding capability to C-style comments using the command: au BufNewFile,BufRead *.cpp,*.c,*.h,*.java syn region myCComment start="/\*" end="\*/" fold keepend transparent This will work on C, .h, C++, and Java files. The "keepend" and "transparent" commands are necessary to avoid overriding the default syntax highlighting of comments. If you want to keep the "/*" beginning of the comment in the folded text, you can use the following function: The resulting line should look about the same as the default, without removing the comments.
|
abstract
| - You can add folding capability to C-style comments using the command: au BufNewFile,BufRead *.cpp,*.c,*.h,*.java syn region myCComment start="/\*" end="\*/" fold keepend transparent This will work on C, .h, C++, and Java files. The "keepend" and "transparent" commands are necessary to avoid overriding the default syntax highlighting of comments. If you want to keep the "/*" beginning of the comment in the folded text, you can use the following function: set foldtext=MyFoldText() function MyFoldText() let line = getline(v:foldstart) let sub = substitute(line, '^[ ]*', '', '') let nlines = v:foldend - v:foldstart + 1 if strlen(nlines) == 1 let nlines = " " . nlines elseif strlen(nlines) == 2 let nlines = " " . nlines endif return "+-" . v:folddashes . nlines . ": " . sub endfunction The resulting line should look about the same as the default, without removing the comments.
|