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

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

Expand Messages
  • 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 1 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 2 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.