BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Vim Gets Faster Regex Engine, 1000+ Fixes And Small Improvements

Vim Gets Faster Regex Engine, 1000+ Fixes And Small Improvements

Leia em Português

This item in japanese

Vim 7.4 was recently released, after more than a month of beta. It is more robust and comes with a new, faster engine for regular expressions.

“fix all problems, big and small; make Vim more robust” is the sixth most popular result in the list of most-wanted features by vim users. The Vim team seems to have taken this seriously, and there are more than a 1000 fixes and minor improvements since the last version, 7.3 was released in Aug 2010.

Along with this, the new regex engine comes with better performance –

What is now called the "old" regexp engine uses a backtracking algorithm.  It tries to match the pattern with the text in one way, and when that fails it goes back and tries another way.  This works fine or simple patterns, but complex patterns can be very slow on longer text.

The new engine uses a state machine.  It tries all possible alternatives at the current character and stores the possible states of the pattern.  This is a bit slower for simple patterns, but much faster for complex patterns and long text.

There is also a better Python Interface with python-bindeval (vim.bindeval instead of built-in eval) function and python-tabpage object (to create possibility of working with tabpages) being included.

For a full list of changes since 7.3, you can see these readmes (the second one is fixes since 7.4 hit beta) or install the new version and type command “:help version7.4”.

Rate this Article

Adoption
Style

BT