Have you tried the advice at
http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text?

It's obviously not originally meant to speed things up, but has that
nice side effect.

I use this tip, and yet occasionally encounter such slowdowns (often when
editing large Vim scripts (ft=vim)). There's noticeable delay in moving the
cursor, and insert-completion (i_CTRL-N) is also painfully slow (so that I see
the "scanning buffers, tags, ..." messages). A restart of Vim fixes things (at
least for a while). Sorry to be so unspecific, but this can be a real pain.


Yeah I realize it's not a full solution. Is the issue pretty much
known, it just needs a good fix figured out? Or does it still need
investigation? Does the OP's backtrace help at all? I admit I've not
used gdb enough to know how to use it effectively, but it looks like
all it points to is "somewhere in the syntax folding routines Vim is
being slow".

Me and a friend of mine started a Python file type plug-in. I'd never used syntax folding but my friend took on the challenge of creating a decent automatic folding mode for Python source code. Ever since we added the syntax folding I've loved the feature (no more fold markers!) but since I started using it my Vim sometimes gets unbearably slow.

There's no real pattern (except that it takes a while for Vim to slow down -- I only notice the problem during >= 30 minute editing sessions) but I have noticed that once Vim gets slow, lots of non-specific and seemingly unrelated features become very slow -- insert mode editing, the completion menu, indenting and dedenting.

My friend suggested I use the tip on the Vim wiki but it doesn't really solve the root problem, it just makes it occur less often, but once the "bug" triggers it's just as big of a problem :-\

During one of the slowdowns I used ltrace to see what the hell Vim was doing while it was unresponsive and all I could see was thousands of string comparisons against substrings of lines (not full lines).

Like Ingo I'm sorry I can't get more specific, but that's kind of the problem: This issue is really hard to diagnose properly because it basically seems like syntax folding has some horrible worst case performance which only shows once in a while, in large buffers, but once it manifests you can basically give up on using Vim properly.

When I disable syntax folding and reload the buffer using :edit Vim is instantly fast again. Strange enough it seems that changing the text folding options does not have the same effect...

 - Peter

--
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui