Viper Is a Package for Emacs Rebels: 1. Overview of Viper

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# 1. Overview of Viper

Viper is a Vi emulation on top of Emacs. At the same time, Viper provides a virtually unrestricted access to Emacs facilities. Perfect compatibility with Vi is possible but not desirable. This chapter tells you about the Emacs ideas that you should know about, how to use Viper within Emacs and some incompatibilities.

This manual is written with the assumption that you are an experienced Vi user who wants to switch to Emacs while retaining the ability to edit files Vi style. Incredible as it might seem, there are experienced Emacs users who use Viper as a backdoor into the superior (as every Vi user already knows) world of Vi! These users are well familiar with Emacs bindings and prefer them in some cases, especially in the Vi Insert state. John Hawkins <jshawkin@eecs.umich.edu> has provided a set of customizations, which enables additional Emacs bindings under Viper. These customizations can be included in your ‘`~/.viper`’ file and are found at the following URL: ‘`http://www.eecs.umich.edu/~jshawkin/viper-sample`’.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 1.1 Emacs Preliminaries

Emacs can edit several files at once. A file in Emacs is placed in a buffer that usually has the same name as the file. Buffers are also used for other purposes, such as shell interfaces, directory editing, etc. See (emacs)Dired section ‘Directory Editor’ in The Gnu Emacs Manual, for an example.

A buffer has a distinguished position called the point. A point is always between 2 characters, and is looking at the right hand character. The cursor is positioned on the right hand character. Thus, when the point is looking at the end-of-line, the cursor is on the end-of-line character, i.e. beyond the last character on the line. This is the default Emacs behavior.

The default settings of Viper try to mimic the behavior of Vi, preventing the cursor from going beyond the last character on the line. By using Emacs commands directly (such as those bound to arrow keys), it is possible to get the cursor beyond the end-of-line. However, this won’t (or shouldn’t) happen if you restrict yourself to standard Vi keys, unless you modify the default editing style. See section Customization.

In addition to the point, there is another distinguished buffer position called the mark. See (emacs)Mark section ‘Mark’ in The GNU Emacs manual, for more info on the mark. The text between the point and the mark is called the region of the buffer. For the Viper user, this simply means that in addition to the Vi textmarkers a–z, there is another marker called mark. This is similar to the unnamed Vi marker used by the jump commands ```` and `''`, which move the cursor to the position of the last absolute jump. Viper provides access to the region in most text manipulation commands as `r` and `R` suffix to commands that operate on text regions, e.g., `dr` to delete region, etc.

Furthermore, Viper lets Ex-style commands to work on the current region. This is done by typing a digit argument before `:`. For instance, typing `1:` will propmt you with something like :123,135, assuming that the current region starts at line 123 and ends at line 135. There is no need to type the line numbers, since Viper inserts them automatically in front of the Ex command.

See section Basics, for more info.

Emacs divides the screen into tiled windows. You can see the contents of a buffer through the window associated with the buffer. The cursor of the screen is positioned on the character after point. Every window has a mode line that displays information about the buffer. You can change the format of the mode line, but normally if you see ‘`**`’ at the beginning of a mode line it means that the buffer is modified. If you write out the contents of a buffer to a file, then the buffer will become not modified. Also if you see ‘`%%`’ at the beginning of the mode line, it means that the file associated with the buffer is write protected. The mode line will also show the buffer name and current major and minor modes (see below). A special buffer called Minibuffer is displayed as the last line in a Minibuffer window. The Minibuffer window is used for command input output. Viper uses Minibuffer window for `/` and `:` commands.

An Emacs buffer can have a major mode that customizes Emacs for editing text of a particular sort by changing the functionality of the keys. Keys are defined using a keymap that records the bindings between keystrokes and functions. The global keymap is common to all the buffers. Additionally, each buffer has its local keymap that determines the mode of the buffer. If a function is bound to some key in the local keymap then that function will be executed when you type the key. If no function is bound to a key in the local map, however, the function bound to the key in the global map will be executed. See Major Modes: (emacs)Major Modes section ‘Major Modes’ in The GNU Emacs Manual, for more information.

A buffer can also have a minor mode. Minor modes are options that you can use or not. A buffer in `text-mode` can have `auto-fill-mode` as minor mode, which can be turned off or on at any time. In Emacs, a minor mode may have it own keymap, which overrides the local keymap when the minor mode is turned on. For more information, see Minor Modes: (emacs)Minor Modes section ‘Minor Modes’ in The GNU Emacs Manual

Viper is implemented as a collection of minor modes. Different minor modes are involved when Viper emulates Vi command mode, Vi insert mode, etc. You can also turn Viper on and off at any time while in Vi command mode. See section States in Viper, for more information.

Emacs uses Control and Meta modifiers. These are denoted as C and M, e.g. `^Z` as `C-z` and `Meta-x` as `M-x`. The Meta key is usually located on each side of the Space bar; it is used in a manner similar to the Control key, e.g., `M-x` means typing `x` while holding the Meta key down. For keyboards that do not have a Meta key, <ESC> is used as Meta. Thus `M-x` is typed as `<ESC> x`. Viper uses <ESC> to switch from Insert state to Vi state. Therefore Viper defines `C-\` as its Meta key in Vi state. See section Vi State, for more info.

Emacs is structured as a lisp interpreter around a C core. Emacs keys cause lisp functions to be called. It is possible to call these functions directly, by typing `M-x function-name`.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 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. The location of Viper customization file can be changed by setting the variable `viper-custom-file-name` in ‘`.emacs`’ prior to loading Viper.

The latest versions of Emacs have an interactive customization facility, which allows you to (mostly) bypass the use of the ‘`.emacs`’ and ‘`.viper`’ files. You can reach this customization facility from within Viper’s VI state by executing the Ex command `:customize`.

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

Even if your ‘`.emacs`’ file does not invoke Viper automatically, you can still load Viper and enter the 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 section 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 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.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 1.3 States in Viper

Viper has four states, Emacs, Vi, Insert, and Replace.

‘`Emacs state`’

  This is the state plain vanilla Emacs is normally in. After you have loaded Viper, `C-z` will normally take you to Vi command state. Another `C-z` will take you back to Emacs state. This toggle key can be changed, see section Customization You can also type `M-x viper-mode` to change to Vi state.

  For users who chose to set their user level to 1 at Viper setup time, switching to Emacs state is deliberately made harder in order to not confuse the novice user. In this case, `C-z` will either iconify Emacs (if Emacs runs as an application under X) or it will stop Emacs (if Emacs runs on a dumb terminal or in an Xterm window).

‘`Vi state`’

  This is the Vi command mode. Any of the Vi commands, such as `i, o, a`, …, will take you to Insert state. All Vi commands may be used in this mode. Most Ex commands can also be used. For a full list of Ex commands supported by Viper, type `:` and then <TAB>. To get help on any issue, including the Ex commands, type `:help`. This will invoke Viper Info (if it is installed). Then typing `i` will prompt you for a topic to search in the index. Note: to search for Ex commands in the index, you should start them with a `:`, e.g., `:WW`.

  In Viper, Ex commands can be made to work on the current Emacs region. This is done by typing a digit argument before `:`. For instance, typing `1:` will propmt you with something like :123,135, assuming that the current region starts at line 123 and ends at line 135. There is no need to type the line numbers, since Viper inserts them automatically in front of the Ex command.

‘`Insert state`’

  Insert state is the Vi insertion mode. <ESC> will take you back to Vi state. Insert state editing can be done, including auto-indentation. By default, Viper disables Emacs key bindings in Insert state.

‘`Replace state`’

  Commands like `cw` invoke the Replace state. When you cross the boundary of a replacement region (usually designated via a ‘`$`’ sign), it will automatically change to Insert state. You do not have to worry about it. The key bindings remain practically the same as in Insert state. If you type <ESC>, Viper will switch to Vi command mode, terminating the replacement state.

The modes are indicated on the mode line as <E>, <I>, <V>, and <R>, so that the multiple modes do not confuse you. Most of your editing can be done in Vi and Insert states. Viper will try to make all new buffers be in Vi state, but sometimes they may come up in Emacs state. `C-z` will take you to Vi state in such a case. In some major modes, like Dired, Info, Gnus, etc., you should not switch to Vi state (and Viper will not attempt to do so) because these modes are not intended for text editing and many of the Vi keys have special meaning there. If you plan to read news, browse directories, read mail, etc., from Emacs (which you should start doing soon!), you should learn about the meaning of the various keys in those special modes (typing `C-h m` in a buffer provides help with key bindings for the major mode of that buffer).

If you switch to Vi in Dired or similar modes—no harm is done. It is just that the special key bindings provided by those modes will be temporarily overshadowed by Viper’s bindings. Switching back to Viper’s Emacs state will revive the environment provided by the current major mode.

States in Viper are orthogonal to Emacs major modes, such as C mode or Dired mode. You can turn Viper on and off for any Emacs state. When Viper is turned on, Vi state can be used to move around. In Insert state, the bindings for these modes can be accessed. For beginners (users at Viper levels 1 and 2), these bindings are suppressed in Insert state, so that new users are not confused by the Emacs states. Note that unless you allow Emacs bindings in Insert state, you cannot do many interesting things, like language sensitive editing. For the novice user (at Viper level 1), all major mode bindings are turned off in Vi state as well. This includes the bindings for key sequences that start with `C-c`, which practically means that all major mode bindings are unsupported. See section Customization, to find out how to allow Emacs keys in Insert state.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 1.3.1 Emacs State

You will be in this mode only by accident (hopefully). This is the state Emacs is normally in (imagine!!). Now leave it as soon as possible by typing `C-z`. Then you will be in Vi state (sigh of relief) :-).

Emacs state is actually a Viperism to denote all the major and minor modes (see section Emacs Preliminaries) other than Viper that Emacs can be in. Emacs can have several modes, such as C mode for editing C programs, LaTeX mode for editing LaTeX documents, Dired for directory editing, etc. These are major modes, each with a different set of key-bindings. Viper states are orthogonal to these Emacs major modes. The presence of these language sensitive and other modes is a major win over Vi. See section Improvements over Vi, for more.

The bindings for these modes can be made available in the Viper Insert state as well as in Emacs state. Unless you specify your user level as 1 (a novice), all major mode key sequences that start with `C-x` and `C-c` are also available in Vi state. This is important because major modes designed for editing files, such as cc-mode or latex-mode, use key sequences that begin with `C-x` and `C-c`.

There is also a key that lets you temporarily escape to Vi command state from Emacs or Insert states: typing `C-c \` will let you execute a single Vi command while staying in Viper’s Emacs or Insert state. In Insert state, the same can also be achieved by typing `C-z`.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 1.3.2 Vi State

This is the Vi command mode. When Viper is in Vi state, you will see the sign <V> in the mode line. Most keys will work as in Vi. The notable exceptions are:

`C-x`

  `C-x` is used to invoke Emacs commands, mainly those that do window management. `C-x 2` will split a window, `C-x 0` will close a window. `C-x 1` will close all other windows. `C-xb` is used to switch buffers in a window, and `C-xo` to move through windows. These are about the only necessary keystrokes. For the rest, see the GNU Emacs Manual.

`C-c`

  For user levels 2 and higher, this key serves as a prefix key for the key sequences used by various major modes. For users at Viper level 1, `C-c` simply beeps.

`C-g and C-]`

  These are the Emacs ‘`quit`’ keys. There will be cases where you will have to use `C-g` to quit. Similarly, `C-]` is used to exit ‘`Recursive Edits`’ in Emacs for which there is no comparable Vi functionality and no key-binding. Recursive edits are indicated by ‘`[]`’ brackets framing the modes on the mode line. See Recursive Edit: (emacs)Recursive Edit section ‘Recursive Edit’ in The GNU Emacs Manual. At user level 1, `C-g` is bound to `viper-info-on-file` function instead.

`C-\`

  Viper uses <ESC> as a switch between Insert and Vi states. Emacs uses <ESC> for Meta. The Meta key is very important in Emacs since many functions are accessible only via that key as `M-x function-name`. Therefore, we need to simulate it somehow. In Viper’s Vi, Insert, and Replace states, the meta key is set to be `C-\`. Thus, to get `M-x`, you should type `C-\ x` (if the keyboard has no Meta key, which is rare these days). This works both in the Vi command state and in the Insert and Replace states. In Vi command state, you can also use `\ <ESC>` as the meta key.

  Note: Emacs binds `C-\` to a function that offers to change the keyboard input method in the multilingual environment. Viper overrides this binding. However, it is still possible to switch the input method by typing `\ C-\` in the Vi command state and `C-z \ C-\` in the Insert state. Or you can use the MULE menu in the menubar.

Other differences are mostly improvements. The ones you should know about are:

‘`Undo`’

  `u` will undo. Undo can be repeated by the `.` key. Undo itself can be undone. Another `u` will change the direction. The presence of repeatable undo means that `U`, undoing lines, is not very important. Therefore, `U` also calls `viper-undo`.

‘`Counts`’

  Most commands, `~`, `[[`, `p`, `/`, …, etc., take counts.

‘`Regexps`’

  Viper uses Emacs Regular Expressions for searches. These are a superset of Vi regular expressions, excepting the change-of-case escapes ‘`\u`’, ‘`\L`’, …, etc. See (emacs)Regular Expressions section ‘Regular Expressions’ in The GNU Emacs Manual, for details. Files specified to `:e` use `csh` regular expressions (globbing, wildcards, what have you). However, the function `viper-toggle-search-style`, bound to `C-c /`, lets the user switch from search with regular expressions to plain vanilla search and vice versa. It also lets one switch from case-sensitive search to case-insensitive and back. See section Viper Specials, for more details.

‘`Ex commands`’

  The current working directory of a buffer is automatically inserted in the minibuffer if you type `:e` then space. Absolute filenames are required less often in Viper. For file names, Emacs uses a convention that is slightly different from other programs. It is designed to minimize the need for deleting file names that Emacs provides in its prompts. (This is usually convenient, but occasionally the prompt may suggest a wrong file name for you.) If you see a prompt `/usr/foo/` and you wish to edit the file `~/.viper`, you don’t have to erase the prompt. Instead, simply continue typing what you need. Emacs will interpret `/usr/foo/~/.viper` correctly. Similarly, if the prompt is `~/foo/` and you need to get to `/bar/file`, keep typing. Emacs interprets `~/foo//bar/` as `/bar/file`, since when it sees ‘`//`’, it understands that `~/foo/` is to be discarded.

  The command `:cd` will change the default directory for the current buffer. The command `:e` will interpret the filename argument in `csh`. See section Customization, if you want to change the default shell. The command `:next` takes counts from `:args`, so that `:rew` is obsolete. Also, `:args` will show only the invisible files (i.e., those that are not currently seen in Emacs windows).

  When applicable, Ex commands support file completion and history. This means that by typing a partial file name and then <TAB>, Emacs will try to complete the name or it will offer a menu of possible completions. This works similarly to Tcsh and extends the behavior of Csh. While Emacs is waiting for a file name, you can type `M-p` to get the previous file name you typed. Repeatedly typing `M-p` and `M-n` will let you browse through the file history.

  Like file names, partially typed Ex commands can be completed by typing <TAB>, and Viper keeps the history of Ex commands. After typing `:`, you can browse through the previously entered Ex commands by typing `M-p` and `M-n`. Viper tries to rationalize when it puts Ex commands on the history list. For instance, if you typed `:w! foo`, only `:w!` will be placed on the history list. This is because the last history element is the default that can be invoked simply by typing `: <RET>`. If `:w! foo` were placed on the list, it would be all to easy to override valuable data in another file. Reconstructing the full command, `:w! foo`, from the history is still not that hard, since Viper has a separate history for file names. By typing `: M-p`, you will get `:w!` in the Minibuffer. Then, repeated `M-p` will get you through the file history, inserting one file name after another.

  In contrast to `:w! foo`, if the command were `:r foo`, the entire command will appear in the history list. This is because having `:r` alone as a default is meaningless, since this command requires a file argument.

As Vi, Viper’s destructive commands can be re-executed by typing ‘`.`’. However, in addition, Viper keeps track of the history of such commands. This history can be perused by typing `C-c M-p` and `C-c M-n`. Having found the appropriate command, it can be then executed by typing ‘`.`’. See section Improvements over Vi, for more information.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 1.3.3 Insert State

To avoid confusing the beginner (at Viper level 1 and 2), Viper makes only the standard Vi keys available in Insert state. The implication is that Emacs major modes cannot be used in Insert state. It is strongly recommended that as soon as you are comfortable, make the Emacs state bindings visible (by changing your user level to 3 or higher). See section Customization, to see how to do this.

Once this is done, it is possible to do quite a bit of editing in Insert state. For instance, Emacs has a yank command, `C-y`, which is similar to Vi’s `p`. However, unlike `p`, `C-y` can be used in Insert state of Viper. Emacs also has a kill ring where it keeps pieces of text you deleted while editing buffers. The command `M-y` is used to delete the text previously put back by Emacs’ `C-y` or by Vi’s `p` command and reinsert text that was placed on the kill-ring earlier.

This works both in Vi and Insert states. In Vi state, `M-y` is a much better alternative to the usual Vi’s way of recovering the 10 previously deleted chunks of text. In Insert state, you can use this as follows. Suppose you deleted a piece of text and now you need to re-insert it while editing in Insert mode. The key `C-y` will put back the most recently deleted chunk. If this is not what you want, type `M-y` repeatedly and, hopefully, you will find the chunk you want.

Finally, in Insert and Replace states, Viper provides the history of pieces of text inserted in previous insert or replace commands. These strings of text can be recovered by repeatedly typing `C-c M-p` or `C-c M-n` while in Insert or Replace state. (This feature is disabled in the minibuffer: the above keys are usually bound to other histories, which are more appropriate in the minibuffer.)

You can call Meta functions from Insert state. As in Vi state, the Meta key is `C-\`. Thus `M-x` is typed as `C-\ x`.

Other Emacs commands that are useful in Insert state are `C-e` and `C-a`, which move the cursor to the end and the beginning of the current line, respectively. You can also use `M-f` and `M-b`, which move the cursor forward (or backward) one word. If your display has a Meta key, these functions are invoked by holding the Meta key and then typing `f` and `b`, respectively. On displays without the Meta key, these functions are invoked by typing `C-\ f` and `C-\ b` (`C-\` simulates the Meta key in Insert state, as explained above).

The key `C-z` is sometimes also useful in Insert state: it allows you to execute a single command in Vi state without leaving the Insert state! For instance, `C-z d2w` will delete the next two words without leaving the Insert state.

When Viper is in Insert state, you will see <I> in the mode line.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 1.3.4 Replace State

This state is entered through Vi replacement commands, such as `C`, `cw`, etc., or by typing `R`. In Replace state, Viper puts <R> in the mode line to let you know which state is in effect. If Replace state is entered through `R`, Viper stays in that state until the user hits <ESC>. If this state is entered via the other replacement commands, then Replace state is in effect until you hit <ESC> or until you cross the rightmost boundary of the replacement region. In the latter case, Viper changes its state from Replace to Insert (which you will notice by the change in the mode line).

Since Viper runs under Emacs, it is possible to switch between buffers while in Replace state. You can also move the cursor using the arrow keys (even on dumb terminals!) and the mouse. Because of this freedom (which is unattainable in regular Vi), it is possible to take the cursor outside the replacement region. (This may be necessary for several reasons, including the need to enable text selection and region-setting with the mouse.)

The issue then arises as to what to do when the user hits the <ESC> key. In Vi, this would cause the text between cursor and the end of the replacement region to be deleted. But what if, as is possible in Viper, the cursor is not inside the replacement region?

To solve the problem, Viper keeps track of the last cursor position while it was still inside the replacement region. So, in the above situation, Viper would delete text between this position and the end of the replacement region.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 1.4 The Minibuffer

The Minibuffer is where commands are entered in. Editing can be done by commands from Insert state, namely:

`C-h`

  Backspace

`C-w`

  Delete Word

`C-u`

  Erase line

`C-v`

  Quote the following character

`<RET>`

  Execute command

`C-g and C-]`

  Emacs quit and abort keys. These may be necessary. See section Vi State, for an explanation.

`M-p and M-n`

  These keys are bound to functions that peruse minibuffer history. The precise history to be perused depends on the context. It may be the history of search strings, Ex commands, file names, etc.

Most of the Emacs keys are functional in the Minibuffer. While in the Minibuffer, Viper tries to make editing resemble Vi’s behavior when the latter is waiting for the user to type an Ex command. In particular, you can use the regular Vi commands to edit the Minibuffer. You can switch between the Vi state and Insert state at will, and even use the replace mode. Initially, the Minibuffer comes up in Insert state.

Some users prefer plain Emacs bindings in the Minibuffer. To this end, set `viper-vi-style-in-minibuffer` to `nil` in ‘`.viper`’. See section Customization, to learn how to do this.

When the Minibuffer changes Viper states, you will notice that the appearance of the text there changes as well. This is useful because the Minibuffer has no mode line to tell which Vi state it is in. The appearance of the text in the Minibuffer can be changed. See section Viper Specials, for more details.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 1.5 Multiple Files in Viper

Viper can edit multiple files. This means, for example that you never need to suffer through `No write since last change` errors. Some Viper elements are common over all the files.

‘`Textmarkers`’

  Textmarkers remember files and positions. If you set marker ‘`a`’ in file ‘`foo`’, start editing file ‘`bar`’ and type `'a`, then YOU WILL SWITCH TO FILE ‘`foo`’. You can see the contents of a textmarker using the Viper command `[<a-z>` where <a-z> are the textmarkers, e.g., `[a` to view marker ‘`a`’ .

‘`Repeated Commands`’

  Command repetitions are common over files. Typing `!!` will repeat the last `!` command whichever file it was issued from. Typing `.` will repeat the last command from any file, and searches will repeat the last search. Ex commands can be repeated by typing `: <RET>`. Note: in some rare cases, that `: <RET>` may do something dangerous. However, usually its effect can be undone by typing `u`.

‘`Registers`’

  Registers are common to files. Also, text yanked with `y` can be put back (`p`) into any file. The Viper command `]<a-z>`, where <a-z> are the registers, can be used to look at the contents of a register, e.g., type `]a` to view register ‘`a`’.

  There is one difference in text deletion that you should be aware of. This difference comes from Emacs and was adopted in Viper because we find it very useful. In Vi, if you delete a line, say, and then another line, these two deletions are separated and are put back separately if you use the ‘`p`’ command. In Emacs (and Viper), successive series of deletions that are not interrupted by other commands are lumped together, so the deleted text gets accumulated and can be put back as one chunk. If you want to break a sequence of deletions so that the newly deleted text could be put back separately from the previously deleted text, you should perform a non-deleting action, e.g., move the cursor one character in any direction.

‘`Absolute Filenames`’

  The current directory name for a file is automatically prepended to the file name in any `:e`, `:r`, `:w`, etc., command (in Emacs, each buffer has a current directory). This directory is inserted in the Minibuffer once you type space after `:e, r`, etc. Viper also supports completion of file names and Ex commands (<TAB>), and it keeps track of command and file history (`M-p`, `M-n`). Absolute filenames are required less often in Viper.

  You should be aware that Emacs interprets `/foo/bar//bla` as `/bla` and `/foo/~/bar` as `~/bar`. This is designed to minimize the need for erasing file names that Emacs suggests in its prompts, if a suggested file name is not what you wanted.

  The command `:cd` will change the default directory for the current Emacs buffer. The Ex command `:e` will interpret the filename argument in ‘`csh`’, by default. See section Customization, if you want to change this.

Currently undisplayed files can be listed using the `:ar` command. The command `:n` can be given counts from the `:ar` list to switch to other files. For example, use ‘:n3’ to move to the third file in that list.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 1.6 Unimplemented Features

Unimplemented features include:

- `:ab` and `:una` are not implemented, since `:ab` is considered obsolete, since Emacs has much more powerful facilities for defining abbreviations.
- `:set option?` is not implemented. The current `:set` can also be used to set Emacs variables.
- `:se list` requires modification of the display code for Emacs, so it is not implemented. A useful alternative is `cat -t -e file`. Unfortunately, it cannot be used directly inside Emacs, since Emacs will obdurately change ‘`^I`’ back to normal tabs.

[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by a tester on a sunny day using texi2html.