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

repost: automatically opening folds

Expand Messages
  • Emmanuel Touzery
    Hello, Since nobody answered this question, i m asking again just in case. I wanted folds to open automatically under the cursor when automatically
    Message 1 of 4 , Dec 29, 2002
    • 0 Attachment
      Hello,

      Since nobody answered this question, i'm asking again just in case.
      I wanted folds to open automatically under the cursor when automatically
      positionning the cursor on the position it was the last time i opened that
      file. Dan Sharp and Antoine J. Mechelynck suggested looking at 'foldopen'.
      I found that foldopen=all fixed the problem but it's a bit too much for my
      taste. No other foldopen setting could fix the problem.
      Maybe a new foldopen value should be added, unless I missed something?

      See discussions at:
      http://lists.kde.org/?t=103959376300001&r=1&w=2

      thank you,

      emmanuel
    • Max Ischenko
      ... May be mkview/loadview could do the trick? -- Bst rgrds, M.A.X.: Mechanical Artificial Xenomorph.
      Message 2 of 4 , Dec 29, 2002
      • 0 Attachment
        Emmanuel Touzery wrote:

        > I wanted folds to open automatically under the cursor when
        > automatically positionning the cursor on the position it was the
        > last time i opened that file.
        May be mkview/loadview could do the trick?


        --
        Bst rgrds, M.A.X.: Mechanical Artificial Xenomorph.
      • Bram Moolenaar
        ... The foldopen option only applies to commands that you type. Adding mark whould work when typing the command. If it s used during startup or with a
        Message 3 of 4 , Dec 29, 2002
        • 0 Attachment
          Emmanuel Touzery wrote:

          > Since nobody answered this question, i'm asking again just in case.
          > I wanted folds to open automatically under the cursor when automatically
          > positionning the cursor on the position it was the last time i opened that
          > file. Dan Sharp and Antoine J. Mechelynck suggested looking at 'foldopen'.
          > I found that foldopen=all fixed the problem but it's a bit too much for my
          > taste. No other foldopen setting could fix the problem.
          > Maybe a new foldopen value should be added, unless I missed something?

          The 'foldopen' option only applies to commands that you type. Adding
          "mark" whould work when typing the '" command. If it's used during
          startup or with a mapping, you need to add the "zv" command there.

          --
          A computer program does what you tell it to do, not what you want it to do.

          /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
          /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
          \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
          \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
        • Emmanuel Touzery
          ... em but it s a bit ... yes, it s used during startup. i tried changing the code in my .vimrc, copied from /usr/local/share/vim/vim60/vimrc_example.vim to:
          Message 4 of 4 , Dec 29, 2002
          • 0 Attachment
            On Sunday 29 December 2002 14:52, Bram Moolenaar wrote:
            > Emmanuel Touzery wrote:
            > > Since nobody answered this question, i'm asking again just in case.
            > > I wanted folds to open automatically under the cursor when automatically
            > > positionning the cursor on the position it was the last time i opened
            > > that file. Dan Sharp and Antoine J. Mechelynck suggested looking at
            > > 'foldopen'. I found that foldopen=all fixed the problem but it's a bit
            > > too much for my taste. No other foldopen setting could fix the problem.
            > > Maybe a new foldopen value should be added, unless I missed something?
            >
            > The 'foldopen' option only applies to commands that you type. Adding
            > "mark" whould work when typing the '" command. If it's used during
            > startup or with a mapping, you need to add the "zv" command there.
            em but it's a bit
            > > too much for my taste. No other foldopen setting co
            yes, it's used during startup.
            i tried changing the code in my .vimrc, copied from
            /usr/local/share/vim/vim60/vimrc_example.vim to:

            if has("autocmd")
            autocmd BufReadPost *
            \ if line("'\"") > 0 && line("'\"") <= line("$") |
            \ exe "normal g`\"" |
            \ exe "normal zv" |
            \ endif
            endif " has("autocmd")

            (the \ exe "normal zv" | is the added line from the model).

            what did i miss?

            thanks for the help,

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