vi

Introduction

  • vi is short for visual editor. It lets you see what you are editing, unlike the earliest UNIX editor called ed.

  • vi is used to edit text files, including programs (remember LINUX was targeted to programmers!).

  • Like everything else in LINUX, vi is a command. It takes the file to edit as its argument.

    • If the file exists, you will be in vi editing a copy of the file.

    • If the file does not exists, it will be created when you save.

  • In either case, no changes are made until you save them.

  • vi is a very powerful editor that follows the philosophy of LINUX - there are many commands to do specific tasks and you can combine them to do more complicated tasks. Like LINUX, vi is also difficult to learn, but is a very efficient text and code editor once you learn it.
  • Lets look at some details: