vi editing  «Prev  Next»
Lesson 6 Configuring your editing environment
ObjectiveUse the :set command to configure vi.

Configuring editing environment(for vi)

By default, text searches are case sensitive[1]. For example, /tow will match the pattern town but not Town. The ignorecase option causes text searches to see uppercase and lowercase letters as identical. For example, /tow will match town or Town. Most configuration options have a short form. For example, ic is the short form for ignorecase, so you can turn it on like this:
  • :set ic: To turn ignorecase off again and restore vi's default behavior, enter this:
  • :set noic Other useful configuration options include wrapmargin and number.

In addition to defining options, you can also display options in two ways. If you enter :set by itself, vi lists any options that have changed from their default values. To display vi's entire list of options, enter the :set all command.

The following series of images demonstrates the :set command.
Configuration options for vi
1) Start by opening the quartet file in vi.
1) Start by opening the quartet file in vi.

2) Enter the set command to list options that have changed from their defaults
2) Enter the set command to list options that have changed from their defaults, including those that you did not explicitly change within your session.

3) The set command lists three changed options: redraw, showmode and term=vt100.
3) The set command lists three changed options: redraw, showmode and term=vt100. Their default values are noredraw

4) The redraw and term options ensure that vi correctly displays text on your terminal.The redraw and term options ensure that vi correctly displays text on your terminal.
4) The redraw and term options ensure that vi correctly displays text on your terminal. UNIX defines your terminal settings at log in and passes them to vi through the redraw and term options.

5) You can explicitly change options within your version.
5) You can explicitly change options within your version.

6) Later on, you can enter the set command to check your options again.
6) Later on, you can enter the set command to check your options again.

7) The listing now shows the ignorecase option that you turned on.
7) The listing now shows the ignorecase option that you turned on.


vi provides many configuration options that let you change your editing environment. You manage these options by using the :set command, as shown below:
General Form Description Example
:set option Turn on the option :set ignorecase
:set nooption Turn off the option :set noignorecase
:set option=value Assign value to the option :set wrapmargin=10

Customizing vi
  1. set: List configuration options that have changed.
  2. set all: List every configuration option.
  3. set ic: Cause searches to treat uppercase and lowercase letters the same.
  4. set noic: Cause searches to treat uppercase and lowercase letters differently.
  5. map: List your command shortcuts.
  6. ab: List your shortcuts for adding text.

In the next lesson, you will learn how to store abbreviations, maps, and configuration options to make them permanent.

[1]case sensitive: When a text search is case sensitive, the search treats uppercase and lowercase letters differently. If uppercase and lowercase letters are treated the same way, then the search is considered to be case in-sensitive.

SEMrush Software 6 SEMrush Banner 6