A month on the command line, Day 5: The esc clause
The hardest thing for me in vi and Vim is going from insert mode to command mode via the esc key. It's so far away.
While vi is good about using the home row of keys to navigate while in command mode, going into that mode in the first place requires me to take my left-hand fingers off the keyboard to hit esc. Getting back to insert mode with a or i is extremely easy, but esc remains so far away.
I wonder if any enterprising geek type ever came up with an esc footswitch to make getting into command mode possible without the fingers leaving the home row?
I guess hitting the esc key is no worse than using the arrow keys or the mouse, so I'm goint to stop bitching for now and get these Vim-created files on the blog.




One way to get around this is by using C-[, aka ctrl-[.
You could also use the function :map to remap keys in vim. A common remapping is to map ESC to that useless key to the left of the homerow, the capslock key.
I've found this thread quite useful when figuring out how to fix the esc key:
http://vim.sourceforge.net/tips/tip.php?tip_id=285
hth,
ABCC
I've used vim a lot and have never used Esc to go from insert to command mode, every shell/vim version I've used allows ^c (ctrl+c) to get out of insert mode - and since my most-left finger is always over ctrl/shift, and c is near-by it's far easier than using Esc.
The only time I ever had a problem with it is once using vim via netcat, forgetting that ^c would kill the local nc process and not be sent to vim..
Ctrl-C -- that's good. I've got esc on the brain.
I've been using so many editors over the past week -- joe and nano among them, but still, there's something about vi -- unlocking the secrets of moving around quickly and streamlining the editing process makes writing with a computer so much more than the usual word processing program and its glorified-typewriter way of dealing with text.
After a very bad early experience with Vi some years ago which discouraged me
from trying it again, I decided to learn it a few years back just to find out
what Vi lovers found so captivating.
I now like Vi (or rather, Vim) very much and use it quite often (e.g., for
editing this comment), even though I still turn to Emacs for more serious
writing.
Once you've used Vim for a few days you'll start to issue the commands
intuitively, without having to make an effort to remember them. That's when
working with Vi becomes efficient. There's a book on Vim available in PDF from
the Vim Web site that may be useful for a more detailed treatment, though much
of it has now found its way into the official manual.
Once you're used to editing in Vim and writing HTML, you can learn a little
LaTeX and run pdflatex to get a beautifully typeset PDF file, which can be
printed via lp (assuming that you have Cups configured). The Cups Web
interface works well with console-based browsers.
I well remember learning LaTeX and saying goodbye to word processors, and
that was in 1998. I've never regretted it.