Дмитрий Франк wrote:
Hi.
I very like Vim, thank you, but there's one thing in Vim that i really
hate.
I often use rather old notebook with processor Pentium M 1.6 GHz, and
when i use Vim on it, i can't normally edit files *.vim and *.php :
syntax highlighting for these filetypes is VERY SLOW.
And i'm sure that 1.6 GHz is pretty enough for syntax highlighting.
Some IDEs and just editors i tested works fine: SlickEdit, UltraEdit,
PHP Expert Editor.
I tested Vim both on Windows and Linux: lags the same. And other
editors works fine.
And this is Vim! Vim was always positioned as extremely fast editor,
when compared with IDEs. But there's fact: IDE works fast, Vim is
slow, on the same hardware.
I believe that Vim handles syntax highlighting not in the best
possible manner. I have to turn syntax off while editing *.vim and
*.php files on this machine, and i very don't like this.
I have two questions:
1) Do you have plans to improve syntax highlight handling, to make it
faster?
2) Is there maybe simplified syntax files for *.vim and/or *.php
files? Or any other way to solve this trouble without turning syntax off?
You could try "simplifying" the syntax files yourself. The slowest
portion of syntax highlighting involves "syn match ..." and "syn region
..."; ie. regular expression handling. To speed things up:
a) copy a system version of the syntax file you're interested in to your
home directory; ie. to $HOME/.vim/syntax or something like that.
b) Remove all lines from your personal copy that have "syn match ..."
and "syn region" in them, leaving only "syn keyword .." lines to do the
syntax highlighting.
Although this operation will not produce the same highlighting as the
unaltered files, and won't support syntax-based folding, I would expect
it to produce faster syntax highlighting.
As an easier item: look into :help syn-sync . Perhaps you can reduce
maxlines.
Syntax highlighting is known to be slow for loooooong lines. Try
breaking any long lines up a bit (ie. those >100 characters in the line,
as a rough criterion).
BTW, your 1.6GHz machine should be fine with syntax highlighting as-is.
Is it still "too slow" if you...
vim -u NONE somefile.vim
:set nocp
:syn on
I'm wondering if your slowdown is due to something other than just
syntax highlighting. This method of startup is barebones; no plugins, no
.vimrc, pretty much just syntax highlighting.
Regards,
Chip Campbell
--
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