Vim 7.4 was just released and it has a new regexp engine which does not backtrack! According to the help,
Vim includes two regexp engines: 1. An old, backtracking engine that supports everything. 2. A new, NFA engine that works much faster on some patterns, but does not support everything. Vim will automatically select the right engine for you. However, if you run into a problem or want to specifically select one engine or the other, you can prepend one of the following to the pattern: \%#=0 Force automatic selection. Only has an effect when 'regexpengine' has been set to a non-zero value. \%#=1 Force using the old engine. \%#=2 Force using the NFA engine. You can also use the 'regexpengine' option to change the default.
So this is analogous to the situation with Perl--- by default, Vim will decide which engine to use for a given expression. But using those prefixes, it's more like the situation with Python and Ruby--- we decide which engine to use.
Here's what I did to install Vim 7.4 on my Linux machine
$ wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 $ tar xf vim-7.4.tar.bz2 $ cd vim74/ $ ./configure --prefix=/opt/vim74 $ make $ make test $ sudo make install
Now give it a whirl!
$ /opt/vim74/bin/vim
Note that if you use Vim with a GUI, you might need to help it find the version you want. I ran the above commands on a Xubuntu 13.04 machine and when I ran
$ /opt/vim74/bin/gvim
I got Athena widgets, which looked out of place amongst all of the pretty Xfce things. Turns out I hadn't run
$ sudo apt-get install gnome-devel
yet on this machine, so Vim couldn't find what it needed. After running that command, I rebuilt Vim and now I get GTK2 widgets (at first, I thought I would need to run configure with the --enable-gui=gtk2 option, but that's not the case; it will discover that on its own).
Happy matching!
Recent Comments