245 points · by sramsay · 13y ago · 124 comments
Of the former, the help file says:
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 for 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.
Most notably, syntax highlighting for Javascript and XML files with long lines is now working fine. Previously Vim could get stuck.
To future regexp implementors: Do it this way first!
Russ Cox? You know that regular expressions have existed since Kleene's first proposals, and everyone with a CS degrees knows that you can compile them to deterministic finite state automata. Right?
I'm struggling to understand your negativity here..
Oh, wait.
The initial work was done in a 2008 Summer of Code project: http://code.google.com/p/vim-soc2008-regexp/source/list
but there were lots of fiddly issues with character classes and Unicode handling, a need for exact equivalence to the old regex engine to avoid arbitrarily breaking existing scripts, and a need for a comprehensive test suite, all of which took a while for people to supply.
Does anyone know more details about new regex matcher? (I don't think I will be able to read the code).
Today I made it so that every time I open a .markdown file, vim compiles it to html and opens it in my browser (using 'open' command on OS X). It also updates it automatically every time I save or leave insert mode.
I've also hacked together a python REPL inside a vim window. (Wasn't very hard, as vim has python built-in.)
Once you realise that Vim is just an extension of the command line, a new world opens up. Everything you can do from the command line, you can do from Vim. Throw in Python and the options are endless... So much POWER!!
BTW: I also discovered vim has MzScheme built-in, so don't go for emacs just because of lisp... Vim has a nicer lisp! Come to the dark side, we have cookies! (And lisp.)
Edit: Safari reloads the existing tab, so set the default browser to Safari if you want that.
https://github.com/rcarmo/macvim/releases/tag/7.4
It's a tad controversial, I know, but I find it vastly more friendly than NERDTree, and I know quite a few people were looking for alloy's builds a while back.
EDIT: screenshot, from an older build:
https://f.cloud.github.com/assets/392683/793013/469e0c62-ebd...
you can also get it here - https://gist.github.com/mjhea0/6200588
New patches for 7.4 will be in the patches/7.4 folder.
This is ridiculous.
Just the other day I was able to update a whole load of software on my laptop using the 'cup' command - which worked almost perfectly. It broke my installation of Libre Office - which I then had to install the old fashioned (for windows) way. But that was still a considerable amount of time saved for me!
In ~/.gvimrc:
" no toolbar
set go-=T
" no right scrollbar
set go-=r
" no left scollbar
set go-=L :set go=aAcegimtv
:set go-=vtmigecAa
:set go? " guioptions=aAcegimtvAre you sure? Check out my build: https://github.com/rcarmo/macvim/releases/tag/7.4
EDIT: link to fixed release.
$ ./MacVim dyld: Library not loaded: /usr/local/lib/liblua.5.1.5.dylib Referenced from: /Applications/MacVim.app/Contents/MacOS/Vim Reason: image not found
EDIT: fixed! Disabled Lua for now, I have both my own build and brew's installed, and it will take some time to sort out.
The undo branching feature seems like it could be useful as well.
I don't agree with that at all. Vim is useful, perhaps, for a few text matching tricks but typing speed is rarely the bottleneck in programming. It's optimising for the wrong thing.
The only people advocating for vim are those who have already gone through the pointless pain of 5 years learning to use the thing. It's basically a cult, or at least a club. And frankly, watching these vim "power users" is usually quite frustrating - they struggle to do trivial tasks which can be accomplished in sublime with a simple right mouse click.
It is important to know the basic vim commands for when you are editing text via ssh but for everyday use sublime text is, IMO, superior in every way.
> typing speed is rarely the bottleneck in programming
You're right, especially if you're using a language that doesn't require a lot of boilerplate. But between the UNIX shell and the normal vim add-ons, even higher-level editing tasks, i.e. those that aren't strictly about raw editing, shouldn't give vim users trouble.
As with negatmx, I'm convinced you haven't met people who use vim properly. Name a task on which you've either seen or you'd imagine a ST user to outperform a vim "power user". I'll let you know the logical way to do it in vim.
[1] To obtain solid proficiency with the vim editing model, just work through the interactive vimtutor, read up on text objects, and spend a couple hours acclimating yourself to using the following motions and commands in place of hjkl (sort of but not necessarily in order of usefullness):
/ ? n N f F t T # *
gg G <n>G (e.g. 42G)
H M L
^ 0 $ { } ( ) w W b B e E
C-f C-b C-d C-u
zt zz zb
For me, given that Vim is easily powerful enough to compete with any other editor, the benefits of ubiquity override anything else.
I use an IDE for code, FocusWriter for just about everything else involving text and nano for server work (I'm can use vim if needed but I prefer nano for quick config file edits and after using it for a decade muscle memory isn't worth fighting).
For large web programs ( html/js etc), once you use Sublime, no going back to VI. The plugin ecosystem for js fwks are awesome.
/ducks
All editor-fanboyism aside, who cares? I spent $59 on ST2 and it was, by far, the best $59 I've ever spent. But if someone is more comfortable with vim or emacs or nano or gedit, I don't care. It doesn't bother me, as long as you're making something.
I adore Sublime Text, and use it where I can, but there are instances where I need to work on something remotely. Bug fixes, git rebasing, etc; and that's where I lean on Vim.