VI
Material in Courses: Info2 Networks Tags: Vi Tools: ViVI
You should learn a couple of vi commands to survive, as vi is available on most *nix computers.
The absolute minimum
There are two modes in vi: normal and insert. You need to know which mode you are in, as different commands are available. (Why this may be problematic has been discussed thoroughly in the UX field)
- Normal Mode:
- vi starts there
- get there with
ESC - start command with
: :wwrite (save) file:qquit (without save, won’t quit if there are changes):wqquit and save:q!quit without save no matter what- <
h^jvk>lthe keys under your right hand double as cursor keys; this makes editing fast!
- Insert Mode:
- type to insert text
- get there with any insert command, eg
iinsert before cursorainsert after cursoroinsert in new line after this oneOinsert in new line before this one
