Robottinosino
Robottinosino

Reputation: 10882

Vim programming editor speed

Problem is: gets slow when I add the following lines to my :

set foldmethod=syntax 
set foldlevelstart=1 
let javaScript_fold=1 " JavaScript 
let perl_fold=1 " Perl 
let php_folding=1 " PHP 
let r_syntax_folding=1 " R 
let ruby_fold=1 " Ruby 
let sh_fold_enabled=1 " sh 
let vimsyn_folding='af' " Vim script 
let xml_syntax_folding=1 " XML 

Context: whilst editing a file

I think it's fair enough for it to slow down when:

... but... for it to do so everywhere?

Do you use/see the same? What could be done to ameliorate the sluggishness, if anything?


It took me a day to identify this, successfully reproduce it anywhere on my (virtual and non-) machines, eliminating candidate contributors to overall slowness by a process of binary search.


My environment

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Mar 12 2013 14:05:25)

OS X v10.8.3 (build 12D78)

v3.2.48(1)-release


Upvotes: 5

Views: 192

Answers (2)

romainl
romainl

Reputation: 196596

set foldmethod=indent

is much faster and works more reliably and in a more predictable manner across languages than syntax.

Also, what is the point of adding " PHP after let php_folding=1?

Anyway, you should get yourself a proper Vim: the one provided with Mac OS X is both outdated and crippled. Using the latest available version may not fix your issue but it provides the best baseline for asking and providing help.

Upvotes: 1

perreal
perreal

Reputation: 97958

You can play with some auto commands. Turning on features depending on the type of files, vim can speed up. Example:

autocmd BufRead *.pt set filetype=xml
au FileType xml setlocal foldmethod=syntax

Upvotes: 1

Related Questions