(please don't top poste)
On Thu, November 15, 2012 10:33, 王军 wrote:
> Hi
> If do you said, only fold "//" which are at the front of line
>
> So I modify ,and like " set fde=getline(v:lnum)=~'\s*\/\/\\\|^\s*$'?1:0"
you could leave out the first \s*, it doesn't matter here.
> Now it will fold "//" which at back of line.
>
> Like this " a = b; //comment
You need to anchor your pattern to the beginning of the line, like this:
set fde=set fde=getline(v:lnum)=~'^\s*\/\/\\\|^\s*$'?1:0 fdm=expr fen
You should probably read an introduction to regular expressions, like
:h 27.4 and the following.
regards,
Christian