27 ms·
Vim 7.4 is released
- sramsay 13y ago:help version7.4 has all the details, but the two most significant ones cited are "New regexp engine" and "A more pythonic Python interface." 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.
- zeckalpha 13y agoIt sounds like someone read Russ Cox's work on regexp. http://swtch.com/~rsc/regexp/ http://swtch.com/~rsc/regexp/ To future regexp implementors: Do it this way first!
- danieldk 13y agoIt sounds like someone read Russ Cox's work on regexp. 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?
- recuter 13y agoSadly not everybody is familiar with Automata theory - furthermore, I'm sure he knows and his link is about implementation and is none trivial and none obvious. I'm struggling to understand your negativity here..
- danieldk 13y agoI'm struggling to understand your negativity here.. Sorry, that was indeed a bit harsh. I wanted to point out that Bram Molenaar is probably well-aware of DFAs given how well-known they are and how many implementations there are available. I don't think Russ Cox has much too do with it and rather that it is driven by demand - linear time matching is attractive for syntax highlighting.
- kenko 13y agoAnd that's why the RE2 implementation has existed equally long! Oh, wait.
- dlisboa 13y agoCox's work builds on Thompson's work from the 60s. He says so himself.
- mjn 13y agoThe basic implementation methods are well-known and quasi-standard, but Cox did make some useful practical additions, in addition to writing up a clear and accessible exposition. The classic DFA engines, like in Thompson's version of grep, provide a fairly minimal regex language (later standardized as POSIX regexes), not much fancier than the regular-language syntax used in textbooks. Perl-style regular expressions get such widespread usage even outside of Perl in part because they have a more full-featured syntax, which provides conveniences people find useful. Cox implemented a significant subset of this functionality as syntactic sugar on top of a classic automaton regex engine, so RE2, unlike POSIX regexes, supports named matches, named character classes like \d (plus Unicode character classes), non-greedy matches, etc. Basically everything that can be done without making the language nonregular, so excluding lookahead, lookbehind, and backreferences. Since vim regexes (a custom dialect) support some of those supra-POSIX features, those implementation techniques were likely useful for them to look at. Indeed they link to Cox's article somewhere or other in the design docs. Vim does have lookahead/lookbehind syntax, though; I wonder how they supported that. Fallback to the backtracking engine?
- danieldk 13y agoThere are many implementations the standard operations on finite state automata (determinization, minimization, intersection, concatenation, etc.) and nearly as many implementations of regular expressions[1]. Anyone who is in the trade (of text processing), including Bram Molenaar, will be aware that regular languages can be represented as finite state automata. However, the problem is that not all regular expressions 'dialects' (most notably Perl regexes) are not regular languages and cannot be represented as a finite state automata. For instance, the introduction of back-references makes regular expressions non-regular. So, it's not so much being enlightened by Russ Cox, but a trade-off between the convenience of some of the Perl extensions and the ability to apply matching in linear time. Also, for complex expressions, constructing the automaton can be slow. [1] A small selection: http://www.brics.dk/automaton/ http://www.brics.dk/automaton/ http://www.let.rug.nl/~vannoord/Fsa/ http://www.let.rug.nl/~vannoord/Fsa/ http://www.complang.org/ragel/ http://www.complang.org/ragel/ http://open.xerox.com/Services/fst-nlp-tools http://open.xerox.com/Services/fst-nlp-tools Some of the packages can also be used to construct transducers, weighted automata, etc.
- zeckalpha 13y agoLarry Wall does not have a CS degree.
- lsiebert 13y agoBut his degree did involve computers. He got his undergraduate degree in natural and artificial languages
- mjn 13y agoI assume a degree with that title would lean towards the formal side of linguistics, which means you would certainly cover things like the Chomsky hierarchy in detail; after all linguistics is where the Chomsky hierarchy (though not regular languages) originated.
- justinator 13y agoIn this interview[1] he states that his degree is one that he designed himself (which his college allowed), and that he used his programming classes and experience as the second of two foreign languages he needed for his Linguistics degree (the first being Classical Greek). He calls this a, "hack". He talks about schooling after his undergrad, but doesn't go into what that was. [1] http://www.youtube.com/watch?v=aNAtbYSxzuA http://www.youtube.com/watch?v=aNAtbYSxzuA
- zeckalpha 13y agoHe was doing Linguistics at UC Berkeley, too.
- zeckalpha 13y agoI got mine in Linguistics, so I have no problem with him for his degree, just Perl's "regular" expressions.
- coldtea 13y agoYou know that he didn't say Cox invented regular expressions, but that the Vim implementation might be influenced by Cox's advocacy on the matter. Right?
- AYBABTME 13y agoI believe it's Ken Thompson who first implemented them using a DFA.
- mjn 13y agoGood to see the new regex engine is now shipped by default. It's been in development for quite a long time, held up mostly because of so many edge cases. The initial work was done in a 2008 Summer of Code project: http://code.google.com/p/vim-soc2008-regexp/source/list 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.
- jng 13y agoI think the old engine is still included, and used in the cases where the new one can't do the work.
- imslavko 13y agoI am interested in regexp implementation (high level overview). As far as I understand, it is not possible to come up with state-machine for regex containing "extensions" such as backreference (\1 or \2), it just doesn't fit into "regular languages". At least this is what I learnt from [0]. Does anyone know more details about new regex matcher? (I don't think I will be able to read the code). [0]: http://swtch.com/~rsc/regexp/ http://swtch.com/~rsc/regexp/
- Millennium 13y agoBad form to require someone to install your program just to see your changelog, though. Please put up a page, or put the latest help docs online (the current set is still for 7.3) and link to the relevant section, instead of "see :help version7.4".
- mjhea0 13y agoftp://ftp.vim.org/pub/vim/patches - should be up shortly you can also get it here - https://gist.github.com/mjhea0/6200588 https://gist.github.com/mjhea0/6200588
- farslan 13y agoComplete Changelog ftp://ftp.vim.org/pub/vim/patches/7.3/README (it includes all changes from 7.3 up to 7.4) New patches for 7.4 will be in the patches/7.4 folder.
- dezgeg 13y agoWow. Actual .patch files. In 2013. This is ridiculous.
- mjn 13y agoThey're managed (or can be) using Bram Moolenaar's own system, Aap: http://www.a-a-p.org/ http://www.a-a-p.org/
- nickstinemates 13y agoWhat's ridiculous about it?
- StavrosK 13y agoVery nice! Does anyone remember that nifty syntax highlighting script from a while ago that required a recentish version of Vim? I'll install 7.4 and want to try that out, but I don't remember what it was...
- bpierre 13y agoIt’s not syntax highlighting, but it needs a recent version of Vim: http://valloric.github.io/YouCompleteMe/ http://valloric.github.io/YouCompleteMe/ ?
- StavrosK 13y agoSorry, I meant completion. That's the one, thanks!
- madsravn 13y agoIs it any good? It looks good, but stuff sometimes disappoint.
- ics 13y agoIf you like autocompletion then yes, it's very good. At one point I had issues with startup time that I was pretty sure had been caused by it, but it's highly likely it had more to do with Clang than YCM (I can't remember the outcome fully, since I ended up moving to Emacs shortly after).
- pearjuice 13y agoAnd still no viable competitor to emacs.
- aktau 13y agoAre you kidding me? Emacs makes my head asplode and vim gets me by when I can't or don't want to use sublime. Horses for courses...
- pekk 13y agoWe were talking about text editors, not wonky lisp interpreters.
- platz 13y agodo you customize your emacs keybindings for text editing, or do you use the emacs defaults?
- kseistrup 13y agoIs there a PPA for Ubuntu users (et al.)?
- lcedp 13y agoScript to assemble last vim from source under Debian/Ubuntu: https://gist.github.com/liverlin/5274228 https://gist.github.com/liverlin/5274228
- dasil003 13y agoIt doesn't appear as though MacVim for 10.7 and 10.8 is released yet though the 10.6 is: http://code.google.com/p/macvim/downloads/list http://code.google.com/p/macvim/downloads/list
- telemachos 13y agoThe source is available if you build it yourself: https://github.com/b4winckler/macvim/releases https://github.com/b4winckler/macvim/releases. The binaries should be coming soon.
- tbrock 13y agoI use it every day on 10.8. Use homebrew and have less grey hairs: brew install macvim
- sigzero 13y ago7.4 is still the beta version in homebrew.
- nilsbunger 13y agoLooks updated now! (make sure to do "brew update" first to get updated package list).
- nXqd 13y agothanks for the update :D
- johncoltrane 13y agoIt's up, now.
- eee19 13y agoA bit too late, but just for the sake of completeness: I'm Douglas Drumond, the guy that helps Björn Winckler build MacVim on other versions of OS X. Depending on when (in the day) a new snapshot is released, it can take a few hours for me to get home, build it for 10.7 and 10.8, and send to Björn who then must read my e-mail and upload it to code.google.com. Previously, when github allowed downloads of arbitrary files, I uploaded on my own account and Björn linked to it, so the last step wasn't necessary.
- wubbfindel 13y agoGoing to wait for the update to come via chocolatey: http://chocolatey.org/packages/vim http://chocolatey.org/packages/vim
- unknownian 13y agoHow is Chocolatey? Does it feel Unixy enough for someone moving from Unix to Windows?
- platz 13y agoI think it covers the base case well, but its not as full featured as dkpg. Also it seems like the chocolates repos always a version behind the edge.
- wubbfindel 13y agoI can't say from the perspective of Unix to Windows, I'm the reverse, but I know that since learning to love apt-get (and similar managers), I'm willing to accept chocolatey despite it's weaknesses. 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!
- zhufenggood 13y agoMacVim dont't have lion or moutain lion style native scrollbar still.
- Yoshino 13y agoI turned them off completely. I found that the line numbers and file position in the status line was more than enough to get my bearings, and it looks nicer without the scrollbars. In ~/.gvimrc: " no toolbar set go-=T " no right scrollbar set go-=r " no left scollbar set go-=L
- the_cat_kittles 13y agonice! thank you
- sigzero 13y agoYou can put those on one line...and I do the same. :)
- b3b0p 13y agoI always disable scrollbars in my .vimrc. Fullscreen MacVim is wonderful! Sometimes I open up to 8 windows and jump between them. I found the scrollbars more of a distraction and nuisance than they were helpful.
- gaving 13y agoI love vim, but:- http://www.vim.org/ http://www.vim.org/ http://www.sublimetext.com/ http://www.sublimetext.com/ Which one would you want to use?
- pearjuice 13y agoThe one offering the best product. Or are you saying you are judging by appearance?
- michaelbarton 13y agoI think it's a fair point, judging by appearances may be instinctual if not conscious. The current git website (http://git-scm.com/ http://git-scm.com/) looks the way it does because of an effort to replace the old one (http://web.archive.org/web/20120101013850/http://git-scm.com/ http://web.archive.org/web/20120101013850/http://git-scm.com... and https://github.com/blog/1125-new-git-homepage https://github.com/blog/1125-new-git-homepage).
- Watabou 13y agoYou know, I actually like the old git website. It's less cluttered and looks cleaner. Maybe it's just me? The new git website does look modern but with all the logos and unneeded images, it's sort of disorienting.
- ics 13y agoI completely agree. It's polished, but by no means "homely" if you know what I mean. Usually when I have a question about git I end up on StackOverflow, but once in a while I click a link to git-scm.com and about halfway through finding my answer I start wondering to myself where the "Buy Now" button is.
- digipaper 13y agoThe free one?
- 13y ago
- AlexanderDhoore 13y agoI've been digging deeper and deeper into vimscript and also scripting vim with python. It's so amazing what you can do with just a few lines of hacky vimscript! 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.)
- bosie 13y agoshare the markdown code if you don't mind?
- AlexanderDhoore 13y agoThis is VERY hacky, but that was kind of the point I was making. Hack together what you need! Here you go: http://pastebin.com/sPmPsCgY http://pastebin.com/sPmPsCgY Edit: Safari reloads the existing tab, so set the default browser to Safari if you want that.
- bosie 13y agothat is quite clever. works here too. any idea how you could convince firefox to reload the tab rather than creating a new one?
- mharju 13y agoYou can use AppleScript to accomplish that. See for example https://github.com/mharju/vim-fiddle/blob/master/template/fiddle.vim https://github.com/mharju/vim-fiddle/blob/master/template/fi... for hints on how to do it.
- rcarmo 13y agoI've just updated my unofficial Mac OS X build (featuring alloy's native sidebar with a file tree): https://github.com/rcarmo/macvim/releases/tag/7.4 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-ebd7-11e2-8245-ab6a34c65979.png https://f.cloud.github.com/assets/392683/793013/469e0c62-ebd...
- clumsysmurf 13y agoThe link above should mention this requires 10.8 and above.
- rcarmo 13y agoYeah, that was only in the README. Fixed.
- steve19 13y agoWow! I love that sidebar. Thanks for the build.
- lsiebert 13y agoSo if I previously compiled from source in ubuntu (which I did for YouCompleteMe) can I just recompile and install?
- alexhancock 13y agoSpell checking. Nice! The undo branching feature seems like it could be useful as well.
- reustle 13y agoDoesn't ":set spell" already work?
- johncoltrane 13y agoSpell checking is an old feature.
- gosukiwi 13y agoI installed vim on Ubuntu using apt-get, any tips on how to upgrade it?
- deleted 13y ago[deleted]
- sigzero 13y agoI am glad its Python support is better. I wonder if it would help or hurt if something like Lua came along with it as its 2nd default scripting engine? From what I have read Lua is small, fast and relatively easy to learn.