On Thu, Feb 4, 2010 at 10:41 AM, Ben Fritz <[email protected]> wrote:
>
>
> On Feb 3, 9:12 am, "Benjamin R. Haskell" <[email protected]> wrote:
>>
>> Does anyone have a nice way to "freeze" the folds to their initial
>> values while in insert mode?
>>
>
> I also find that the constantly changing folds beneath the insertion
> point is annoying, especially if I have spent time carefully closing
> folds below the cursor.
>
> I have not found a decent workaround in general, though I did get
> around it for opening/closing C-style comments, by mapping /* to first
> insert the closing comment, then back up and insert the beginning.
> This won't work for braces though, because the } will close the
> current code block.
>
> I'm thinking it may be possible to map { to insert the opening and
> closing brace in one fell swoop using the expression register, but I
> haven't tried it yet.
>
> The best solution would probably be a change to the Vim source to put
> off updating folds while in insert mode, especially for fdm=syntax,
> but it can also be annoying for fdm=marker and probably others.
Couldn't you do something like this:
au InsertEnter * let b:oldfdm = &l:fdm | setlocal fdm=manual
au InsertLeave * let &l:fdm = b:oldfdm
As far as I can see, that should get around the problem... But maybe
I'm missing something?
~Matt
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php