Changing vi Environment Settings

The vi editor has many environment settings. These can be used to customize your editing sessions to meet your particular needs and habits. One of the more popular options, especially to novice vi users, is the showmode option. When set, it displays a small message on the bottom of your screen to remind you when you are in insert mode. This eliminates a lot of the confusion and hesitation experienced by neophyte vi users.

The following example demonstrates the effect of using the showmode option within the vi editor:

$ vi junk

stuff
in the
junk file.

~
~
(...)
:set showmode

Because showmode is set, after entering insert mode, the screen looks like this:

stuff
in the
junk file.

~
~
(...)
--
					INSERT
					--
				

When in ...

Get Korn Shell Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.