Dr. StrangeVim, or How I Learned to Stop Worrying and Love Vi
p. It all started with a @ssh@ session on the University web server. I was thinking of implementing some clever thing as a cron job, and wanted to see what the crontab for our username currently looked like. As it turned out, there wasn’t a user crontab, so I was greeted with the dreaded empty screen, and a sinister column of tildes down the left hand side. This could only mean one thing—the default editor was set as [“vi”:http://www.thomer.com/vi/vi.html]! Much wailing, gnashing of teeth and cursing followed, as I had only very briefly used vi once before. After dredging up what I could remember of how it worked from the depths of my brain, I spent a great deal of time stabbing the ESC key, typing ‘wq’ and getting beeped at before I gave in and opened a ‘man’ page to find out what I should really be doing. All of this activity was just to quit the editor.
p. For those of you who haven’t yet experienced the Joy of Vi, let me give you a little background. Vi differs from most other editors as it is a [“modal editor(Vi, a modal editor)”:http://www.tchpc.tcd.ie/Support/Training/User_Course/text-editor-introduction-vimodal.html]. This means that you can’t just start typing in the window. If you do, vi beeps at you but doesn’t do what you actually wanted it to, which was to transfer your typed text to the screen. You have to enter ‘insert’ mode by typing @i@ in order to type, and then hit @ESC@ to leave the mode and enter commands (like quit). If that all sounds confusing—believe me, it is.
