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
:
:w
write (save) file:q
quit (without save, won’t quit if there are changes):wq
quit and save:q!
quit without save no matter what- <
h
^j
vk
>l
the 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
i
insert before cursora
insert after cursoro
insert in new line after this oneO
insert in new line before this one