@setfilename ../../info/viper
@copying
-Copyright @copyright{} 1995-1997, 2001-2012 Free Software Foundation, Inc.
+Copyright @copyright{} 1995--1997, 2001--2013 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
is included in the section entitled ``GNU Free Documentation License''.
(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
-modify this GNU manual. Buying copies from the FSF supports it in
-developing GNU and promoting software freedom.''
+modify this GNU manual.''
@end quotation
@end copying
@dircategory Emacs misc features
@direntry
-* VIPER: (viper). The newest Emacs VI-emulation mode.
- (also, A VI Plan for Emacs Rescue
- or the VI PERil.)
+* VIPER: (viper). A VI-emulation mode for Emacs.
@end direntry
@finalout
@contents
@ifnottex
-@node Top, Overview,, (DIR)
-
-@unnumbered Viper
+@node Top
+@top Viper
We believe that one or more of the following statements are adequate
descriptions of Viper:
on VIP version 3.5 by Masahiko Sato and VIP version 4.4 by Aamod Sane.
About 15% of the code still comes from those older packages.
-Viper is intended to be usable without reading this manual --- the defaults
+Viper is intended to be usable without reading this manual; the defaults
are set to make Viper as close to Vi as possible. At startup, Viper will
try to set the most appropriate default environment for you, based on
your familiarity with Emacs. It will also tell you the basic GNU Emacs window
Comments and bug reports are welcome.
@code{kifer@@cs.stonybrook.edu} is the current address for Viper bug reports.
-Please use the Ex command @kbd{:submitReport} for this purpose.@refill
+Please use the Ex command @kbd{:submitReport} for this purpose.
@insertcopying
@end ifnottex
* Improvements over Vi:: New features, Improvements
* Customization:: How to customize Viper
* Commands:: Vi and Ex Commands
-
+* GNU Free Documentation License:: The license for this documentation.
+* Acknowledgments::
* Key Index:: Index of Vi and Ex Commands
* Function Index:: Index of Viper Functions
* Variable Index:: Index of Viper Variables
* Package Index:: Index of Packages Mentioned in this Document
* Concept Index:: Vi, Ex and Emacs concepts
-
-* Acknowledgments::
-* GNU Free Documentation License:: The license for this documentation.
-
@end menu
@iftex
@unnumbered Introduction
Masahiko Sato and VIP version 4.4 by Aamod Sane. About 15% of the code
still comes from those older packages.
-Viper is intended to be usable out of the box, without reading this manual
---- the defaults are set to make Viper as close to Vi as possible. At
+Viper is intended to be usable out of the box, without reading this manual;
+the defaults are set to make Viper as close to Vi as possible. At
startup, Viper will attempt to set the most appropriate default environment
for you, based on your familiarity with Emacs. It will also tell you the
basic GNU Emacs window management commands to help you start immediately.
Comments and bug reports are welcome.
@code{kifer@@cs.stonybrook.edu} is the current address for Viper bug reports.
-Please use the Ex command @kbd{:submitReport} for this purpose.@refill
+Please use the Ex command @kbd{:submitReport} for this purpose.
@end iftex
-@node Overview,Improvements over Vi,Top,Top
+@node Overview
@chapter Overview of Viper
Viper is a Vi emulation on top of Emacs. At the same time, Viper provides a
* Unimplemented Features:: That are unlikely to be implemented.
@end menu
-@node Emacs Preliminaries, Loading Viper, Overview, Overview
+@node Emacs Preliminaries
@section Emacs Preliminaries
@cindex buffer
@dfn{buffer} that usually has the same name as the file. Buffers are also used
for other purposes, such as shell interfaces, directory editing, etc.
@xref{Dired,,Directory Editor,emacs,The
-GNU Emacs Manual}, for an example.@refill
+GNU Emacs Manual}, for an example.
A buffer has a distinguished position called the @dfn{point}.
A @dfn{point} is always between 2 characters, and is @dfn{looking at}
the right hand character. The cursor is positioned on the right hand
character. Thus, when the @dfn{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.@refill
+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. @xref{Customization}.@refill
+modify the default editing style. @xref{Customization}.
In addition to the @dfn{point}, there is another distinguished buffer
position called the @dfn{mark}. @xref{Mark,,Mark,emacs,The GNU Emacs
135. There is no need to type the line numbers, since Viper inserts them
automatically in front of the Ex command.
-@xref{Basics}, for more info.@refill
+@xref{Basics}, for more info.
@cindex window
@cindex mode line
A special buffer called @dfn{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 @kbd{/} and @kbd{:}
-commands.@refill
+commands.
@cindex mode
@cindex keymap
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. @xref{Major Modes,Major Modes,Major Modes,emacs,The
-GNU Emacs Manual}, for more information.@refill
+GNU Emacs Manual}, for more information.
A buffer can also have a @dfn{minor mode}. Minor modes are options that
you can use or not. A buffer in @code{text-mode} can have
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, @pxref{Minor Modes,Minor Modes,Minor Modes,emacs,The
-GNU Emacs Manual} @refill
+GNU Emacs Manual}.
@cindex Viper as minor mode
@cindex Control keys
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.
@xref{States in Viper}, for
-more information.@refill
+more information.
Emacs uses Control and Meta modifiers. These are denoted as C and M,
-e.g.@: @kbd{^Z} as @kbd{C-z} and @kbd{Meta-x} as @kbd{M-x}. The Meta key is
+e.g., @kbd{^Z} as @kbd{C-z} and @kbd{Meta-x} as @kbd{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., @kbd{M-x} means typing @kbd{x} while
holding the Meta key down. For keyboards that do not have a Meta key,
@key{ESC} is used as Meta. Thus @kbd{M-x} is typed as @kbd{@key{ESC}
x}. Viper uses @key{ESC} to switch from Insert state to Vi state. Therefore
Viper defines @kbd{C-\} as its Meta key in Vi state. @xref{Vi State}, for
-more info.@refill
+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 @kbd{M-x function-name}.
-@node Loading Viper, States in Viper, Emacs Preliminaries, Overview
+@node Loading Viper
@section Loading Viper
The most common way to load it automatically is to include the following
editing files by using @kbd{:e}, @kbd{:vi}, or @kbd{v} commands.
(@xref{File and Buffer Handling}, for more information on @kbd{v} and other
new commands that, in many cases, are more convenient than @kbd{:e},
-@kbd{:vi}, and similar old-style Vi commands.)@refill
+@kbd{: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 @kbd{M-x
viper-go-away} will do it for you. The function @code{toggle-viper-mode}
toggles Viperization of Emacs on and off.
-@node States in Viper, The Minibuffer, Loading Viper,Overview
+@node States in Viper
@section States in Viper
@kindex @kbd{C-z}
Viper, @kbd{C-z} will normally take you to Vi command state. Another
@kbd{C-z} will take you back to Emacs state. This toggle key can be
changed, @pxref{Customization} You can also type @kbd{M-x viper-mode} to
-change to Vi state.@refill
+change to Vi state.
For users who chose to set their user level to 1 at Viper setup time,
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 @key{ESC}, Viper will switch to Vi command mode, terminating the
-replacement state.@refill
+replacement state.
@end table
@cindex mode line
those special modes (typing @kbd{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
+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.
replacement commands, such as cw, C, R, etc.
@end menu
-@node Emacs State, Vi State, States in Viper, States in Viper
+@node Emacs State
@subsection Emacs State
@kindex @kbd{C-z}
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. @xref{Improvements over
-Vi}, for more.@refill
+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
single Vi command while staying in Viper's Insert state.
-@node Vi State, Insert State, Emacs State, States in Viper
+@node Vi State
@subsection Vi State
@cindex Vi state
Edit,Recursive Edit,emacs,The GNU Emacs Manual}.
At user level 1, @kbd{C-g} is bound to @code{viper-info-on-file}
function instead.
-@refill
@item C-\
@kindex @kbd{C-\}
@cindex Meta key
command will appear in the history list. This is because having @kbd{:r}
alone as a default is meaningless, since this command requires a file
argument.
-@refill
@end table
@noindent
As in Vi, Viper's destructive commands can be re-executed by typing `@kbd{.}'.
`@kbd{.}'.
@xref{Improvements over Vi}, for more information.
-@node Insert State, Replace State, Vi State, States in Viper
+@node Insert State
@subsection Insert State
@cindex 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).
@xref{Customization},
-to see how to do this.@refill
+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 @dfn{yank} command, @kbd{C-y},
which is similar to Vi's @kbd{p}. However, unlike @kbd{p}, @kbd{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 @kbd{M-y} is
-used to delete the text previously put back by Emacs' @kbd{C-y} or by Vi's
+used to delete the text previously put back by Emacs's @kbd{C-y} or by Vi's
@kbd{p} command and reinsert text that was placed on the kill-ring earlier.
This works both in Vi and Insert states.
When Viper is in Insert state, you will see <I> in the mode line.
-@node Replace State,, Insert State, States in Viper
+@node Replace State
@subsection Replace State
@cindex Replace state
would delete text between this position and the end of the replacement
region.
-@node The Minibuffer,Multiple Files in Viper, States in Viper, Overview
+@node The Minibuffer
@section The Minibuffer
@cindex Minibuffer
The appearance of the text in the minibuffer can be changed.
@xref{Viper Specials}, for more details.
-@node Multiple Files in Viper,Unimplemented Features,The Minibuffer,Overview
+@node Multiple Files in Viper
@section Multiple Files in Viper
@cindex multiple files
file @file{foo}, start editing file @file{bar} and type @kbd{'a}, then
@emph{YOU WILL SWITCH TO FILE @file{foo}}. You can see the contents of a
textmarker using the Viper command @kbd{[<a-z>} where <a-z> are the
-textmarkers, e.g., @kbd{[a} to view marker @samp{a} .@refill
+textmarkers, e.g., @kbd{[a} to view marker @samp{a} .
@item Repeated Commands
Command repetitions are common over files. Typing @kbd{!!} will repeat the
last @kbd{!} command whichever file it was issued from.
Typing @kbd{.} will repeat the last command from any file, and
searches will repeat the last search. Ex commands can be repeated by typing
-@kbd{: @key{RET}}.@refill
+@kbd{: @key{RET}}.
Note: in some rare cases, that @kbd{: @key{RET}} may do something dangerous.
However, usually its effect can be undone by typing @kbd{u}.
@item Registers
command @kbd{:n} can be given counts from the @kbd{:ar} list to switch to
other files. For example, use `:n3' to move to the third file in that list.
-@node Unimplemented Features,,Multiple Files in Viper,Overview
+@node Unimplemented Features
@section Unimplemented Features
Unimplemented features include:
it is not implemented.
A useful alternative is @code{cat -t -e file}. Unfortunately, it cannot
be used directly inside Emacs, since Emacs will obdurately change @samp{^I}
-back to normal tabs.@refill
+back to normal tabs.
@end itemize
-@comment node-name, next, previous, up
-@node Improvements over Vi, Customization, Overview, Top
+@node Improvements over Vi
@chapter Improvements over Vi
Some common problems with Vi and Ex have been solved in Viper. This
you should know about.
@end menu
-@node Basics, Undo and Backups, Improvements over Vi, Improvements over Vi
+@node Basics
@section Basics
The Vi command set is based on the idea of combining motion commands
with other commands. The motion command is used as a text region
specifier for other commands.
We classify motion commands into @dfn{point commands} and
-@dfn{line commands}.@refill
+@dfn{line commands}.
@cindex point commands
specify @code{(setq ex-cycle-through-non-files t)} in your @file{.viper}
file. @xref{Customization}, for details.
-@node Undo and Backups, History, Basics, Improvements over Vi
+@node Undo and Backups
@section Undo and Backups
@cindex undo
Since the undo size is limited, Viper can create backup files and
auto-save files. It will normally do this automatically. It is possible
to have numbered backups, etc. For details, @pxref{Backup,,Backup and
-Auto-Save,emacs,The GNU Emacs Manual} @refill
+Auto-Save,emacs,The GNU Emacs Manual}.
@comment [ balance parens
@cindex viewing registers and markers
can be any letters from a through z.
@comment ] balance parens
-@node History, Macros and Registers, Undo and Backups,Improvements over Vi
+@node History
@section History
@cindex history
have a buffer history, and commands that expect strings or regular
expressions keep a history on those items.
-@node Macros and Registers,Completion,History,Improvements over Vi
+@node Macros and Registers
@section Macros and Registers
@cindex keyboard macros
you can execute this macro using @kbd{@@register}. It is, of course,
possible to yank some text into a register and execute it using
@kbd{@@register}. Typing @kbd{@@@@}, @kbd{@@RET}, or @kbd{@@C-j} will
-execute the last macro that was executed using @kbd{@@register}.@refill
+execute the last macro that was executed using @kbd{@@register}.
Viper will automatically lowercase the register, so that pressing the
@kbd{SHIFT} key for @kbd{@@} will not create problems. This is for
This is useful for Emacs style keyboard macros defined using @kbd{C-x(}
and @kbd{C-x)}. Emacs keyboard macros have more capabilities.
@xref{Keyboard Macros,,Keyboard Macros,emacs, The GNU Emacs Manual}, for
-details.@refill
+details.
Keyboard Macros allow an interesting form of Query-Replace:
@kbd{/pattern} or @kbd{n} to go to the next pattern (the query), followed by a
Viper also provides Vi-style macros. @xref{Vi Macros}, for details.
-@node Completion, Improved Search, Macros and Registers, Improvements over Vi
+@node Completion
@section Completion
@cindex completion
of the form @kbd{/foo//bar} as @kbd{/bar} and @kbd{/foo/~/bar} as
@kbd{~/bar}.
-@node Improved Search, Abbreviation Facilities, Completion, Improvements over Vi
+@node Improved Search
@section Improved Search
@cindex buffer search
@kbd{C-r}. @xref{Customization}, to find out how to change the bindings
of @kbd{C-r or C-s}.
For details, @pxref{Incremental Search,,Incremental
-Search,emacs,The GNU Emacs Manual} @refill
+Search,emacs,The GNU Emacs Manual}.
@cindex query replace
Try it: it is really simple!
-@node Abbreviation Facilities,Movement and Markers,Improved Search,Improvements over Vi
+@node Abbreviation Facilities
@section Abbreviation Facilities
@cindex abbrevs
@code{dabbrev-expand} to that key.
Facilities like this make Vi's @kbd{:ab} command obsolete.
-@node Movement and Markers, New Commands, Abbreviation Facilities, Improvements over Vi
+@node Movement and Markers
@section Movement and Markers
@cindex Ex style motion
The above discussion of the meaning of Viper's words concerns only Viper's
movement commands. In regular expressions, words remain the same as in
Emacs. That is, the expressions @code{\w}, @code{\>}, @code{\<}, etc., use
-Emacs' idea of what is a word, and they don't look into the value of
+Emacs's idea of what is a word, and they don't look into the value of
variable @code{viper-syntax-preference}. This is because Viper doesn't change
syntax tables in fear of upsetting the various major modes that set these
tables.
Textmarkers, this is very useful. Contents of textmarkers can be viewed
by @kbd{[marker}. (Contents of registers can be viewed by @kbd{]register}).
-@node New Commands, Useful Packages, Movement and Markers, Improvements over Vi
+@node New Commands
@section New Commands
These commands have no Vi analogs.
command from the current major mode. @key{ESC} will do the same, if you
configure @key{ESC} as Meta by setting @code{viper-no-multiple-ESC} to @code{nil}
in @file{.viper}. @xref{Customization}. @kbd{C-\} in Insert, Replace, or Vi
-states will make Emacs think @kbd{Meta} has been hit.@refill
+states will make Emacs think @kbd{Meta} has been hit.
@item \
@kindex @kbd{\}
Escape to Emacs to execute a single Emacs command. For instance,
(indicated as <move>).
Currently, @var{ch} can be one of @kbd{c}, @kbd{C}, @kbd{g}, @kbd{q}, and
@kbd{s}. For instance, @kbd{#qr} will prompt you for a string and then
-prepend this string to each line in the buffer.@refill
+prepend this string to each line in the buffer.
@item # c
@kindex @kbd{#c<move>}
@cindex changing case
@item # g
@kindex @kbd{#g<move>}
Execute last keyboard macro for each line in the region
-(@code{viper-global-execute}).@refill
+(@code{viper-global-execute}).
@item # q
@kindex @kbd{#q<move>}
Insert specified string at the beginning of each line in the region
@item g <@emph{movement command}>
Search buffer for text delimited by movement command. The canonical
example is @kbd{gw} to search for the word under the cursor.
-@xref{Improved Search}, for details.@refill
+@xref{Improved Search}, for details.
@item C-g and C-]
@kindex @kbd{C-g}
@kindex @kbd{C-]}
notably, Vi style macros are much more powerful in Viper than in Vi. @xref{Vi
Macros}, for details.
-@node Useful Packages, ,New Commands, Improvements over Vi
+@node Useful Packages
@section Useful Packages
Some Emacs packages are mentioned here as an aid to the new Viper user, to
@noindent
Emacs Lisp archives exist on
@samp{archive.cis.ohio-state.edu}
-and @samp{wuarchive.wustl.edu}@refill
+and @samp{wuarchive.wustl.edu}
-@node Customization,Commands,Improvements over Vi,Top
+@node Customization
@chapter Customization
@cindex customization
'viper)} line. This method is @emph{not} recommended, unless you know what
you are doing. Only two variables, @code{viper-mode} and
@code{viper-custom-file-name}, are supposed to be customized in @file{.emacs},
-prior to loading Viper (i.e., prior to @code{(require 'viper)} command.@refill
+prior to loading Viper (i.e., prior to @code{(require 'viper)} command.
@item
@cindex :customize
By executing the @kbd{:customize} Ex command. This takes you to the Emacs
* Vi Macros:: How to do Vi style macros.
@end menu
-@node Rudimentary Changes,Key Bindings,Customization,Customization
+@node Rudimentary Changes
@section Rudimentary Changes
@cindex setting variables
@item viper-search-scroll-threshold 2
If search lands within this many lines of the window top or bottom, the
window will be scrolled up or down by about 1/7-th of its size, to reveal
-the context. If the value is negative---don't scroll.
+the context. If the value is negative, don't scroll.
@item viper-tags-file-name "TAGS"
The name of the file used as the tag table.
@item viper-re-query-replace nil
specifying a new face. (Emacs faces are described in the Emacs Lisp
reference.) On a color display, the following customization method is
usually most effective:
-@example
+@smallexample
(set-face-foreground viper-replace-overlay-face "DarkSlateBlue")
(set-face-background viper-replace-overlay-face "yellow")
-@end example
+@end smallexample
For a complete list of colors available to you, evaluate the expression
@code{(x-defined-colors)}. (Type it in the buffer @code{*scratch*} and then
hit the @kbd{C-j} key.
@vindex @code{viper-replace-state-hook}
@vindex @code{viper-emacs-state-hook}
-@node Key Bindings, Packages that Change Keymaps, Rudimentary Changes,Customization
+@node Key Bindings
@section Key Bindings
@cindex key bindings
@noindent
To customize the binding for @kbd{C-h} in Insert state:
@example
-(define-key viper-insert-global-user-map "\C-h" 'my-del-backwards-function)
+(define-key viper-insert-global-user-map "\C-h"
+ 'my-del-backwards-function)
@end example
@noindent
(setq my-dired-vi-purist-map (make-sparse-keymap))
(define-key my-dired-vi-purist-map "k" 'viper-previous-line)
(define-key my-dired-vi-purist-map "l" 'viper-forward-char)
-(viper-modify-major-mode 'dired-mode 'emacs-state my-dired-vi-purist-map)
+(viper-modify-major-mode 'dired-mode
+ 'emacs-state my-dired-vi-purist-map)
@end example
Yet another way to customize key bindings in a major mode is to edit the
@findex @code{viper-add-local-keys}
@findex @code{viper-zap-local-keys}
-@node Packages that Change Keymaps,Viper Specials,Key Bindings,Customization
-@subsection Packages that Change Keymaps
+@node Packages that Change Keymaps
+@section Packages that Change Keymaps
@cindex C-c and Viper
@cindex Viper and C-c
@findex @code{remove-hook}
@findex @code{add-hook}
-@node Viper Specials,Vi Macros,Packages that Change Keymaps,Customization
+@node Viper Specials
@section Viper Specials
Viper extends Vi with a number of useful features. This includes various
@item viper-minibuffer-emacs-face 'viper-minibuffer-emacs-face
These faces control the appearance of the minibuffer text in the
corresponding Viper states. You can change the appearance of these faces
-through Emacs' customization widget, which is accessible through the
+through Emacs's customization widget, which is accessible through the
menubar.
Viper is located in this widget under the @emph{Emulations} customization
configuration. However, this may require some getting used to. For
instance, if you are typing in a frame, A, and then move the mouse to frame
B and click to invoke mouse search, search (or insertion) will be performed
-in frame A. To perform search/insertion in frame B, you will first have to
+in frame A@. To perform search/insertion in frame B, you will first have to
shift focus there, which doesn't happen until you type a character or
perform some other action in frame B---mouse search doesn't shift focus.
Emacs. The function @code{viper-surrounding-word} in @file{viper.el} can be
used as a guiding example.
-@node Vi Macros, ,Viper Specials,Customization
+@node Vi Macros
@section Vi Macros
@cindex Vi macros
even prompt the user for input and then continue. To do this, one should
type @kbd{C-x q} (for confirmation) or @kbd{C-u C-x q} (for prompt).
For details, @pxref{Keyboard Macro Query,,Customization,emacs,The GNU Emacs
-Manual} @refill
+Manual}.
-When the user finishes defining a macro (which is done by typing @kbd{C-x)} ---
+When the user finishes defining a macro (which is done by typing @kbd{C-x)},
a departure from Vi), you will be asked whether you want this
macro to be global, mode-specific, or buffer-specific. You will also be
given a chance to save the macro in your @file{~/.viper} file.
currently defined. To see all macros along with their definitions, type
@kbd{M-x viper-describe-kbd-macros}.
-@node Commands,,Customization,Top
+@node Commands
@chapter Commands
This section is a semi-automatically bowdlerized version of the Vi
reference created by @* @samp{maart@@cs.vu.nl} and others. It can be
-found on the Vi archives. This reference has been adapted for Viper.@refill
+found on the Vi archives. This reference has been adapted for Viper.
@menu
* Groundwork:: Textual Conventions and Viper basics
* Mouse-bound Commands:: Search and insertion of text
@end menu
-@node Groundwork, Text Handling, Commands, Commands
-@comment node-name, next, previous, up
+@node Groundwork
@section Groundwork
The VI command set is based on the idea of combining motion commands
with other commands. The motion command is used as a text region
specifier for other commands.
We classify motion commands into @dfn{point commands} and
-@dfn{line commands}.@refill
+@dfn{line commands}.
@cindex point commands
The above discussion concerns only the movement commands. In regular
expressions, words remain the same as in Emacs. That is, the expressions
-@code{\w}, @code{\>}, @code{\<}, etc., use Emacs' idea of what is a word,
+@code{\w}, @code{\>}, @code{\<}, etc., use Emacs's idea of what is a word,
and they don't look into the value of variable
@code{viper-syntax-preference}. This is because Viper avoids changing
syntax tables in order to not thwart the various major modes that set these
tables.
-The usual Emacs convention is used to indicate Control Characters, i.e
+The usual Emacs convention is used to indicate Control Characters, i.e.,
C-h for Control-h. @emph{Do not confuse this with a sequence of separate
characters
C, -, h!!!} The @kbd{^} is itself, never used to indicate a
inserts them automatically in front of the Ex command.
@cindex Ex commands
-@node Text Handling, Display, Groundwork, Commands
+@node Text Handling
@section Text Handling
@menu
* Undoing:: Multiple Undo, Backups
@end menu
-@node Move Commands,Marking,,Text Handling
+@node Move Commands
@subsection Move Commands
@cindex movement commands
@item <count> $
To the end of line <count> from the cursor.
@item <count> ^
-To the first CHAR <count> - 1 lines lower.
+To the first CHAR <count> @minus{} 1 lines lower.
@item <count> -
To the first CHAR <count> lines higher.
@item <count> + <cr>
@kindex @kbd{l}
@vindex @code{viper-parse-sexp-ignore-comments}
-@node Marking,Appending Text,Move Commands,Text Handling
+@node Marking
@subsection Marking
Emacs mark is referred to in the region specifiers @kbd{r} and @kbd{R}.
Exchange point and mark and go to the first CHAR on line.
@item '<a-z>
Go to specified Viper mark.
-@item
+@item `<a-z>
Go to specified Viper mark and go to the first CHAR on line.
@end table
@kindex @kbd{m<a-z>}
@kindex @kbd{`<a-z>}
@kindex @kbd{'<a-z>}
-@node Appending Text, Editing in Insert State, Marking,Text Handling
+@node Appending Text
@subsection Appending Text
@xref{Options}, to see how to change tab and shiftwidth size. See the GNU
@kindex @kbd{A}
@kindex @kbd{a}
-@node Editing in Insert State, Deleting Text, Appending Text,Text Handling
+@node Editing in Insert State
@subsection Editing in Insert State
Minibuffer can be edited similarly to Insert state, and you can switch
@kindex @kbd{C-w}
@kindex @kbd{C-v}
-@node Deleting Text, Changing Text, Editing in Insert State, Text Handling
+@node Deleting Text
@subsection Deleting Text
@kindex @kbd{X}
@kindex @kbd{x}
-@node Changing Text, Search and Replace, Deleting Text,Text Handling
+@node Changing Text
@subsection Changing Text
@cindex joining lines
@table @kbd
@item <count> r<char>
-Replace <count> chars by <char> - no <esc>.
+Replace <count> chars by <char>; no <esc>.
@item <count> R
Overwrite the rest of the line,
-appending change @var{count - 1} times.
+appending change @var{count} @minus{} 1 times.
@item <count> s
Substitute <count> chars.
@item <count> S
@item <count> cc
Change <count> lines.
@item <count> C
-The rest of the line and <count> - 1 next lines.
+The rest of the line and <count> @minus{} 1 next lines.
@item <count> =<move>
Reindent the region described by move.
@item <count> ~
@item :[x,y]s/<pat>/<repl>/<f>
Substitute (on lines x through y) the pattern
<pat> (default the last pattern) with <repl>. Useful
-flags <f> are @samp{g} for @samp{global} (i.e.@: change every
+flags <f> are @samp{g} for @samp{global} (i.e., change every
non-overlapping occurrence of <pat>) and @samp{c} for
@samp{confirm} (type @samp{y} to confirm a particular
substitution, else @samp{n} ). Instead of @kbd{/} any
@item :[x,y]move [z]
Move text between @kbd{x} and @kbd{y} to the position after @kbd{z}.
@item &
-Repeat latest Ex substitute command, e.g.
+Repeat latest Ex substitute command, e.g.,
@kbd{:s/wrong/right}.
@item :x,yp
@itemx :g/Pat/p
@kindex @kbd{R}
@kindex @kbd{r<char>}
-@node Search and Replace, Yanking, Changing Text,Text Handling
+@node Search and Replace
@subsection Search and Replace
@xref{Groundwork}, for Ex address syntax. @xref{Options}, to see how to
@item :[x,y]s/<pat>/<repl>/<f>
Substitute (on lines x through y) the pattern <pat> (default the last
pattern) with <repl>. Useful
-flags <f> are @samp{g} for @samp{global} (i.e.@: change every
+flags <f> are @samp{g} for @samp{global} (i.e., change every
non-overlapping occurrence of <pat>) and @samp{c} for
@samp{confirm} (type @samp{y} to confirm a particular
substitution, else @samp{n}). Instead of @kbd{/} any
Note: @emph{The newline character (inserted as @kbd{C-qC-j})
can be used in <repl>}.
@item &
-Repeat latest Ex substitute command, e.g.@: @kbd{:s/wrong/right}.
+Repeat latest Ex substitute command, e.g., @kbd{:s/wrong/right}.
@item :global /<pattern>/<ex-command>
@itemx :g /<pattern>/<ex-command>
Execute <ex-command> on all lines that match <pattern>.
@kindex @kbd{?<string>}
@kindex @kbd{/<string>}
-@node Yanking,Undoing,Search and Replace,Text Handling
+@node Yanking
@subsection Yanking
@cindex cut and paste
@kindex @kbd{yank}
@findex @kbd{:yank}
-@node Undoing,, Yanking,Text Handling
+@node Undoing
@subsection Undoing
@cindex undo
@kindex @kbd{U}
@kindex @kbd{u}
-@node Display, File and Buffer Handling, Text Handling, Commands
+@node Display
@section Display
@cindex scrolling
and relative position.@*
At user levels 2 and higher, abort the current command.
@item C-c g
-Give file name, status, current line number and relative position -- all
+Give file name, status, current line number and relative position---all
user levels.
@item C-l
Refresh the screen.
@kindex @kbd{C-g}
-@node File and Buffer Handling, Mapping, Display,Commands
+@node File and Buffer Handling
@section File and Buffer Handling
@cindex multiple files
@item :x!@: [<file>]
@kbd{:w![<file>]} and @kbd{:q}.
@item :pre
-Preserve the file -- autosave buffers.
+Preserve the file---autosave buffers.
@item :rec
Recover file from autosave.
@item :f [<file>]
@findex @kbd{:cd [<dir>]}
@findex @kbd{:pwd}
-@node Mapping, Shell Commands, File and Buffer Handling, Commands
+@node Mapping
@section Mapping
@cindex key bindings
@findex @kbd{:unmap!@: <char>}
@findex @kbd{:map!@: <char> <seq>}
-@node Shell Commands, Options, Mapping, Commands
+@node Shell Commands
@section Shell Commands
@cindex % (Current file)
@cindex @samp{#} (Previous file)
Similarly, @samp{#} expands to the previous file. The previous file is the
first file in @kbd{:args} listing. This defaults to the previous file in
-the VI sense if you have one window.@refill
+the VI sense if you have one window.
Symbols @samp{%} and @samp{#} are also used in the Ex commands @kbd{:e} and
@kbd{:r <shell-cmd>}. The commands @kbd{:w} and the regular @kbd{:r
@findex @kbd{:sh}
@findex @kbd{:make}
-@node Options,Emacs Related Commands,Shell Commands,Commands
+@node Options
@section Options
@cindex Vi options
@item autoindent
@itemx ai
@cindex autoindent
-autoindent -- In append mode after a <cr> the
+autoindent: In append mode after a <cr> the
cursor will move directly below the first
character on the previous line.
This setting affects the current buffer only.
@item ignorecase
@itemx ic
@cindex case and searching
-ignorecase -- No distinction between upper and lower cases when searching.
+ignorecase: No distinction between upper and lower cases when searching.
@item noignorecase
@itemx noic
Cancel ignorecase.
@item readonly
@itemx ro
@cindex readonly files
-readonly -- The file is not to be changed.
+readonly: The file is not to be changed.
If the user attempts to write to this file, confirmation will be requested.
@item noreadonly
@itemx noro
@item shell=<string>
@itemx sh=<string>
@cindex shell
-shell -- The program to be used for shell escapes
+shell: The program to be used for shell escapes
(default @samp{$SHELL} (default @file{/bin/sh})).
@item shiftwidth=<count>
@itemx sw=<count>
@cindex layout
@cindex shifting text
-shiftwidth -- Gives the shiftwidth (default 8 positions).
+shiftwidth: Gives the shiftwidth (default 8 positions).
@item showmatch
@itemx sm
@cindex paren matching
@cindex matching parens
-showmatch -- Whenever you append a @kbd{)}, Vi shows
+showmatch: Whenever you append a @kbd{)}, Vi shows
its match if it's on the same page; also with
@kbd{@{} and @kbd{@}}. If there's no match, Vi will beep.
@item noshowmatch
@itemx ts=<count>
@cindex changing tab width
@cindex tabbing
-tabstop -- The length of a <ht>; warning: this is
+tabstop: The length of a <ht>; warning: this is
only IN the editor, outside of it <ht>s have
their normal length (default 8 positions).
This setting affects the current buffer only.
@itemx wm=<count>
@cindex auto fill
@cindex word wrap
-wrapmargin -- In append mode Vi automatically
+wrapmargin: In append mode Vi automatically
puts a <lf> whenever there is a <sp> or <ht>
within <wm> columns from the right margin.
@item wrapscan
@itemx ws
@cindex searching
-wrapscan -- When searching, the end is
+wrapscan: When searching, the end is
considered @samp{stuck} to the begin of the file.
@item nowrapscan
@itemx nows
@findex @kbd{:set ai}
@findex @kbd{:set autoindent}
-@node Emacs Related Commands,,Options,Commands
+@node Emacs Related Commands
@section Emacs Related Commands
@table @kbd
@kindex @kbd{C-\}
@kindex @kbd{C-c\}
-@node Mouse-bound Commands,,,Commands
+@node Mouse-bound Commands
@section Mouse-bound Commands
The following two mouse actions are normally bound to special search and
This command can take a prefix argument. Note: Viper sets this
binding only if this mouse action is not
already bound to something else.
-@xref{Viper Specials}, for more information.@refill
+@xref{Viper Specials}, for more information.
@item S-Mouse-2
Holding Shift and clicking button 2 of the mouse will
This command can also take a prefix argument.
Note: Viper sets this binding only if this mouse action is not
already bound to something else.
-@xref{Viper Specials}, for more details.@refill
+@xref{Viper Specials}, for more details.
@end table
@kindex @kbd{S-Mouse-1}
@kindex @kbd{S-Mouse-2}
@kindex @kbd{meta button1up}
@kindex @kbd{meta button2up}
-@node Acknowledgments,,,Top
-@comment node-name, next, previous, up
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
+@include doclicense.texi
+
+@node Acknowledgments
@unnumbered Acknowledgments
Viper, formerly known as VIP-19, was written by Michael Kifer. Viper is
edmonds@@edmonds.home.cs.ubc.ca (Brian Edmonds),
gin@@mo.msk.ru (Golubev I.N.),
gviswana@@cs.wisc.edu (Guhan Viswanathan),
-gvr@@halcyon.com (George V.@: Reilly),
+gvr@@halcyon.com (George V. Reilly),
hatazaki@@bach.convex.com (Takao Hatazaki),
hpz@@ibmhpz.aug.ipp-garching.mpg.de (Hans-Peter Zehrfeld),
irie@@t.email.ne.jp (Irie Tetsuya),
jackr@@dblues.engr.sgi.com (Jack Repenning),
-jamesm@@bga.com (D.J.@: Miller II),
+jamesm@@bga.com (D.J. Miller II),
jjm@@hplb.hpl.hp.com (Jean-Jacques Moreau),
jl@@cse.ogi.edu (John Launchbury),
jobrien@@hchp.org (John O'Brien),
zapman@@cc.gatech.edu (Jason Zapman II),
@end example
-@node GNU Free Documentation License,,, Top
-@appendix GNU Free Documentation License
-@include doclicense.texi
-
-@node Key Index,Function Index,,Top
-@comment node-name, next, previous, up
+@node Key Index
@unnumbered Key Index
@printindex ky
-@node Function Index,Variable Index,Key Index,Top
-@comment node-name, next, previous, up
+@node Function Index
@unnumbered Function Index
@printindex fn
-@node Variable Index,Package Index,Function Index,Top
-@comment node-name, next, previous, up
+@node Variable Index
@unnumbered Variable Index
@printindex vr
-@node Package Index,Concept Index,Variable Index,Top
-@comment node-name, next, previous, up
+@node Package Index
@unnumbered Package Index
@printindex pg
-@node Concept Index,,Package Index,Top
-@comment node-name, next, previous, up
+@node Concept Index
@unnumbered Concept Index
@printindex cp