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

Re: How to fold text between two regular expressions ?

Expand Messages
  • Tim Chase
    ... You might be able to do something like ... You can tweak that initial regexp to catch what you want. If you can mix and match directives, you can do things
    Message 1 of 4 , Mar 1, 2007
    • 0 Attachment
      > How do I create folds such that it starts at matched
      > expression and ends at the line containing part of the matched
      > expression. e.g i'd like to fold
      >
      > procedure xyz ( .....
      > :
      > :
      > end xyz;
      >
      > function abc (
      > :
      > :
      > end abc;
      >
      > impure function pqr (
      > :
      > :
      > end pqr;

      You might be able to do something like

      :g/^\(procedure\|function\|impure function\)/.,/^end\>/fold

      You can tweak that initial regexp to catch what you want.
      If you can mix and match directives, you can do things like

      /^\(impure \|pure \)\=\(procedure\|function\)/

      which would find "procedure" or "function", optionally preceeded
      ("\=")by "pure" or "impure". A bit contrived, but you can riff
      on this theme to get all sorts of permutations.

      HTH,

      -tim
    Your message has been successfully submitted and would be delivered to recipients shortly.