BT

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

by Roopesh Shenoy on Aug 13, 2013 |

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”.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT