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

How do I have all folds expanded by default when file opens?

Expand Messages
  • riickcr
    I m sure this is simple, but my searching the help files Currently xml files are opening with all folds closed. I then hit zi which expands all folds. I m
    Message 1 of 4 , Aug 3, 2009
    • 0 Attachment
      I'm sure this is simple, but my searching the help files
      Currently xml files are opening with all folds closed. I then hit 'zi'
      which expands all folds. I'm searching around trying to figure out how
      I can have my xml files by default open with everything expanded?

      In my .vimrc I have this set:

      let g:xml_syntax_folding=1

      but I'm not sure how that's related as changing the number doesn't
      seem to have much affect, other than that line seems to need to be
      there to allow folding for my xml files?

      TIA for any help
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Andrew Long
      ... The option foldlevel sets the initial number of folds to be open when the file is opened. I set this in my .vimrc as a global for all file types, but you
      Message 2 of 4 , Aug 3, 2009
      • 0 Attachment
        On 3 Aug 2009, at 19:19, riickcr wrote:

        >
        > I'm sure this is simple, but my searching the help files
        > Currently xml files are opening with all folds closed. I then hit 'zi'
        > which expands all folds. I'm searching around trying to figure out how
        > I can have my xml files by default open with everything expanded?
        >
        > In my .vimrc I have this set:
        >
        > let g:xml_syntax_folding=1
        >
        > but I'm not sure how that's related as changing the number doesn't
        > seem to have much affect, other than that line seems to need to be
        > there to allow folding for my xml files?
        >
        The option 'foldlevel' sets the initial number of folds to be open when
        the file is opened. I set this in my .vimrc as a global for all file
        types, but you an set it on a file-by-file basis in the file type
        initialisation routines.

        see :he 'foldlevel' (note the apostrophes denote help for an option)

        Regards, Andy
        --
        Andrew Long
        andrew dot long at mac dot com


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Ben Fritz
        ... Actually, the option foldlevel sets the number of open folds in the current window, and the global value is used to initialize the value for new windows.
        Message 3 of 4 , Aug 4, 2009
        • 0 Attachment
          On Aug 3, 5:12 pm, Andrew Long <andrew.l...@...> wrote:
          > The option 'foldlevel' sets the initial number of folds to be open when
          > the file is opened. I set this in my .vimrc as a global for all file
          > types, but you an set it on a file-by-file basis in the file type
          > initialisation routines.
          >
          > see :he 'foldlevel' (note the apostrophes denote help for an option)
          >

          Actually, the option 'foldlevel' sets the number of open folds in the
          current window, and the global value is used to initialize the value
          for new windows. But, if you load a NEW file in the SAME window, the
          old foldlevel (even if it has been modified) is used.

          The better option to use is 'foldlevelstart' but even that has a few
          minor disadvantages, since you can't use zm/zr right away on buffers
          with folding much less than the 'foldlevelstart' value.

          See http://vim.wikia.com/wiki/All_folds_open_when_open_a_file for a
          discussion and alternatives.
          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Rick
          ... Excellent thanks. I was going crazy trying to get it to work as expected with foldlevel and having trouble. -- Rick R
          Message 4 of 4 , Aug 4, 2009
          • 0 Attachment
            On Tue, Aug 4, 2009 at 10:53 AM, Ben Fritz <fritzophrenic@...> wrote:

            See http://vim.wikia.com/wiki/All_folds_open_when_open_a_file for a
            discussion and alternatives.
             

            Excellent thanks. I was going crazy trying to get it to work as expected with 'foldlevel' and having trouble.

            --
            Rick R

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---

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