[Chapter 30] 30.18 Setting vi Options Automatically for Individual Files
Author: Jerry Peek, Tim O'Reilly & Mike Loukides
Date: 1998-08-04T21:45:32Z

#

| Chapter 30 vi Tips and Tricks |

## 30.18 Setting vi Options Automatically for Individual Files

The .exrc file (4.9) can set vi options for all files - or for files in a certain directory (30.6). The articles listed below show other ways to set your vi setup.

- A controversial feature because of security problems, modelines (30.19) are still handy if you use them carefully. They let you store setup commands for each file, in the file itself.

- Instead of modelines, you can make separate setup files for each file you want to edit. These don't have the security problems of modelines because you can make the setup files read-only. See article 30.21.

- Article 30.20 lets you choose any one of a number of setups by typing a setup-choosing command from the shell prompt. All vi commands you start afterwards will use that setup. You can start a new setup any time.

- JP

30.17 Capitalizing Every Word on a Line |  | 30.19 Modelines: Bug or Feature?