Go to the first, previous, next, last section, table of contents.

Emacs Preliminaries

Emacs can edit several files at once. A file in Emacs is placed in a buffer that has the same name as the file. Buffers are also used for other purposes, such as shell interfaces, directory editing etc. See 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 VIP try to mimic the behavior of VI, preventing the cursor from going beyond the last character on the line. However, under some circumstances it is possible for the cursor to get beyond the end-of-line, so do not be surprised if this happens.

In addition to the point, there is another distinguished buffer position called the mark. See 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 VIP user, this simply means that in addition to the VI textmarkers a--z, there is another marker called mark. VIP 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. 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 the 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. VIP uses the Minibuffer window for / and some other 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 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 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. A minor mode changes the local keymap when turned on, and changes it back to original when turned off. For more information, see section `Minor Modes' in The GNU Emacs Manual.

VIP is implemented as a minor mode. This means that you can turn VIP on or off at any time in any major mode. See section Modes in VIP 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. For keyboards that do not have a Meta key, the ESC is used as Meta. Thus M-x is typed as ESC x. VIP uses ESC to switch from Insert mode to Vi mode. Therefore VIP defines _ as its Meta key in Vi mode. See section Vi Mode, 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 typing M-x function-name.


Go to the first, previous, next, last section, table of contents.