Sunday, October 30, 2011

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

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

No comments:

Post a Comment