Loading ...
Sorry, an error occurred while loading the content.

Re: 答复: how fold all comment line?

Expand Messages
  • Christian Brabandt
    (please don t top poste) ... you could leave out the first s*, it doesn t matter here. ... You need to anchor your pattern to the beginning of the line, like
    Message 1 of 4 , Nov 15, 2012
    • 0 Attachment
      (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

      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.