Monday, September 3, 2007

vi Command Line

If you ever spent any quality time in the vi editor, you can't shake off at least some of the keyboard stuff. Of course, vi isn't the friendliest editor in the world (in fact, may in fact be the least tameable). But it is probably the most efficient mechanism for editing single lines of text.

Which brings me to this tip: you can turn on vi keyboard shortcuts for your terminal (either Terminal or iTerm) by adding the following line to your ~/.profile file:
set -o vi
Now, you can happily use that vi knowledge that you can't get rid of otherwise. If you're muscles  can't remember the keystrokes, you can refresh your memory here.

3 comments:

objo said...

Yes, but if you stick with the defaults, you can use the emacs shortcuts that should be in programmed into your hands:

Ctl+A - Beginning of Line
Ctl+E - End of line
Ctl+K - Kill rest of line
etc...

-Joe

Sonny Gill said...

Hi,

I recently made the switch to Mac, and have been reading this blog.

I am looking at collecting all my Mac tips, tricks and reviews etc. as well.

Neal mentions in one of his early posts, that anyone is welcome to join.
Does the offer still stand? How can I join the blog?

Thanks.

http://sonnygill.blogspot.com

Neal Ford said...

send me an email with your address and I'll add you.