Thursday, July 5, 2007

Beginner's Guide to the Vi editor

The article linked below is a nice introduction to the Vi editor.

People often ask why they have to learn vi, or vim. One important reason is that it is the editor most likely available on any linux or unix system you may have to manage as a sysadmin. Less experienced sysadmins may say that they can just install joe, or pico, or something similar -- until I show them 1200 linux boxes that we have to manage! Anyway, once you have the basics, you can add more knowledge as you go.

First realize that there are two modes - command mode, and editing mode. "i" puts vi into editing mode, and [esc] goes back to command mode.

You can get by with just a few commands at first:
vi file.txt
i (insert -- go into editing mode)
[esc] (move around)
[esc]:wq (save)
[esc]:q! (quit without saving)


read more | digg story

Links:
http://www-acs.ucsd.edu/info/vi_tutorial.php
http://www.viemu.com/vi-vim-cheat-sheet.gif