vi is short for visual editor. It lets you see what you are editing, unlike
the earliest UNIX editor called ed.
The newer version of the command is actually vim, but many people still say "vi". It stand for "vi-improved".
When you run the vi command, you are most likely running vim.
vi is used to edit text files, including programs (remember Unix 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.