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

Re: How to edit partly folded text without it going Sproing! ?

Expand Messages
  • Erik Christiansen
    ... Yes, that does refold following folds on entering {{{, after spontaneously opening them on entering }}}. Thankyou. A temporary foof of unfolding is much
    Message 1 of 7 , Oct 30, 2011
      On 30.10.11 12:59, Marcin Szamotulski wrote:
      > On 22:42 Sun 30 Oct , Erik Christiansen wrote:
      > > With foldmethod=marker, and lots of closed folds lower on the screen, I
      > > make a new fold by appending {{{, and }}}, as appropriate. Whether I
      > > place the {{{ or }}} first, Vim unfolds all the following closed folds.

      > What about first putting the ending marker }}} and after that placing the
      > beginning marker {{{ above it.

      Yes, that does refold following folds on entering {{{, after
      spontaneously opening them on entering }}}.

      Thankyou. A temporary foof of unfolding is much better than a persistent
      one. :-)

      Erik

      --
      Arrgh. I just found a Google search result of somebody who was
      experiencing exactly the same problem as me, only to find it was me :-(.
      - Read on luv-talk ML.

      --
      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
    • Paul
      ... I have the following in my vimrc. I got it from this list, I think. Apologies for losing credit to whomever first posted it. Don t screw up folds when
      Message 2 of 7 , Oct 30, 2011
        On Sunday, 30 October, 2011 at 11:42:22 GMT, Erik Christiansen wrote:
        >With foldmethod=marker, and lots of closed folds lower on the screen, I
        >make a new fold by appending {{{, and }}}, as appropriate. Whether I
        >place the {{{ or }}} first, Vim unfolds all the following closed folds.
        >
        >Is there something I could (do | stop doing) to make that behaviour go
        >away?

        I have the following in my vimrc. I got it from this list, I think. Apologies for losing credit to whomever first posted it.

        " Don't screw up folds when inserting text that might affect them, until
        " leaving insert mode. Foldmethod is local to the window. Protect against
        " screwing up folding when switching between windows.
        autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
        autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w: last_fdm | unlet w:last_fdm | endif

        --

        .

        --
        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
      • Ben Fritz
        ... It may have been from here: http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text Sproing . Good description :-) -- You received this message
        Message 3 of 7 , Oct 30, 2011
          On Oct 30, 12:07 pm, Paul <google01...@...> wrote:
          > On Sunday, 30 October, 2011 at 11:42:22 GMT, Erik Christiansen wrote:
          > >With foldmethod=marker, and lots of closed folds lower on the screen, I
          > >make a new fold by appending {{{, and }}}, as appropriate. Whether I
          > >place the {{{ or }}} first, Vim unfolds all the following closed folds.
          >
          > >Is there something I could (do | stop doing) to make that behaviour go
          > >away?
          >
          > I have the following in my vimrc. I got it from this list, I think. Apologies for losing credit to whomever first posted it.
          >
          > " Don't screw up folds when inserting text that might affect them, until
          > " leaving insert mode. Foldmethod is local to the window. Protect against
          > " screwing up folding when switching between windows.
          > autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod |   setlocal foldmethod=manual | endif
          > autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:   last_fdm | unlet w:last_fdm | endif
          >

          It may have been from here:

          http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text

          "Sproing". Good description :-)

          --
          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
        • Erik Christiansen
          ... Ooooh yes, many thanks Paul. (And Ben, for the link.) That does the trick, just Vimderfully! Erik -- My grandmother currently runs ubuntu. This was not my
          Message 4 of 7 , Oct 31, 2011
            On 30.10.11 17:07, Paul wrote:
            > " Don't screw up folds when inserting text that might affect them, until
            > " leaving insert mode. Foldmethod is local to the window. Protect against
            > " screwing up folding when switching between windows.
            > autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
            > autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif

            Ooooh yes, many thanks Paul. (And Ben, for the link.)

            That does the trick, just Vimderfully!

            Erik

            --
            My grandmother currently runs ubuntu. This was not my doing, but she managed
            to wipe her windows and install it accidentally when someone handed her the
            live CD to deal with a windows problem she was having. The computer asked
            her to do things. So she did. - Seen on luv-main, in slightly longer form.

            --
            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
          • Andy Wokula
            ... I use ... to insert fold markers. E.g. typing before fof text results in before {{{ text }}} The idea is to have a mapping/abbrev that inserts {{{
            Message 5 of 7 , Oct 31, 2011
              Am 30.10.2011 12:42, schrieb Erik Christiansen:
              > Folding in Vim is a paragon amongst marvels. Not even bottled beer
              > competes. But I'm having a bit of bother holding my mouth right.
              >
              > With foldmethod=marker, and lots of closed folds lower on the screen, I
              > make a new fold by appending {{{, and }}}, as appropriate. Whether I
              > place the {{{ or }}} first, Vim unfolds all the following closed folds.
              >
              > Is there something I could (do | stop doing) to make that behaviour go
              > away?
              >
              > Just doing zm isn't enough, because of nested folds.
              >
              > Erik

              I use
              :inorea fof <C-G>u<C-R>=&fmr<CR><Esc>F,s<CR><Up><End>

              to insert fold markers.

              E.g. typing "before fof<Enter>text" results in
              before {{{
              text
              }}}

              The idea is to have a mapping/abbrev that inserts {{{ and }}} at the
              same time.

              --
              Andy

              --
              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
            Your message has been successfully submitted and would be delivered to recipients shortly.