Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am experiencing a noticeable slowness in Vim's bracket-matching and -highlighting feature. When the cursor is placed over a parenthesis or bracket, there is a delay of about 300ms on the console's responsiveness. As stated, this only seems to occur when working with PHP files. I am running Vim 7.2 on Debian Squeeze with a .vimrc file:

  1 set autoindent
  2 set smarttab
  3 set ruler
  4 set expandtab
  5 set termencoding=utf-8
  6 set fileformat=unix
  7 set number
  8 set tabstop=4
  9 set encoding=utf-8
 10 set shiftwidth=4
 11 set noswapfile
 12 set backspace=indent,eol,start
 13 set shortmess=lrwxI
 14 set history=50
 15 set background=dark
 17 let php_folding=2
 18 let php_asp_tags=0
 20 colorscheme desert

Is there any way to alleviate this slowdown?

share|improve this question
up vote 2 down vote accepted

I don't see this locally; the matching parens is instantly highlighted. Try this:

:set filetype=txt

...and see if things improve. If so, something in vim's PHP handling configuration may be a bit out of whack. Do you see the same behaviour on very small PHP files? I'm on 7.2 on ubuntu and not seeing what you're seeing.

Hope this helps!

UPDATE: thanks for updating your question to include your .vimrc - this leads to another thing for you to test. Please see if this doesn't help the situation - change php_folding to 1 rather than 2. 2 folds all { } regions so this may be somehow interacting with the parens-matching logic and causing the delay.

share|improve this answer
Also you say "on the consoles responsiveness" - are you running vim in a terminal emulator, or on a virtual console (ctrl-alt-F1 for example)? – pbr Nov 11 '09 at 0:14

Type this to turn it off per-instance:


(capitalization is important)

Add this to your ~/.vimrc to disable it before the module loads:

let loaded_matchparen = 1

You only need one. With the first, you have to type it every time you open a PHP file, but you can turn it on again at any time. With the second, it's always off, but you can't simply turn it on again.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .