PREV Emacs Preliminaries UP Overview NEXT States in Viper

1.2: Loading Viper

The most common way to load it automatically is to include the following lines (in the given order!):

(setq viper-mode t)
(require 'viper)

in your `~/.emacs' file. The `.emacs' file is placed in your home directory and it is be executed every time you invoke Emacs. This is the place where all general Emacs customization takes place. Beginning with version 20.0, Emacsen have an interactive interface, which simplifies the job of customization significantly.

Viper also uses the file `~/.viper' for Viper-specific customization. If you wish to be in Vi command state whenever this is deemed appropriate by the author, you can include the following line in your `.viper':

(setq viper-always t)

(See Vi State, for the explanation of Vi command state.)

The location of Viper customization file can be changed by setting the variable viper-custom-file-name in `.emacs' prior to loading Viper.

Once invoked, Viper will arrange to bring up Emacs buffers in Vi state whenever this makes sense. See Packages that Change Keymaps, to find out when forcing Vi command state on a buffer may be counter-productive.

Even if your `.emacs' and `.viper' files do not contain any of the above lines, you can still load Viper and enter Vi command state by typing the following from within Emacs:

M-x viper-mode

When Emacs first comes up, if you have not specified a file on the command line, it will show the `*scratch*' buffer, in the `Lisp Interaction' mode. After you invoke Viper, you can start editing files by using :e, :vi, or v commands. (See File and Buffer Handling, for more information on v and other new commands that, in many cases, are more convenient than :e, :vi, and similar old-style Vi commands.)

Finally, if at some point you would want to get de-Viperize your running copy of Emacs after Viper has been loaded, the command M-x viper-go-away will do it for you. The function toggle-viper-mode toggles Viperization of Emacs on and off.

PREV Emacs Preliminaries UP Overview NEXT States in Viper