E-Scribe News : a programmer’s blog

About Me

PBX I'm Paul Bissex, and e-scribe.com is my consulting business. I build web applications using open source software, especially Django. I teach photographers web design and professional skills. In the '90s I did graphic design for newspapers and magazines. Then I wrote technology commentary and reviews for Wired, Salon.com, Chicago Tribune, and lots of little places you've never heard of. Feel free to email me.

Book

Python Web Development with Django I'm co-author of "Python Web Development with Django", an excellent guide to my favorite web framework. Its strong points include an introduction to Python, and better coverage of Django 1.0 than nearly anybody else. Published by Addison-Wesley, it is available from Amazon and your favorite technical bookstore as well.

Colophon

Built using Django, served by Apache and mod_wsgi. The database is SQLite. The operating system is FreeBSD, on a VPS hosted at Johncompanies.com. Comment-spam protection by Akismet. Vintage topo imagery from the Maptech archive. The markup engine is Markdown.

Pile o'Tags

Stuff I Use

Akismet, del.icio.us, Django, dpaste.com, Emacs, FreeBSD, Freenode, jQuery, LaunchBar, MacPorts, Markdown, Mercurial, OS X, Postfix, Python, SQLite, Subversion, TextMate, Trac, Ubuntu Linux, wmii

Spam Report

At least 67572 pieces of comment spam killed since January 2008, mostly via Akismet.

How to use vim, really

I'm an Emacs man myself. I've never really used vim at all, and I use vi only for crontabs and commit messages. I've always grasped in the abstract the potential advantages of its modal editing, but that's as far as it ever went.

Jonathan McPherson's site has a great introduction to using vim that opened my eyes. His explanations of vim's features offer just the right amount of detail. Most importantly he explains why particular commands are a good idea. Not explaining that is one of the classic failings of manpages -- and I suspect that the vi manpage is the beginning and end of many users' attempts to learn it. They learn about insert mode, command mode, loading and saving files, and that's about it. Luckily, those just happen to be the prerequisites for McPherson's tutorial. Clever fellow.

His most important bit of general advice:

In general, you want to spend as little of your time in vim's insert mode as possible, because in that mode it acts like a dumb editor. This is why most vim novices spend so much time in insert mode -- it makes vim easy to use. But vim's real power lies in command mode! You'll find that the better you know vim, the less time you will spend in insert mode.

I'll never be a full convert (I've sold my soul to TextMate, and in the shell I'm happy with Emacs), but I'm definitely going to pull up that page the next time I need to use vi.

:wq

Monday, January 9th, 2006
+
4 comments

Comment from Robert Loomans , later that day

If you want to use emacs for commit messages and crontab editing, then set the EDITOR environment variable.

For bash:

export EDITOR=emacs

and add it toyour shell startup scripts.

For bash:

echo 'export EDITOR=emacs' >>.bash_profile

Comment from Paul , later that day

Oh, I know -- but thanks!

I've often left my $EDITOR as vi just to make sure I am forced to use it once in a while -- figuring that some dark day I'd be on a box with no Emacs and would be mighty embarassed not to remember how to make simple edits.

Comment from Faried Nawaz , 1 week later

Even better -- set EDITOR and VISUAL to "emacsclient", and start gnuserv inside a running emacs process.

Comment from Kamen , 3 years later

Yeah, I know Textmate takes many souls with it's pretty GUI, but hey, if you force yourself to use vim a while, You'll find many ways to make it beautiful to you.

That and you'll be ruined forever because whenever you go into any other editor you'll be frustrated that ESC doesn't respond.

Post a comment

Thanks for reading! Please note: Your comment will not appear until approved, which may take a few hours or more. Spammers will be torpedoed.


(Will not be shared)

(Optional)