If you enjoyed this site, please consider donating $3. Any amount is appreciated. Thanks!

Emergency vi

Xah Lee, 2005-10

vi is one of unix's fuckup. Sometimes in a emergency situation you are forced to deal with vi, and fucking unix admins refuse to install emacs. Here's your help:

• Use arrow keys to move the cursor.

To insert text, move your cursor to the right place, then press i, then type your text. After you are done, type Esc to exit the insertion mode.

To delete text, move cursor to the right place and press x. (if x is inserted, that means you forgot to exit the insert mode. Type Esc to exit insertion mode. Type u to undo.)

When something doesn't work, or if you accidentally typed something and have no idea what is going on, try press Esc. Then, type u for undo. If a cat jumped onto your keyboard and you cannot exit vi, type the shell suspend command Ctrl+z, which should get you back on the unix command prompt, then you can kill. (by first find out the pid by “ps auwwx | grep vi”, then “kill -9 ‹pid›”).

Congratulation! You've learned emergency vi.

It may be confusing, but with the above you can edit any text files with vi.


Related essays:

2005-10
© 2005 by Xah Lee.