Problem Using Vim on the Motorola Droid

I use the excellent ConnectBot SSH client on my Motorola Droid to SSH into Linux/Unix boxen. Subsequently, I make the mistake of using Vim. Once I enter insert mode in Vim, I realize that the Droid keyboard (and probably every other smartphone keyboard) doesn’t have any key representing the Escape key (that is used in Vim to exit insert mode). There isn’t even a key, AFAIK, representing Control. After being stumped by this multiple times, I now do the following every time before I start editing with Vim when connected in via my Droid:

:imap qq <Esc>

Note that you have to do this *before* you enter insert mode (remember you want a key-sequence to be able to exit insert mode). Once set, I can enter ‘q’ two times in succession to simulate the Escape key action.

Share

2 thoughts on “Problem Using Vim on the Motorola Droid”

  1. Use the center button on the D-pad 🙂

    Hold it down for ctrl, and double click to escape.

    Also, if you’re using screen the camera shutter button will change between screens. The reason I started using vim over emacs years ago was because I found it much easier to work in a modal editor on my phone (at the time a blackberry).

Leave a Reply

Your email address will not be published. Required fields are marked *