Prof. Dr. Barne Kleinen

Website of Prof. Dr. Barne Kleinen, Professor for Media Informatics (Bachelor/Master) at HTW Berlin

VI

Material in   Courses: Info2 Networks   Tags: Vi   Tools: Vi

VI

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 v k >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 cursor
      • a insert after cursor
      • o insert in new line after this one
      • O insert in new line before this one