Vi, short for “visual editor,” is a screen-oriented text editor originally developed for Unix systems. It offers both command mode and insert mode for editing text efficiently.
vi
is a text editor that is commonly found on Unix/Linux systems. It is known for its powerful and versatile capabilities, making it a preferred choice for many users.- On some systems,
vi
is linked tovim
(Vi Improved), and both are mentioned asvim(1)
andvi(1)
. The(1)
refers to the section number of the man page where information about the command can be found. - Setting the
VISUAL
andEDITOR
environment variables can be useful to specify the default editor to be used by other programs. For example:
export VISUAL=vim
export EDITOR=vim
vimtutor
is a helpful interactive tutorial for learning the basics of thevim
editor. Runningvimtutor
from the command line launches a guided lesson to familiarize users with various commands and features ofvim
. It's an excellent resource for those new tovim
.
Basic vi Commands:
1. Entering Vi:
- To start Vi, open a terminal and type
vi
followed by the name of the file you want to edit.
vi filename.txt