Tuesday, January 20, 2009

A Moment of Zen: The UNIX VI Text Editor

A Moment of Zen - The UNIX VI Text Editor

There has never been a text editor that has allowed me to type as fast and as fluidly as the UNIX VI text editor (VI iMproved to be exact). Above is a screenshot of VIM running from my Mac Pro Terminal. In addition, I also have MacVim installed (The "GUI" version) and VIM is also available on just about every single UNIX distribution out there (Yes, there are windows version too! Check out the VIM site).

I shy away from the GUI version because VIM is ultimately a command line editor and also because its extremely slow and cumbersome to try get a GUI to work over SSH. VIM is also the main editor I use in the UW CSE labs by SSH'ing to the UNIX servers (even when I use the windows machines).

VIM is probably the most important piece of UNIX heritage that I've acquired out of CSE 303. Actually, the editor of choice in that class is GNU Emacs but I never liked the idea of Ctrl-this and Ctrl-that. In VIM, I can just execute command after command without stopping, and I'm just scratching the surface of its powerful modal command chaining capabilities. But of course, this power comes with a huge learning curve.

Yet, that doesn't really bother me, because, here I am, just barely 1-2weeks or so after picking up VIM, and I'm already able to edit and code at speeds I never thought possible. But, it's not the speed factor that draws me to VIM. Rather, it is how fluid it is regardless of how fast you type. Your fingers don't even have to leave the keyboard and you can already have a program written, compiled, and backed up through the use of the in-editor shell command execution.

0 comments: