- On startup 'vi' searches for the environment variable EXINIT, it contains the location (or NOT) of a file containing configuration commands.
- If EXINIT is not defined 'vi' looks for a .exrc file in the HOME directory and uses configuration commands in it.
- If no ~/.exrc file 'vi' looks in the current directory.
The .exrc file can contain comments, 'ex' commands (e.g. :set showmode), map commands and macro definitions. Map commands help to customize the vi editor redefining keys when in command mode.
VI has two operating modes:
- Command mode
allows for navigation and command execution
all commands, while in command mode, start with ':'
- Insert mode
to enter insert mode use an insert command - i, I, o, O, a, A, s, S, cc, C
ESC key exits from insert mode back into command mode