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

How to "fold more" only over specified range of lines

Expand Messages
  • Paul
    For vim folds, zm and zr decreases and increases the depth of visible folds. Is there a way to modify the folds in this manner but only over a range of
    Message 1 of 3 , Feb 22, 2013
    • 0 Attachment
      For vim folds, "zm" and "zr" decreases and increases the depth of
      visible folds. Is there a way to modify the folds in this manner but
      only over a range of lines (perhaps delineated by 'a and 'b)?

      --
      --
      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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Ben Fritz
      ... I don t know of a command to do this. If there is not one listed at :help fold-commands, it probably doesn t exist. It might be possible to script such a
      Message 2 of 3 , Feb 22, 2013
      • 0 Attachment
        On Friday, February 22, 2013 9:24:57 AM UTC-6, Paul wrote:
        > For vim folds, "zm" and "zr" decreases and increases the depth of
        >
        > visible folds. Is there a way to modify the folds in this manner but
        >
        > only over a range of lines (perhaps delineated by 'a and 'b)?

        I don't know of a command to do this. If there is not one listed at :help fold-commands, it probably doesn't exist.

        It might be possible to script such a command, making use of the :foldopen and :foldclose commands. But this isn't a trivial task; I don't know of an easy way to get a list of all folds on a line and the depth, for nested folds. You can look at $VIMRUNTIME/syntax/2html.vim for how the fold information in a file is found and stored in usable form. If there's an easier way to do it I'd love to know about it.

        --
        --
        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

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Paul
        ... For now, I think I ll just apply :foldopen and :foldclose to line ranges instead. Thanks. -- -- You received this message from the vim_use maillist. Do
        Message 3 of 3 , Feb 22, 2013
        • 0 Attachment
          On Feb 22, 12:12 pm, Ben Fritz <fritzophre...@...> wrote:
          >On Friday, February 22, 2013 9:24:57 AM UTC-6, Paul wrote:
          >> For vim folds, "zm" and "zr" decreases and increases the depth of
          >>
          >> visible folds. Is there a way to modify the folds in this manner
          >> but
          >>
          >> only over a range of lines (perhaps delineated by 'a and 'b)?
          >
          > I don't know of a command to do this. If there is not one listed at
          > :help fold-commands, it probably doesn't exist.
          >
          > It might be possible to script such a command, making use of the
          > :foldopen and :foldclose commands. But this isn't a trivial task; I
          > don't know of an easy way to get a list of all folds on a line and
          > the depth, for nested folds. You can look at
          > $VIMRUNTIME/syntax/2html.vim for how the fold information in a file
          > is found and stored in usable form. If there's an easier way to do
          > it I'd love to know about it.

          For now, I think I'll just apply :foldopen and :foldclose to line
          ranges instead. Thanks.

          --
          --
          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

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.