Vim 7 - the graphical introduction

I am a hardcore Vim user - my 850+ line Vim configuration file says so ;] Vim is out in version 7 and it's really hot stuff that Bram Moolenaar and others have hacked together! Some others have text highlighted the new stuff in Vim 7, but I am going to do it with a little twist... I am going to show you some of the new stuff!

Clicking on the images will load a GreyBox window with an animation of the feature!

The completion menu

There is a really slick new menu for all kind of completion. In this demo I show this menu using Ctrl-N and Ctrl-P completion.

Intelligent completion (OmniCompletion)

There is new intelligent completion for shit loads of languages. It works by using the Ctrl-X Ctrl-O mapping. In this demo I show how it works with HTML. Time will tell how useful this really is, but it is cool - check it out:

Spell checking

Built-in spell checking for about 50 languages (enuf' said), cool stuff:

Tabs

I almost forgot this one... Tabs like one knows them from Firefox:

File browser now syntax highlighted

Just to take some of the new small improvements... the file browser is syntax highlighted! This is a little improvements that I really like:

Vimgrep - built in Grep

This is also a "small thing" that I really like:

More!

There are a lot more stuff and a lot of bug fixes. I hope I have awaken your appetite! Grab a little Vim cookie and welcome to heaven!

On the close line, I really like the highlighting of the current line, you can turn this on by inserting this into your .vimrc:

set cursorline
hi cursorline guibg=#333333 
hi CursorColumn guibg=#333333
VIM Editor 9. May 2006
21 comments so far

Very nice... :-) But as a hard-code Emacs user I must point out that the features you mention have been available in Emacs for ages: we have completion of the current word based on the content of the open buffers (dabbrev-expand), we have a validating XML mode (nxml-mode) that does context sensitive completion (but knows nothing about CSS, though...). The Elisp mode also does context sensitive expansion, spell checking through Flyspell, directory editing through Dired, grep through M-x grep, and one can even do the last trick too: the highlight-current-line minor-mode does what it says it does :-)

But unfortunately I have no fancy animated gifs to show you, so you'll just have to take my word for it :-)

Several of the features I mention above come as various extension packages for Emacs -- I have no idea of how Vim can be extended.

Martin:
Features like spell checking and completion have been there as scripts for long time. A script like vimspell was released back in 2002... The new and hot stuff is that it's built-in Vim. Both spell checking and omni completion is done in a VERY nice way (and one does not have to configure anything before they just work).

Vim can be scripted using its own language, but it can also be scripted using Python (or other scripting languages like Perl).

But you are probably right: As an Emacs user you are absorbed by the dark side. Becoming a Vim Jedi and using the light force has little value for a sith lord like yourself ;-D

Martin,

I used to be an (x)emacs user. Undoubtedly, most, if not all of the functionality exists for emacs, but this post never claim otherwise. It is only about the new features in Vim.

Not trying to start a flame war here, but emacs is an operating system which also happens to be a good editor.

Diwaker

I fear you are misguided, my young apprentice. Emacs was built by RMS himself, giving us all a New Hope! It is the ultimate editor that can be adapted to solve any problem.

And by the way: With Emacs there is little distinguishing between what is built-in and what is extensions --- it is all run by the internal elisp engine. Some basic functions are compiled into Emacs, but most is elisp. That includes stuff like a mail/news reader (Gnus), a webbrowser, etc...

I like Python a lot, and if Emacs were written as an interactive Python interpreter... wow! Even though there are tons of incredible software for Emacs, I think that a Python-based Emacs would have even more software written for it.

Diwaker Gupta: you're perfectly right, the post wasn't about Emacs. But amix knows that I like Emacs, and happened to send me a link, so... :-) Don't worry, I'm sure this will be a friendly flame-war :-)

Martin:
I did a little laugh on this one: "Some basic functions are compiled into Emacs... like a mail/news reader (Gnus), a webbrowser, etc..." Basic functions for an operating system, but not an editor (hehe)

Anyway, I support you on the Python-based Emacs solution. If Emacs was built in Python, then I would probably also use it. It is kind of scary that one needs to know a little (e)Lisp before one can configure anything.
On the side note: Vim's scripting language is very inspired by Python.

Some have asked me how I created the animated gifs:
- I used Snapz Pro X (a screen-capture application for Mac OS X). I saved the animation as an Apple PNG movie.
- After that I loaded the movie inside Adobe Image Ready. Here I optimized the animation with 64 colors, selective color table and with no dither.

That's basically it.

No no, I was talking about basic lisp functions like concat. Not Gnus or the other packages.

The nice thing about putting something like Gnus into Emacs is that you gain all the advantages of Emacs: a unified editing environment with advanced editing such as M-c to capitalize a word, M-q to reflow a paragraph (while keeping > markings correct in email replies), etc.

Whenever I edit something in Firefox or other programs (like this comment...) I loose most of those keybindings. Many programs do support Emacs-like keybindings, though, and that helps somewhat when we Emacs-fans have to venture outside the safe world of our beloved editor :-)

Martin:
Of course, it's pretty nice having one powerful editing for all of the applications, but one pays a price for this. The downside by including everything into Emacs is bloat-ness and something like Gnus can't possibly be as powerful as Thunderbird... You may think otherwise, but seriously, it can't :) I am more into using the best tool for the job, than using an uniform solution that can handle every of my desires.

That said I will probably move into vim+(mutt | pine) combination pretty soon... I know some that have had great success with this combo :-]

Sure Gnus can be as powerful as Thunderbird! :-)

I'm sure Thunderbird is a very good mailreader, and with all the extensions available it will probably be every bit as powerful as Gnus.

The ability to configure things is what makes Gnus and Emacs so powerful: you can spend days exploring the 520 page manual for Gnus. It has endless lists of tips and tricks, and describes all the variables you can fiddle with to get Gnus to do exactly what you want. Some might see so much customizability as a mis-feature, but I think it's cool. And the defaults are mostly sane enough...

When I said powerful I didn't only mean the feature set. Something like a graphical user interface is really important for a mailreader IMO.

A simple question: Can you write HTML mails (WYSIWYG style) in Gnus? This is basically an important feature for a lot of people. You can probably read HTML mail by using a HTML to text converter, but...

Anyway, I think our opinions are rather subjective.

You do know that HTML emails are evil, right?

I think that 99% of all HTML emails I receive are spam mail, which is why my SpamAssassin gives them a +1 penalty score (the mail is considered to be spam if it reaches a score of +5).

So while I don't think I can write HTML mails in Gnus, I don't see this as a loss. I can still read them, though. Most of the time such mails have a text/plain MIME part too (and Gnus of course prefers that), but HTML-only mails are rendered too (with more or less success, of course).

Martin:
HTML emails aren't evil ;) I actually sometime write them in favor for writing a real document. They basically offer better formatting options. Of course, a lot of spammers use them, but HTML mails can be used for non-spamming emails :)

Anyway, for most things I prefer GUI applications with nice icons and a mouse interface. I actually tried mutt+vim today, but Mail.app and Gmail are far more superior than mutt+vim combo.

Sure, you can use HTML in your mails for formatting purposes, but you can just as *easily* format /mails/ like _this_. For *decades* this has been the standard way of adding bold, italic, and unlines.

The advantage is that it's fast, compatible, and safe.

Fast: you don't have to use the mouse and go clickily-click on little icons to toggle, say, bold on and then toggle it off.

Compatible: people using poorer mail readers will still be able to see the markup and will intuitively understand what it means. Not so with the tag soup produced by some HTML editors...

Safe: there is no webbugs (tracking images) in plain text, no JavaScript, no buffer overflows that renders every HTML email into a potential security risk. (Okay, okay... there might be buffer overflows when dealing with plain text too, but that's inherent in any program that deals with user input.)

Ohh well... I really sound like someone who live in the wrong decade, don't I? :-D

You sound as a person that has spent too much time inside Emacs - hehe ;-]

[BTW] Thanks for the nice demos about the new features! :-)

cool demos.
I did put up a round up of new features of vim 7 too, but I really like your gif demos, they get the point across more clearly.
feel free to browse thru my round up.
my review

no gif for tabs?

Hi, so would it take a 850 line config file to actually get things nice looking and in good working order in Vim to make it worth moving away from an Editor such as Textmate?

No to the config file
Many vim users are pretty vanilla about the config

Very nice website. I was looking for an introduction to omni-complete and got this website.

How do I replay the gifs? Reloading that frame doesn't help. Any idea, Amix?

Also, is there a way to automatically use omnicomplete visual studio style where I just have to press open-paren and close-paren or . or ->?

Thanks,

Post a comment
Commenting on this post has expired.
© 2000-2009 amix. Powered by Skeletonz.