Sample .exrc File

The following lines of code are an example of a customized .exrc file:

set nowrapscan                   " Searches don't wrap at end of file
 set wrapmargin=7                 " Wrap text at 7 columns from right margin
 set sections=SeAhBhChDh nomesg   " Set troff macros, disallow message
 map q :w^M:n^M                   " Alias to move to next file
 map v dwElp                      " Move a word
 ab ORA O'Reilly Media, Inc.      " Input shortcut

Tip

The q alias isn’t needed for vim, which has the :wn command. The v alias would hide the vim command v, which enters character-at-a-time visual-mode operation.

Get Linux in a Nutshell, 6th Edition 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.