Basic Linux Tutorial
Computer Tutorial

Configuring Vi Options



Configuring Vi Options

You can customize vi according to your requirements using vi environment options. Each option can be set in vi with the :set option command, where the word option is replaced with some valid option name. Options can also be unset using the same command and by adding no before the option name, like :set nooption.

Command Effect
:set number Sets line number in front of each line in Vi
:set all Lists all available options
:set autoindent The next line is indented the same number of character as the current line
:set readonly Sets the current file as read-only. No change is saved
:set wrapmargin = n Sets the right wrap margin equal to n. If we are using 80-column display and the wrap margin is set to 6, every line will be wrapped to the next line after 74 characters
:set showmode Shows the user when the user is in "insert mode," "replace one character mode," or "replace mode"