On Tue, 10 Aug 2010, Wayne wrote: > Hi there, > > I have found a way to do it. > I add following line into the cpp.vim syntax file: > syn match comment "\v(^\s*//.*\n)+" contains=cComentGroup fold extend > > Then when open a cpp file, all consecutive "//" comments will auto folded > under syntax foldmethod. > > The problem: > To change a syntax file is not remmended method. > Could someone exploit a way of writing something to global or local _vimrc > file to achieve the same object? > > B.R > Wayne
[Argh. Don't top-post.] I do something similar for PHP with this file: ===== ~/.vim/after/syntax/php.vim ===== syn region phpComment start=+/\*+ end=+\*/+ contained extend contains=phpTodo fold ======================================= For this, you'd want to create the file (and directories, if they don't exist): ===== ~/.vim/after/syntax/cpp.vim ===== syn match comment "\v(^\s*//.*\n)+" contains=cComentGroup fold extend ======================================= -- Best, Ben -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
