annotate man/viper.texi @ 44:8d2a9b52c682 r19-15prefinal

Import from CVS: tag r19-15prefinal
author cvs
date Mon, 13 Aug 2007 08:55:10 +0200
parents 4103f0995bd7
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 % -*-texinfo-*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 \input texinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @comment Using viper.info instead of viper in setfilename breaks DOS.
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
7 @setfilename viper
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
8 @comment @setfilename ../info/viper
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 @comment @setfilename viper.info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 @iftex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 @finalout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 @end iftex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 @titlepage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 @title Viper Is a Package for Emacs Rebels
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 @subtitle a Vi emulator for GNU Emacs 19 and XEmacs 19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 @subtitle June 1996, Viper Version 2.90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 @author Masahiko Sato (VIP 3.5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 @author Aamod Sane (VIP 4.4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 @author Michael Kifer (Viper)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 @page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 @vskip 0pt plus 1fill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 @end titlepage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 @unnumbered Distribution
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 Copyright @copyright{} 1995, 1996 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 Permission is granted to make and distribute verbatim copies of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 this manual provided the copyright notice and this permission notice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 are preserved on all copies.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 @ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 Permission is granted to process this file through TeX and print the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 results, provided the printed document carries copying permission
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 notice identical to this one except for the removal of this paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (this paragraph not being relevant to the printed manual).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 Permission is granted to copy and distribute modified versions of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 manual under the conditions for verbatim copying, provided that the entire
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 resulting derived work is distributed under the terms of a permission
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 notice identical to this one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 Permission is granted to copy and distribute translations of this manual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 into another language, under the same conditions as for modified versions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 @ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 @node Top, Overview,, (DIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 @unnumbered Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 We believe that one or more of the following statements are adequate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 descriptions:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 Viper Is a Package for Emacs Rebels;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 it is a VI Plan for Emacs Rescue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 and/or a venomous VI PERil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 Technically speaking, Viper is a Vi emulation package for GNU Emacs 19 and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 XEmacs 19. Because of its reliance on minor mode keymaps, Viper will not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 work under Emacs 18. Viper implements most Vi and Ex commands. It gives you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 the best of both worlds: Vi keystrokes for editing combined with the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 Emacs environment. Viper also fixes some common complaints with Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 commands. This manual describes Viper, concentrating on the differences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 from Vi and new features of Viper.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 Viper, formerly known as VIP-19, was written by Michael Kifer. It is based
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 on VIP version 3.5 by Masahiko Sato and VIP version 4.4 by Aamod Sane.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 Viper tries to be compatible with these packages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 Viper is intended to be usable without reading this manual --- the defaults
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 are set to make Viper as close to Vi as possible. At startup, Viper will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 try to set the most appropriate default environment for you, based on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 your familiarity with Emacs. It will also tell you the basic GNU Emacs window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 management commands to help you start immediately.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 Although this manual explains how to customize Viper, some basic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 familiarity with Emacs Lisp would be a plus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 It is recommended that you read the Overview node. The other nodes may
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 be visited as needed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 Comments and bug reports are welcome.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 @code{kifer@@cs.emacs.edu} is the current address for Viper bug reports.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 Please use the Ex command @kbd{:submitReport} for this purpose.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 @end ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 * Overview:: Must read to get started
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 * Improvements over Vi:: New features, Improvements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 * Customization:: How to customize Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 * Commands:: Vi and Ex Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 * Key Index:: Index of Vi and Ex Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 * Function Index:: Index of Viper Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 * Variable Index:: Index of Viper Variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 * Package Index:: Index of Packages Mentioned in this Document
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 * Concept Index:: Vi, Ex and Emacs concepts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 * Acknowledgments::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 @iftex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 @unnumbered Introduction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 We believe that one or more of the following statements are adequate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 descriptions:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 Viper Is a Package for Emacs Rebels;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 it is a VI Plan for Emacs Rescue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 and/or a venomous VI PERil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 Technically speaking, Viper is a Vi emulation package for GNU Emacs 19 and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 XEmacs 19. Because of its reliance on minor mode keymaps,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 it will not work under Emacs 18. Viper contains virtually all of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 Vi and Ex functionality and much more. It gives you the best of both
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 worlds: Vi keystrokes for editing combined with the GNU Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 environment. Viper also fixes some common complaints with Vi commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 This manual describes Viper, concentrating on the differences from Vi and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 on the new features of Viper.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 Viper, formerly known as VIP-19, was written by Michael Kifer. It is based
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 on VIP version 3.5 by Masahiko Sato and VIP version 4.4 by Aamod Sane.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 Viper tries to be compatible with these packages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 Viper is intended to be usable without reading this manual --- the defaults
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 are set to make Viper as close to Vi as possible. At startup, Viper will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 attempt to set the most appropriate default environment for you, based on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 your familiarity with Emacs. It will also tell you the basic GNU Emacs window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 management commands to help you start immediately.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 Although this manual explains how to customize Viper, some basic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 familiarity with Emacs Lisp would be a plus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 It is recommended that you read the chapter Overview. The other chapters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 will be useful for customization and advanced usage.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 You should also learn to use the Info on-line hypertext manual system that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 comes with Emacs. This manual can be read as an Info file. Try the command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 @kbd{ESC x info} with vanilla Emacs sometime.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 Comments and bug reports are welcome.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 @code{kifer@@cs.sunysb.edu} is the current address for Viper bug reports.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 Please use the Ex command @kbd{:submitReport} for this purpose.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 @end iftex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 @node Overview,Improvements over Vi,Top,Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 @chapter Overview of Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 Viper is a Vi emulation on top of Emacs. At the same time, Viper provides a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 virtually unrestricted access to Emacs facilities. Perfect compatibility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 with Vi is possible but not desirable. This chapter tells you about the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 Emacs ideas that you should know about, how to use Viper within Emacs and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 some incompatibilities.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 Viper was formerly known as VIP-19, which was
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 a descendant of VIP 3.5 by Masahiko Sato and VIP 4.4 by Aamod Sane.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 * Emacs Preliminaries:: Basic concepts in Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 * Loading Viper:: Loading and Preliminary Configuration.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 * States in Viper:: Viper has four states orthogonal to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 modes in Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 * The Minibuffer:: Command line in Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 * Multiple Files in Viper:: True multiple file handling.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 * Unimplemented Features:: That are unlikely to be implemented.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 @node Emacs Preliminaries, Loading Viper, Overview, Overview
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 @section Emacs Preliminaries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 @cindex buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 @cindex point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 @cindex mark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 @cindex text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 @cindex looking at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 @cindex end (of buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 @cindex end (of line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 @cindex region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 Emacs can edit several files at once. A file in Emacs is placed in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 @dfn{buffer} that usually has the same name as the file. Buffers are also used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 for other purposes, such as shell interfaces, directory editing, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 @xref{Dired,,Directory Editor,emacs,The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 Gnu Emacs Manual}, for an example.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 A buffer has a distinguished position called the @dfn{point}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 A @dfn{point} is always between 2 characters, and is @dfn{looking at}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 the right hand character. The cursor is positioned on the right hand
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 character. Thus, when the @dfn{point} is looking at the end-of-line,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 the cursor is on the end-of-line character, i.e. beyond the last
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 character on the line. This is the default Emacs behavior.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 The default settings of Viper try to mimic the behavior of Vi,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 preventing the cursor from going beyond the last character on the line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 By using Emacs commands directly (such as those bound to arrow keys), it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 possible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 to get the cursor beyond the end-of-line. However, this won't (or shouldn't)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 happen if you restrict yourself to standard Vi keys, unless you modify the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 default editing style. @xref{Customization}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 In addition to the @dfn{point}, there is another distinguished buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 position called the @dfn{mark}. @xref{Mark,,Mark,emacs,The GNU Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 manual}, for more info on the mark. The text between the @dfn{point} and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 @dfn{mark} is called the @dfn{region} of the buffer. For the Viper user,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 this simply means that in addition to the Vi textmarkers a--z, there is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 another marker called @dfn{mark}. This is similar to the unnamed Vi marker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 used by the jump commands (`` and ''), which move the cursor to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 position of the last absolute jump.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 Viper provides access to the region in most
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 text manipulation commands as @kbd{r} and @kbd{R} suffix to commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 that operate on text regions, e.g., @kbd{dr} to delete region, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 @xref{Basics}, for more info.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 @cindex window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 @cindex mode line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 @cindex buffer information
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 @cindex Minibuffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 @cindex command line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 @cindex buffer (modified)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 Emacs divides the screen into tiled @dfn{windows}. You can see the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 contents of a buffer through the window associated with the buffer. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 cursor of the screen is positioned on the character after @dfn{point}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 Every window has a @dfn{mode line} that displays information about the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 You can change the format of the mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 line, but normally if you see @samp{**} at the beginning of a mode line it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 means that the buffer is @dfn{modified}. If you write out the contents of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 a buffer to a file, then the buffer will become not modified. Also if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 you see @samp{%%} at the beginning of the mode line, it means that the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 associated with the buffer is write protected. The mode line will also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 show the buffer name and current major and minor modes (see below).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 A special buffer called @dfn{Minibuffer} is displayed as the last line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 in a Minibuffer window. The Minibuffer window is used for command input
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 output. Viper uses Minibuffer window for @kbd{/} and @kbd{:}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 commands.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 @cindex mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 @cindex keymap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 @cindex local keymap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 @cindex global keymap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 @cindex major mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 @cindex minor mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 An Emacs buffer can have a @dfn{major mode} that customizes Emacs for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 editing text of a particular sort by changing the functionality of the keys.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 Keys are defined using a @dfn{keymap} that records the bindings between
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 keystrokes and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 functions. The @dfn{global keymap} is common to all the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 buffers. Additionally, each buffer has its @dfn{local keymap} that determines the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 @dfn{mode} of the buffer. If a function is bound to some key in the local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 keymap then that function will be executed when you type the key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 If no function is bound to a key in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 local map, however, the function bound to the key in the global map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 will be executed. @xref{Major Modes,Major Modes,Major Modes,emacs,The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 GNU Emacs Manual}, for more information.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 A buffer can also have a @dfn{minor mode}. Minor modes are options that you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 can use or not. A buffer in @code{text-mode} can have @code{auto-fill-mode}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 as minor mode, which can be turned off or on at any time. In Emacs 19, a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 minor mode may have it own keymap, which overrides the local keymap when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 the minor mode is turned on. For more information, @pxref{Minor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 Modes,Minor Modes,Minor Modes,emacs,The GNU Emacs Manual} @refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 @cindex Viper as minor mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 @cindex Control keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 @cindex Meta key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 Viper is implemented as a collection of minor modes. Different minor modes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 are involved when Viper emulates Vi command mode, Vi insert mode, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 You can also turn Viper on and off at any time while in Vi command mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 @xref{States in Viper}, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 more information.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 Emacs uses Control and Meta modifiers. These are denoted as C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 and M, e.g. @kbd{^Z} as @kbd{C-z} and @kbd{Meta-x} as @kbd{M-x}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 The Meta key is usually located on each side of the Space bar; it is used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 in a manner similar to the Control key, e.g., @kbd{M-x} means typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 @kbd{x} while holding the Meta key down.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 For keyboards that do not have a Meta key, @key{ESC} is used as Meta.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 Thus @kbd{M-x} is typed as @kbd{ESC x}. Viper uses @key{ESC} to switch
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
292 from Insert state to Vi state. Therefore Viper defines @kbd{C-\} as its Meta
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 key in Vi state. @xref{Vi State}, for more info.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 Emacs is structured as a lisp interpreter around a C core. Emacs keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 cause lisp functions to be called. It is possible to call these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 functions directly, by typing @kbd{M-x function-name}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 @node Loading Viper, States in Viper, Emacs Preliminaries, Overview
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 @section Loading Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 First, make sure that all six Viper files @file{viper*.el} are somewhere on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 Emacs @dfn{load path}. The load path is a list of directories where Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 looks for its Lisp code; it is similar to Unix environment variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 @var{PATH}. The load path is determined by the Lisp variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 @code{load-path}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 Type @code{C-h v load-path RET} to check the current load path of your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 Emacs. (Here and later, @kbd{RET} stands for carriage return.) If the files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 @file{viper*.el} are not in any directory on the load path, you should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 create your own directory and put it on the load path; then put
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 @file{viper*.el} in that directory. To put a new directory, say
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 @file{~/emacslib}, on your load path, add the following line at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 beginning of your @file{~/.emacs} file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (setq load-path (cons "~/emacslib" load-path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 It is recommended that you compile @file{viper.el} by running
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 make all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 in the directory where Viper was unpacked. The best way to ensure that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 Viper is installed properly is to run
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 make install
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 in the directory where Viper was unpacked. See README in the Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 distribution for the details on which modifications to the make file may be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 necessary.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 Once Viper is settled on the load path,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 the most common way to load it automatically is to include the line:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (require 'viper)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 in your @file{~/.emacs} file. The @file{.emacs} file is placed in your home
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 directory and it will be executed every time you invoke Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 Viper also uses the file @file{~/.vip} for Viper-specific customization.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 If you wish
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 to be in Vi command state whenever this is appropriate, you can include the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 following
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 line in your @file{.vip}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (setq vip-always t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (@xref{Vi State}, for the explanation of Vi mode.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 Once invoked, Viper will arrange to bring up Emacs buffers in Vi state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 whenever this makes sense.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 @xref{Packages that Change Keymaps}, to find out when forcing Vi command state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 on a buffer may be counter-productive.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 Even if your @file{.emacs} and @file{.vip} files do not contain any of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 above lines, you can still load Viper and enter Vi state by typing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 following from within Emacs:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 M-x load-library RET viper RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 M-x viper-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 Ask your local Emacs administrator if this fails to work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 When Emacs first comes up, if you have not specified a file on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 command line, it will show the @samp{*scratch*} buffer, in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 @samp{Lisp Interaction} mode. After you invoke Viper, you can start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 editing files by using @kbd{:e}, @kbd{:vi}, or @kbd{v} commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (@xref{File and Buffer Handling}, for more information on @kbd{v} and other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 new commands that, in many cases, are more convenient than @kbd{:e},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 @kbd{:vi}, and similar old-style Vi commands.)@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 @node States in Viper, The Minibuffer, Loading Viper,Overview
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 @section States in Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 @kindex @kbd{C-z}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 @kindex @kbd{ESC}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 @kindex @kbd{i}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 @cindex Emacs state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 @cindex Vi state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 @cindex Insert state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 @cindex Replace state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 @cindex Ex commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 Viper has four states, Emacs, Vi, Insert, and Replace.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 @table @samp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 @item Emacs state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 This is the mode plain vanilla Emacs is normally in. After you have loaded
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 Viper, @kbd{C-z} will normally take you to Vi command state. Another
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 @kbd{C-z} will take you back to Emacs state. This toggle key can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 changed, @pxref{Customization} You can also type @kbd{M-x viper-mode} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 change to Vi state.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 For users who chose to set their user level to 1 at Viper setup time,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 switching to Emacs state is deliberately made harder in order to not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 confuse the novice user. In this case, @kbd{C-z} will either iconify Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (if Emacs runs as an application under X Windows) or it will stop Emacs (if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 Emacs runs on a dumb terminal or in an Xterm window).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 @item Vi state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 This is the Vi command mode. Any of the Vi commands, such as @kbd{i, o, a},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 @dots{}, will take you to Insert state. All Vi commands may
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 be used in this mode. Most Ex commands can also be used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 For a full list of Ex commands supported by Viper, type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 @kbd{:} and then @kbd{TAB}. To get help on any issue, including the Ex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 commands, type @kbd{:help}. This will invoke Viper Info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (if it is installed). Then typing @kbd{i} will prompt you for a topic to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 search in the index. Note, to search for Ex commands in the index, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 should start them with a ``@kbd{:}'', e.g., @kbd{:WW}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 @item Insert state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 Insert state is the Vi insertion mode. @kbd{ESC} will take you back to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 Vi state. Insert state editing can be done, including auto-indentation. By
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 default, Viper disables Emacs keybindings in Insert state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 @item Replace state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 Commands like @kbd{cw} invoke the Replace state. When you cross the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 boundary of a replacement region (usually designated via a @samp{$} sign),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 it will automatically change to Insert state. You do not have to worry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 about it. The key bindings remain practically the same as in Insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 state. If you type ESC, Viper will switch to Vi command mode, terminating the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 replacement state. @refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 @cindex mode line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 The modes are indicated on the @dfn{mode line} as <E>, <I>, <V>, and <R>,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 so that the multiple modes do not confuse you. Most of your editing can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 done in Vi and Insert states. Viper will try to make all new buffers be in Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 state, but sometimes they may come up in Emacs state. @kbd{C-z}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 will take you to Vi state in such a case. In some major modes, like Dired,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 Info, Gnus, etc., you should not switch to Vi state (and Viper will not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 attempt to do so) because these modes are not intended for text editing and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 many of the Vi keys have special meaning there. If you plan to read news,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 browse directories, read mail, etc., from Emacs (which you should start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 doing soon!), you should learn about the meaning of the various keys in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 those special modes (typing @kbd{C-h m} in a buffer provides
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 help with key bindings for the major mode of that buffer).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
445 If you switch to Vi in Dired or similar modes---no harm is done. It is just
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
446 that the special keybindings provided by those modes will be temporarily
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
447 overshadowed by Viper's bindings. Switching back to Viper's Emacs state
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
448 will revive the environment provided by the current major mode.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 States in Viper are orthogonal to Emacs major modes, such as C mode or Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 mode. You can turn Viper on and off for any Emacs state. When Viper is turned
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 on, Vi state can be used to move around. In Insert state, the bindings for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 these modes can be accessed. For beginners (users at Viper levels 1 and 2),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 these bindings are suppressed in Insert state, so that new users are not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 confused by the Emacs states. Note that unless you allow Emacs bindings in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 Insert state, you cannot do many interesting things, like language
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 sensitive editing. For the novice user (at Viper level 1), all major mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 bindings are turned off in Vi state as well. This includes the bindings for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 key sequences that start with @kbd{C-c}, which practically means that all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 major mode bindings are supported. @xref{Customization}, to find out how
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 to allow Emacs keys in Insert state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 * Emacs State:: This is the state you should learn more about when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 you get up to speed with Viper.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 * Vi State:: Vi commands are executed in this state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 * Insert State:: You can enter text, and also can do sophisticated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 editing if you know enough Emacs commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 * Replace State:: Like Insert mode, but it is invoked via the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 replacement commands, such as cw, C, R, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 @node Emacs State, Vi State, States in Viper, States in Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 @subsection Emacs State
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 @kindex @kbd{C-z}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 @cindex Emacs state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 You will be in this mode only by accident (hopefully). This is the state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 Emacs is normally in (imagine!!). Now leave it as soon as possible by
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
482 typing @kbd{C-z}. Then you will be in Vi state (sigh of relief) :-).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 Emacs state is actually a Viperism to denote all the major and minor modes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (@xref{Emacs Preliminaries}) other than Viper that Emacs can be in. Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 can have several modes, such as C mode for editing C programs, LaTeX mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 for editing LaTeX documents, Dired for directory editing, etc. These are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 major modes, each with a different set of key-bindings. Viper states are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 orthogonal to these Emacs major modes. The presence of these language
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 sensitive and other modes is a major win over Vi. @xref{Improvements over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 Vi}, for more.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 The bindings for these modes can be made available in the Viper Insert state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 as well as in Emacs state. Unless you specify your user level as 1 (a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 novice), all major mode key sequences that start with @kbd{C-x} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 @kbd{C-c} are also available in Vi state. This is important because major
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 modes designed for editing files, such as cc-mode or latex-mode, use key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 sequences that begin with @kbd{C-x} and @kbd{C-c}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 There is also a key that lets you temporarily escape to Vi command state
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
501 from Emacs or Insert states: typing @kbd{C-c \} will let you execute a
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
502 single Vi command while staying in Viper's Emacs or Insert state.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
503 In Insert state, the same can also be achieved by typing @kbd{C-z}.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
504
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 @node Vi State, Insert State, Emacs State, States in Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 @subsection Vi State
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 @cindex Vi state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 This is the Vi command mode. When Viper is in Vi state, you will see the sign
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 <V> in the mode line. Most keys will work as in Vi. The notable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 exceptions are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 @item C-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 @kindex @kbd{C-x}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 @kbd{C-x} is used to invoke Emacs commands, mainly those that do window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 management. @kbd{C-x 2} will split a window, @kbd{C-x 0} will close a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 window. @kbd{C-x 1} will close all other windows. @kbd{C-xb} is used to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 switch buffers in a window, and @kbd{C-xo} to move through windows.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 These are about the only necessary keystrokes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 For the rest, see the GNU Emacs Manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 @item C-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 @kindex @kbd{C-c}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 For user levels 2 and higher, this key serves as a prefix key for the key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 sequences used by various major modes. For users at Viper level 1, @kbd{C-c}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 simply beeps.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 @item C-g and C-]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 @kindex @kbd{C-g}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 @kindex @kbd{C-]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 These are the Emacs @samp{quit} keys.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 There will be cases where you will have to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 use @kbd{C-g} to quit. Similarly, @kbd{C-]} is used to exit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 @samp{Recursive Edits} in Emacs for which there is no comparable Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 functionality and no key-binding. Recursive edits are indicated by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 @samp{[]} brackets framing the modes on the mode line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 @xref{Recursive Edit,Recursive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 Edit,Recursive Edit,emacs,The GNU Emacs Manual}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 At user level 1, @kbd{C-g} is bound to @code{vip-info-on-file}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 function instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 @refill
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
546 @item C-\
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
547 @kindex @kbd{C-\}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 @cindex Meta key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 Viper uses @kbd{ESC} as a switch between Insert and Vi states. Emacs uses
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 @kbd{ESC} for Meta. We need a Meta key to call the Meta key functions
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
552 such as @kbd{M-x function name}. This role is played by the key @kbd{C-\}.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
553 Thus, to
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
554 get @kbd{M-x}, you should type @kbd{C-\ x} (if the keyboard has no Meta key).
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
555 This works both in the Vi state and the Insert state.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
556 Alternatively, you can use @kbd{\ ESC} in Vi state to simulate the meta
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
557 key.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 It is possible to use @kbd{ESC} as Meta, but then you cannot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 press @kbd{ESC} multiple times in Vi state. @xref{Customization}, to find
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 out how to rebind ESC to be Meta.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 Other differences are mostly improvements. The ones you should know
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 about are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 @table @samp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 @item Undo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 @kindex @kbd{u}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 @kbd{u} will undo. Undo can be repeated by the @kbd{.} key. Undo itself
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 can be undone. Another @kbd{u} will change the direction. The presence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 of repeatable undo means that @kbd{U}, undoing lines, is not very
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 important. Therefore, @kbd{U} also calls @code{vip-undo}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 @cindex multiple undo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 @cindex undo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 @item Counts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 Most commands, @kbd{~}, @kbd{[[}, @kbd{p}, @kbd{/}, @dots{}, etc., take counts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 @comment ]] Just to balance parens
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 @item Regexps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 Viper uses Emacs Regular Expressions for searches. These are a superset of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 Vi regular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 expressions, excepting the change-of-case escapes @samp{\u}, @samp{\L},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 @dots{}, etc. @xref{Regular Expressions,,Regular Expressions,emacs,The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 GNU Emacs Manual}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 Files specified to @kbd{:e} use @code{csh} regular expressions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (globbing, wildcards, what have you).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 However, the function @code{vip-toggle-search-style}, bound to @kbd{C-c /},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 lets the user switch from search with regular expressions to plain vanilla
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 search and vice versa. It also lets one switch from case-sensitive search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 to case-insensitive and back.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 @xref{Viper Specials}, for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 @cindex regular expressions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 @cindex vanilla search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 @cindex case-sensitive search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 @cindex case-insensitive search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 @kindex @kbd{C-c /}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 @item Ex commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 @cindex Ex commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 The current working directory of a buffer is automatically inserted in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 minibuffer if you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 type @kbd{:e} then space.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 Absolute filenames are required less often in Viper.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 For path names,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 Emacs uses a convention that is slightly different from that of Unix.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 It is designed to minimize the need for deleting path names that Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 provides in its prompts. (This is usually convenient, but occasionally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 the prompt may suggest a wrong path name for you.) If you see a prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 @kbd{/usr/foo/} and you wish to edit the file @kbd{~/.vip}, you don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 have to erase the prompt. Instead, simply continue typing what you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 need. Emacs will interpret @kbd{/usr/foo/~/.vip} correctly. Similarly,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 if the prompt is @kbd{~/foo/} and you need to get to @kbd{/bar/file}, keep
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 typing. Emacs interprets @kbd{~/foo//bar/} as @kbd{/bar/file}, since when it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 sees @samp{//}, it understands that @kbd{~/foo/} is to be discarded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 The command @kbd{:cd} will change the default directory for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 current buffer. The command @kbd{:e} will interpret the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 filename argument in @code{csh}. @xref{Customization}, if you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 want to change the default shell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 The command @kbd{:next} takes counts from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 @kbd{:args}, so that @kbd{:rew} is obsolete. Also, @kbd{:args} will show only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 the invisible files (i.e., those that are not currently seen in Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 windows).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 When applicable, Ex commands support file completion and history. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 means that by typing a partial file name and then @kbd{TAB}, Emacs will try
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 to complete the name or it will offer a menu of possible completions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 This works similarly to Tcsh and extends the behavior of Csh. While Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 is waiting for a file name, you can type @kbd{M-p} to get the previous file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 name you typed. Repeatedly typing @kbd{M-p} and @kbd{M-n} will let you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 browse through the file history.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 Like file names, partially typed Ex commands can be completed by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 @kbd{TAB}, and Viper keeps the history of Ex commands. After typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 @kbd{:}, you can browse through the previously entered Ex commands by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 typing @kbd{M-p} and @kbd{M-n}. Viper tries to rationalize when it puts Ex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 commands on the history list. For instance, if you typed @kbd{:w! foo},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 only @kbd{:w!} will be placed on the history list. This is because the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 last history element is the default that can be invoked simply by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 @kbd{: RET}. If @kbd{:w! foo} were placed on the list, it would be all to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 easy to override valuable data in another file. Reconstructing the full
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 command, @kbd{:w! foo}, from the history is still not that hard, since Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 has a separate history for file names. By typing @kbd{: M-p}, you will get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 @kbd{:w!} in the Minibuffer. Then, repeated @kbd{M-p} will get you through
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 the file history, inserting one file name after another.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 In contrast to @kbd{:w! foo}, if the command were @kbd{:r foo}, the entire
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 command will appear in the history list. This is because having @kbd{:r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 alone as a default is meaningless, since this command requires a file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 argument.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 @refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 As Vi, Viper's destructive commands can be re-executed by typing `@kbd{.}'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 However, in addition, Viper keeps track of the history of such commands. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 history can be perused by typing @kbd{C-c M-p} and @kbd{C-c M-n}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 Having found the appropriate command, it can be then executed by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 `@kbd{.}'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 @xref{Improvements over Vi}, for more information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 @node Insert State, Replace State, Vi State, States in Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 @subsection Insert State
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 @cindex Insert state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 To avoid confusing the beginner (at Viper level 1 and 2), Viper makes only the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 standard Vi keys available in Insert state. The implication is that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 Emacs major modes cannot be used Insert state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 It is strongly recommended that as soon as you are comfortable, make the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 Emacs state bindings visible (by changing your user level to 3 or higher).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 @xref{Customization},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 to see how to do this.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 Once this is done, it is possible to do quite a bit of editing in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 Insert state. For instance, Emacs has a @dfn{yank} command, @kbd{C-y},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 which is similar to Vi's @kbd{p}. However, unlike @kbd{p}, @kbd{C-y} can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 used in Insert state of Viper. Emacs also has a kill ring where it keeps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 pieces of text you deleted while editing buffers. The command @kbd{M-y} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 used to delete the text previously put back by Emacs' @kbd{C-y} or by Vi's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 @kbd{p} command and reinsert text that was placed on the kill-ring earlier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 This works both in Vi and Insert states.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 In Vi state, @kbd{M-y} is a much better alternative to the usual Vi's way
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 of recovering the 10 previously deleted chunks of text. In Insert state,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 use this as follows. Suppose you deleted a piece of text and now you need
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 to re-insert it while editing in Insert mode. The key @kbd{C-y} will put
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 back the most recently deleted chunk. If this is not what you want, type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 @kbd{M-y} repeatedly and, hopefully, you will find the chunk you want.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 Finally, in Insert and Replace states, Viper provides the history of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 pieces of text inserted in previous insert or replace commands. These
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 strings of text can be recovered by repeatedly typing @kbd{C-c M-p} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 @kbd{C-c M-n} while in Insert or Replace state. (This feature is disabled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 in the minibuffer: the above keys are usually bound to other histories,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 which are more appropriate in the minibuffer.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 @cindex Meta key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
703 You can call Meta functions from Insert state. As in Vi state, the Meta key
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
704 is @kbd{C-\}. Thus @kbd{M-x} is typed as @kbd{C-\ x}.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 Other Emacs commands that are useful in Insert state are @kbd{C-e}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 and @kbd{C-a}, which move the cursor to the end and the beginning of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 current line, respectively. You can also use @kbd{M-f} and @kbd{M-b},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 which move the cursor forward (or backward) one word.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 If your display has a Meta key, these functions are invoked by holding the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 Meta key and then typing @kbd{f} and @kbd{b}, respectively. On displays
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 without the Meta key, these functions are invoked by typing
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
713 @kbd{C-\ f} and @kbd{C-\ b} (@kbd{C-\} simulates the Meta key in Insert
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 state, as explained above).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 When Viper is in Insert state, you will see <I> in the mode line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 @node Replace State,, Insert State, States in Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 @subsection Replace State
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 @cindex Replace state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 This state is entered through Vi replacement commands, such as @kbd{C},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 @kbd{cw}, etc., or by typing @kbd{R}. In Replace state, Viper puts <R> in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 mode line to let you know which state is in effect. If Replace state is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 entered through @kbd{R}, Viper stays in that state until the user hits ESC.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 If this state is entered via the other replacement commands, then Replace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 state is in effect until you hit @kbd{ESC} or until you cross the rightmost
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 boundary of the replacement region. In the latter case, Viper changes its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 state from Replace to Insert (which you will notice by the change in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 mode line).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 Since Viper runs under Emacs, it is possible to switch between buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 while in Replace state. You can also move the cursor using the arrow keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (even on dumb terminals!) and the mouse. Because of this freedom (which is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 unattainable in regular Vi), it is possible to take the cursor outside the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 replacement region. (This may be necessary for several reasons, including
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 the need to enable text selection and region-setting with the mouse.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 The issue then arises as to what to do when the user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 hits the ESC key. In Vi, this would cause the text between cursor and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 the end of the replacement region to be deleted. But what if, as is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 possible in Viper, the cursor is not inside the replacement region?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 To solve the problem, Viper keeps track of the last cursor position while it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 was still inside the replacement region. So, in the above situation, Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 would delete text between this position and the end of the replacement
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 @node The Minibuffer,Multiple Files in Viper, States in Viper, Overview
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 @section The Minibuffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 @cindex Minibuffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 The Minibuffer is where commands are entered in. Editing can be done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 by commands from Insert state, namely:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 @item C-h
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 Backspace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 @item C-w
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 Delete Word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 @item C-u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 Erase line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 @item C-v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 Quote the following character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 @item RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 Execute command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 @item C-g and C-]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 Emacs quit and abort keys. These may be necessary. @xref{Vi State}, for an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 explanation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 @item M-p and M-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 These keys are bound to functions that peruse minibuffer history. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 precise history to be perused depends on the context. It may be the history
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 of search strings, Ex commands, file names, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 Most of the Emacs keys are functional in the Minibuffer. While in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 Minibuffer, Viper tries to make editing resemble Vi's behavior when the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 latter is waiting for the user to type an Ex command. In particular, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 can use the regular Vi commands to edit the Minibuffer. You can switch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 between the Vi state and Insert state at will, and even use the replace mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 Initially, the Minibuffer comes up in Insert state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 Some users prefer plain Emacs bindings in the Minibuffer. To this end, set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 @code{vip-vi-style-in-minibuffer} to @code{nil} in @file{.vip}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 @xref{Customization}, to learn how to do this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 When the Minibuffer changes Viper states, you will notice that the appearance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 of the text there changes as well. This is useful because the Minibuffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 has no mode line to tell which Vi state it is in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 The appearance of the text in the Minibuffer can be changed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 @xref{Viper Specials}, for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 @node Multiple Files in Viper,Unimplemented Features,The Minibuffer,Overview
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 @section Multiple Files in Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 @cindex multiple files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 @cindex managing multiple files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 Viper can edit multiple files. This means, for example that you never need
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 to suffer through @code{No write since last change} errors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 Some Viper elements are common over all the files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 @table @samp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 @item Textmarkers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 @cindex markers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 @cindex textmarkers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 Textmarkers remember @emph{files and positions}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 If you set marker @samp{a} in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 file @file{foo}, start editing file @file{bar} and type @kbd{'a}, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 @emph{YOU WILL SWITCH TO FILE @file{foo}}. You can see the contents of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 textmarker using the Viper command @kbd{[<a-z>} where <a-z> are the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 textmarkers, e.g., @kbd{[a} to view marker @samp{a} .@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 @item Repeated Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 Command repetitions are common over files. Typing @kbd{!!} will repeat the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 last @kbd{!} command whichever file it was issued from.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 Typing @kbd{.} will repeat the last command from any file, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 searches will repeat the last search. Ex commands can be repeated by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 @kbd{:RET}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 Note: in some rare cases, that @kbd{:RET} may do something dangerous.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 However, usually its effect can be undone by typing @kbd{u}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 @item Registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 @cindex registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 Registers are common to files. Also, text yanked with @kbd{y} can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 put back (@kbd{p}) into any file. The Viper command @kbd{]<a-z>}, where <a-z> are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 the registers, can be used to look at the contents of a register, e.g.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 type @kbd{]a} to view register @samp{a}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 There is one difference in text deletion that you should be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 aware of. This difference comes from Emacs and was adopted in Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 because we find it very useful. In Vi, if you delete a line, say, and then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 another line, these two deletions are separated and are put back
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 separately if you use the @samp{p} command. In Emacs (and Viper), successive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 series of deletions that are @emph{not interrupted} by other commands are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 lumped together, so the deleted text gets accumulated and can be put back
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 as one chunk. If you want to break a sequence of deletions so that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 newly deleted text could be put back separately from the previously deleted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 text, you should perform a non-deleting action, e.g., move the cursor one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 character in any direction.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 @item Absolute Filenames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 @cindex absolute paths
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 The current directory name for a file is automatically prepended to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 file name in any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 @kbd{:e}, @kbd{:r}, @kbd{:w}, etc., command (in Emacs, each buffer has a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 current directory).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 This directory is inserted in the Minibuffer once you type space after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 @kbd{:e, r}, etc. Viper also supports completion of file names and Ex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 commands (@kbd{TAB}), and it keeps track of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 command and file history (@kbd{M-p}, @kbd{M-n}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 Absolute filenames are required less
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 often in Viper.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 You should be aware that Emacs interprets @kbd{/foo/bar//bla} as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 @kbd{/bla} and @kbd{/foo/~/bar} as @kbd{~/bar}. This is designed to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 minimize the need for erasing path names that Emacs suggests in its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 prompts, if a suggested path name is not what you wanted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 The command @kbd{:cd} will change the default directory for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 current Emacs buffer. The Ex command @kbd{:e} will interpret the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 filename argument in @samp{csh}, by default. @xref{Customization}, if you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 want to change this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 Currently undisplayed files can be listed using the @kbd{:ar} command. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 command @kbd{:n} can be given counts from the @kbd{:ar} list to switch to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 other files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 @node Unimplemented Features,,Multiple Files in Viper,Overview
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 @section Unimplemented Features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 Unimplemented features include:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 @kbd{:ab} and @kbd{:una} are not implemented.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 Both @kbd{:map} and @kbd{:ab} are considered obsolete, since Emacs has much
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 more powerful facilities for defining keyboard macros and abbreviations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 @kbd{:set option?} is not implemented. The current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 @kbd{:set} can also be used to set Emacs variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 @kbd{:se list} requires modification of the display code for Emacs, so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 it is not implemented.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 A useful alternative is @code{cat -t -e file}. Unfortunately, it cannot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 be used directly inside Emacs, since Emacs will obdurately change @samp{^I}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 back to normal tabs.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 @node Improvements over Vi, Customization, Overview, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 @chapter Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 Some common problems with Vi and Ex have been solved in Viper. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 includes better implementation of existing commands, new commands, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 the facilities provided by Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 * Basics:: Basic Viper differences, Multi-file effects.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 * Undo and Backups:: Multiple undo, auto-save, backups and changes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 * History:: History for Ex and Vi commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 * Macros and Registers:: Keyboard Macros (extended ".") @@reg execution.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 * Completion:: Filename and Command Completion for Ex.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 * Improved Search:: Incremental Search and Buffer Content Search.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 * Abbreviation Facilities:: Normal Abbrevs, Templates, and Dynamic Abbrevs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 * Movement and Markers:: Screen Editor movements, viewing textmarkers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 * New Commands:: Commands that do not exist in Vi.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 * Useful Packages:: A Sampling of some Emacs packages, and things
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 you should know about.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 @node Basics, Undo and Backups, Improvements over Vi, Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 @section Basics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 The Vi command set is based on the idea of combining motion commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 with other commands. The motion command is used as a text region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 specifier for other commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 We classify motion commands into @dfn{point commands} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 @dfn{line commands}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 @cindex point commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 The point commands are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 @quotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 @kbd{h}, @kbd{l}, @kbd{0}, @kbd{$}, @kbd{w}, @kbd{W}, @kbd{b}, @kbd{B},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 @kbd{e}, @kbd{E}, @kbd{(}, @kbd{)}, @kbd{/}, @kbd{?}, @kbd{`}, @kbd{f},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 @kbd{F}, @kbd{t}, @kbd{T}, @kbd{%}, @kbd{;}, @kbd{,}, @kbd{^}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 @end quotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 @cindex line commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 The line commands are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 @quotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 @kbd{j}, @kbd{k}, @kbd{+}, @kbd{-}, @kbd{H}, @kbd{M}, @kbd{L}, @kbd{@{},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 @kbd{@}}, @kbd{G}, @kbd{'}, @kbd{[[}, @kbd{]]}, @kbd{[]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 @end quotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 @cindex region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 @cindex region specification
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 @cindex expanding (region)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 @cindex describing regions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 @cindex movement commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 If a point command is given as an argument to a modifying command, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 region determined by the point command will be affected by the modifying
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 command. On the other hand, if a line command is given as an argument to a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 modifying command, the region determined by the line command will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 enlarged so that it will become the smallest region properly containing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 region and consisting of whole lines (we call this process @dfn{expanding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 the region}), and then the enlarged region will be affected by the modifying
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 Text Deletion Commands (@xref{Deleting Text}), Change commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 (@xref{Changing Text}), even Shell Commands (@xref{Shell Commands})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 use these commands to describe a region of text to operate on.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 Thus, type @kbd{dw} to delete a word, @kbd{>@}} to shift a paragraph, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 @kbd{!'afmt} to format a region from @samp{point} to textmarker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 @samp{a}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 @cindex r and R region specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 Viper adds the region specifiers @samp{r} and @samp{R}. Emacs has a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 special marker called @dfn{mark}. The text-area between the current cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 position @dfn{point} and the @dfn{mark} is called the @dfn{region}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 @samp{r} specifies the raw region and @samp{R} is the expanded region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 (i.e., the minimal contiguous chunk of full lines that contains the raw
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 region).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 @kbd{dr} will now delete the region, @kbd{>r} will shift it, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 @kbd{r,R} are not motion commands, however. The special mark is set by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 @kbd{m.} and other commands. @xref{Marking}, for more info.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 Viper also adds counts to most commands for which it would make sense.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 In the Overview chapter, some Multiple File issues were discussed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 (@xref{Multiple Files in Viper}). In addition to the files, Emacs has
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 buffers. These can be seen in the @kbd{:args} list and switched using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 @kbd{:next} if you type @kbd{:set ex-cycle-through-non-files t}, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 specify @code{(setq ex-cycle-through-non-files t)} in your @file{.vip}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 file. @xref{Customization}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 @node Undo and Backups, History, Basics, Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 @section Undo and Backups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 @cindex undo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 Viper provides multiple undo. The number of undo's and the size is limited
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 by the machine. The Viper command @kbd{u} does an undo. Undo can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 repeated by typing @kbd{.} (a period). Another @kbd{u} will undo the undo,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 and further
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 @kbd{.} will repeat it. Typing @kbd{u} does the first undo, and changes the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 direction.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 @cindex backup files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 @cindex auto save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 Since the undo size is limited, Viper can create backup files and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 auto-save files. It will normally do this automatically. It is possible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 to have numbered backups, etc. For details, @pxref{Backup,,Backup and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 Auto-Save,emacs,The GNU Emacs Manual} @refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 @comment [ balance parens
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 @cindex viewing registers and markers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 @cindex registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 @cindex markers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 @cindex textmarkers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 The results of the 9 previous changes are available in the 9 numeric
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 registers, as in Vi. The extra goody is the ability to @emph{view} these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 registers, in addition to being able to access them through @kbd{p} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 @kbd{M-y} (@xref{Insert State}, for details.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 The Viper command @kbd{] register} will display the contents of any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 register, numeric or alphabetical. The related command @kbd{[ textmarker}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 will show the text around the textmarker. @samp{register} and @samp{textmarker}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 can be any letters from a through z.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 @comment ] balance parens
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 @node History, Macros and Registers, Undo and Backups,Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 @section History
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 @cindex history
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 @cindex Minibuffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 History is provided for Ex commands, Vi searches, file names, pieces of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 text inserted in earlier commands that use Insert or Replace state, and for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 destructive commands in Vi state. These are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 useful for fixing those small typos that screw up searches and @kbd{:s},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 and for eliminating routine associated with repeated typing of file names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 or pieces of text that need to be inserted frequently.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 At the @kbd{:} or @kbd{/} prompts in the Minibuffer, you can do the following:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 @item M-p and M-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 To move to previous and next history items. This causes the history
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 items to appear on the command line, where you can edit them, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 simply type Return to execute.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 @item M-r and M-s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 To search backward and forward through the history.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 @item RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 Type RET to accept a default (which is displayed in the prompt).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 The history of insertions can be perused by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 typing @kbd{C-c M-p} and @kbd{C-c M-n} while in Insert or Replace state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 The history of destructive Vi commands can be perused via the same keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 when Viper is in Vi state. @xref{Viper Specials}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 All Ex commands have a file history. For instance, typing @kbd{:e}, space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 and then @kbd{M-p} will bring up the name of the previously typed file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 name. Repeatedly typing @kbd{M-p}, @kbd{M-n}, etc., will let you browse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 through the file history.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 Similarly, commands that have to do with switching buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 have a buffer history, and commands that expect strings or regular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 expressions keep a history on those items.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 @node Macros and Registers,Completion,History,Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 @section Macros and Registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 @cindex keyboard macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 @cindex macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 @cindex registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 @cindex register execution
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 Viper facilitates the use of Emacs-style keyboard macros. @kbd{@@#} will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 start a macro definition. As you type, the commands will be executed, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 remembered (This is called ``learn mode'' in some editors.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 @kbd{@@register} will complete the macro, putting it into @samp{register},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 where @samp{register} is any character from @samp{a} through @samp{z}. Then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 you can execute this macro using @kbd{@@register}. It is, of course,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 possible to yank some text into a register and execute it using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 @kbd{@@register}. Typing @kbd{@@@@}, @kbd{@@RET}, or @kbd{@@LF} will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 execute the last macro that was executed using @kbd{@@register}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077 Viper will automatically lowercase the register, so that pressing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 @kbd{SHIFT} key for @kbd{@@} will not create problems. This is for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 @kbd{@@} macros and @kbd{"p} @emph{only}. In the case of @kbd{y},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 @kbd{"Ayy} will append to @emph{register a}. For @kbd{[,],',`}, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 is an error to use a Uppercase register name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 @comment [ balance parens
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 @cindex viewing registers and markers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086 The contents of a register can be seen by @kbd{]register}. (@kbd{[textmarker}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 will show the contents of a textmarker).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 @comment ] balance parens
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 @cindex last keyboard macro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 The last keyboard macro can also be executed using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 @kbd{*}, and it can be yanked into a register using @kbd{@@!register}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 This is useful for Emacs style keyboard macros defined using @kbd{C-x(}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 and @kbd{C-x)}. Emacs keyboard macros have more capabilities.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 @xref{Keyboard Macros,,Keyboard Macros,emacs, The GNU Emacs Manual}, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 details.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 Keyboard Macros allow an interesting form of Query-Replace:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 @kbd{/pattern} or @kbd{n} to go to the next pattern (the query), followed by a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 Keyboard Macro execution @kbd{@@@@} (the replace).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103 Viper also provides Vi-style macros. @xref{Vi Macros}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 @node Completion, Improved Search, Macros and Registers, Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 @section Completion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 @cindex completion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 Completion is done when you type @kbd{TAB}. The Emacs completer does not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 grok wildcards in filenames. Once you type a wildcard, the completer will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 no longer work for that path. Remember that Emacs interprets a file name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 of the form @kbd{/foo//bar} as @kbd{/bar} and @kbd{/foo/~/bar} as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 @kbd{~/bar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 @node Improved Search, Abbreviation Facilities, Completion, Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 @section Improved Search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 @cindex buffer search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 @cindex word search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 Viper provides buffer search, the ability to search the buffer for a region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 under the cursor. You have to turn this on in @file{.vip} either by calling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 (vip-buffer-search-enable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131 or by setting @code{vip-buffer-search-char} to, say, @kbd{f3}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 (setq vip-buffer-search-char [f3])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137 If the user calls @code{vip-buffer-search-enable} explicitly (the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 method), then @code{vip-buffer-search-char} will be set to @kbd{g}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 Regardless of how this feature is enabled, the key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 @code{vip-buffer-search-char} will take movement commands, like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 @kbd{w,/,e}, to find a region and then search for the contents of that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 region. This command is very useful for searching for variable names, etc.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 in a program. The search can be repeated by @kbd{n} or reversed by @kbd{N}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 @cindex incremental search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 Emacs provides incremental search. As you type the string in, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 cursor will move to the next match. You can snarf words from the buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 as you go along. Incremental Search is normally bound to @kbd{C-s} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 @kbd{C-r}. @xref{Customization}, to find out how to change the bindings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 of @kbd{C-r or C-s}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 For details, @pxref{Incremental Search,,Incremental
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 Search,emacs,The GNU Emacs Manual} @refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 @cindex query replace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 Viper also provides a query replace function that prompts through the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 Minibuffer. It is invoked by the @kbd{Q} key in Vi state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 @cindex mouse search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 On a window display, Viper supports mouse search, i.e., you can search for a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 word by clicking on it. @xref{Viper Specials}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 Finally, on a window display, Viper highlights search patterns as it finds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 them. This is done through what is known as @emph{faces} in Emacs. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 variable that controls how search patterns are highlighted is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 @code{vip-search-face}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 If you don't want any highlighting at all, put
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 @example
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1171 (setq vip-search-face 'default)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 @vindex @code{vip-search-face}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 in @file{~/.vip}. If you want to change how patterns are highlighted, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 will have to set the variable @code{vip-search-face} to some other face,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 such as @code{highlight}. If none of the existing faces fits the bill, you
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1178 would have to create your own. Further details on faces can be found
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 in the Emacs Lisp Manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 @node Abbreviation Facilities,Movement and Markers,Improved Search,Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 @section Abbreviation Facilities
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 @cindex abbrevs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 It is possible in Emacs to define abbrevs based on the contents of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 Sophisticated templates can be defined using the Emacs abbreviation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 facilities. @xref{Abbrevs,,Abbreviations,emacs,The GNU Emacs Manual}, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 @cindex dynamic abbrevs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 Emacs also provides Dynamic Abbreviations. Given a partial word, Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 will search the buffer to find an extension for this word. For instance,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 one can type @samp{Abbreviations} by typing @samp{A}, followed by a keystroke
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 that completed the @samp{A} to @samp{Abbreviations}. Repeated typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 will search further back in the buffer, so that one could get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 @samp{Abbrevs} by repeating the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 keystroke, which appears earlier in the text. Emacs binds this to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 @kbd{ESC /}, so you will have to find a key and bind the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 @code{dabbrev-expand} to that key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 Facilities like this make Vi's @kbd{:ab} command obsolete.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 @node Movement and Markers, New Commands, Abbreviation Facilities, Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 @section Movement and Markers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 @cindex Ex style motion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 @cindex line editor motion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 Viper can be set free from the line--limited movements in Vi, such as @kbd{l}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 refusing to move beyond the line, @kbd{ESC} moving one character back,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 etc. These derive from Ex, which is a line editor. If your @file{.vip}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 contains
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 @code{(setq vip-ex-style-motion nil)}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 the motion will be a true screen editor motion. One thing you must then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 watch out for is that it is possible to be on the end-of-line character.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 The keys @kbd{x} and @kbd{%} will still work correctly, i.e., as if they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 were on the last character.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 @vindex @code{vip-syntax-preference}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 @cindex syntax table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 The word-movement commands @kbd{w}, @kbd{e}, etc., and the associated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 deletion/yanking commands, @kbd{dw}, @kbd{yw}, etc., can be made to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 understand Emacs syntax tables. If the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 @code{vip-syntax-preference} is set to @code{'strict-vi} (the default) then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 the meaning of @emph{word} is the same as in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 Vi. However, if the value is @code{'reformed-vi} then the alphanumeric
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 symbols will be those specified by the current Emacs syntax table (which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 may be different for different major modes) plus the underscore symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 @code{_}. The user can also specify the value @code{'emacs}, which would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 make Viper use exactly the Emacs notion of word. In particular, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 underscore may not be part of a word. Finally, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 @code{vip-syntax-preference} is set to @code{'extended}, Viper words would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 consist of characters that are classified as alphanumeric @emph{or} as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 parts of symbols. This is convenient for writing programs and in many other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 situations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 @code{vip-syntax-preference} is a local variable, so it can have different
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 values for different major modes. For instance, in programming modes it can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 have the value @code{'extended}. In text modes where words contain special
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 characters, such as European (non-English) letters, Cyrillic letters, etc.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 the value can be @code{'reformed-vi} or @code{'emacs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 Changes to @code{vip-syntax-preference} should be done in the hooks to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 various major modes. Furthermore, for these changes to take effect, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 should execute @code{(vip-update-alphanumeric-class)} right after changing
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1254 the value of @code{vip-syntax-preference}.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 The above discussion of the meaning of Viper's words concerns only Viper's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257 movement commands. In regular expressions, words remain the same as in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 Emacs. That is, the expressions @code{\w}, @code{\>}, @code{\<}, etc., use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 Emacs' idea of what is a word, and they don't look into the value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 variable @code{vip-syntax-preference}. This is because Viper doesn't change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 syntax tables in fear of upsetting the various major modes that set these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 tables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 @cindex textmarkers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 Textmarkers in Viper remember the file and the position, so that you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 switch files by simply doing @kbd{'a}. If you set up a regimen for using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 Textmarkers, this is very useful. Contents of textmarkers can be viewed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 by @kbd{[marker}. (Contents of registers can be viewed by @kbd{]register}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 @node New Commands, Useful Packages, Movement and Markers, Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 @section New Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274 These commands have no Vi analogs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 @item C-x, C-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 @kindex @kbd{C-x}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 @kindex @kbd{C-c}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 @kbd{C-x} will exit from Vi state and return to Emacs state
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1281 @emph{temporarily}. If you hit one of these keys, Emacs will believe
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 that you hit that key in Emacs state. For example, if you hit @kbd{C-x}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 followed by @kbd{2}, then the current window will be split into 2 and you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 will be in Vi state again. Except for novice users, @kbd{C-c} is also set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 to temporarily escape to Emacs and execute a command from the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 major mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 @kbd{ESC} will do the same, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 you configure @key{ESC} as Meta by setting @code{vip-no-multiple-ESC} to nil
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1289 in @file{.vip}. @xref{Customization}. @kbd{C-\}
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1290 in Insert or Vi states will make Emacs think @kbd{Meta} has been hit.@refill
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 @item \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 @kindex @kbd{\}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 Escape to Emacs to execute a single Emacs command. For instance, @kbd{\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 ESC} will act like a Meta key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 @item Q
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 @kindex @kbd{Q}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297 @cindex query replace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 @kbd{Q} is for query replace. By default,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 each string to be replaced is treated as a regular expression. You can use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 @code{(setq vip-re-query-replace nil)} in your @file{.emacs} file to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 turn this off. (For normal searches, @kbd{:se nomagic} will work. Note
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302 that @kbd{:se nomagic} turns Regexps off completely, unlike Vi).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 @item v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 @itemx V
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305 @itemx C-v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 @kindex @kbd{v}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 @kindex @kbd{V}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 @kindex @kbd{C-v}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 These keys are used to visit files. @kbd{v} will switch to a buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 visiting file whose name can be entered in the Minibuffer. @kbd{V} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 similar, but will use a window different from the current window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 @kbd{C-v} is like @kbd{V}, except that a new frame (X window) will be used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 instead of a new Emacs window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314 @item #
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 @kindex @kbd{#}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 If followed by a certain character @var{ch}, it becomes an operator whose
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 argument is the region determined by the motion command that follows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 (indicated as <move>).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 Currently, @var{ch} can be one of @kbd{c}, @kbd{C}, @kbd{g}, @kbd{q}, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320 @kbd{s}. For instance, @kbd{#qr} will prompt you for a string and then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321 prepend this string to each line in the buffer.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 @item # c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323 @kindex @kbd{#c<move>}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 @cindex changing case
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 Change upper case characters in the region to lower case
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 (@code{downcase-region}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 Emacs command @kbd{M-l} does the same for words.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 @item # C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329 @kindex @kbd{#C<move>}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330 Change lower case characters in the region to upper case. For instance,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 @kbd{# C 3 w} will capitalize 3 words from the current point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332 (@code{upcase-region}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 Emacs command @kbd{M-u} does the same for words.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 @item # g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335 @kindex @kbd{#g<move>}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 Execute last keyboard macro for each line in the region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337 (@code{vip-global-execute}).@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 @item # q
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 @kindex @kbd{#q<move>}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 Insert specified string at the beginning of each line in the region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341 (@code{vip-quote-region}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 @item # s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 @kindex @kbd{#s<move>}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344 Check spelling of words in the region (@code{spell-region}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345 The function used for spelling is determined from the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346 @code{vip-spell-function}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347 @vindex @code{vip-spell-function}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348 @item *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349 @kindex @kbd{*}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 Call last keyboard macro.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351 @item m .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1352 Set mark at point and push old mark off the ring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353 @item m<
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354 @item m>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355 Set mark at beginning and end of buffer, respectively.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356 @item m,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 Jump to mark and pop mark off the ring. @xref{Mark,,Mark,emacs,The GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 Emacs Manual}, for more info.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 @item ] register
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 @kindex @kbd{]<a-z>}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 View contents of register
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 @item [ textmarker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 @kindex @kbd{[<a-z>}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 View filename and position of textmarker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 @item @@#
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 @item @@register
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 @item @@!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 @kindex @kbd{@@#}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 @kindex @kbd{@@<a-z>}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 @kindex @kbd{@@!}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 @cindex keyboard macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 @cindex register execution
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 Begin/end keyboard macro. @@register has a different meaning when used after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 a @kbd{@@#}. @xref{Macros and Registers}, for details
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 @item []
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 @kindex @kbd{[]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 Go to end of heading.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 @item g <@emph{movement command}>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 Search buffer for text delimited by movement command. The canonical
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 example is @kbd{gw} to search for the word under the cursor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 @xref{Improved Search}, for details.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 @item C-g and C-]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 @kindex @kbd{C-g}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 @kindex @kbd{C-]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 Quit and Abort Recursive edit. These may be necessary on occasion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 @xref{Vi State}, for a reason.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 @item C-c g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 @kindex @kbd{C-c g}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 Hitting @kbd{C-c} followed by @kbd{g} will display the information on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 current buffer. This is the same as hitting @kbd{C-g} in Vi, but, as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 explained above, @kbd{C-g} is needed for other purposes in Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 @item C-c /
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 @kindex @kbd{C-c /}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 Without a prefix argument, this command toggles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 case-sensitive/case-insensitive search modes and plain vanilla/regular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 expression search. With the prefix argument 1, i.e.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 @kbd{1 C-c /}, this toggles case-sensitivity; with the prefix argument 2,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 toggles plain vanilla search and search using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 regular expressions. @xref{Viper Specials}, for alternative ways to invoke
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 this function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 @cindex vanilla search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 @cindex case-sensitive search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 @cindex case-insensitive search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 @item M-p and M-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 @kindex @kbd{M-p}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 @kindex @kbd{M-n}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 In the Minibuffer, these commands navigate through the minibuffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 histories, such as the history of search strings, Ex commands, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 @item C-c M-p and C-c M-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 @kindex @kbd{C-c M-p}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 @kindex @kbd{C-c M-n}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 @cindex Insertion history
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416 @cindex Insertion ring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 @cindex Command history
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 @cindex Command ring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 In Insert or Replace state, these commands let the user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 peruse the history of insertion strings used in previous insert or replace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 commands. Try to hit @kbd{C-c M-p} or @kbd{C-c M-n} repeatedly and see what
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 happens. @xref{Viper Specials}, for more.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 In Vi state, these commands let the user peruse the history of Vi-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 destructive commands, such as @kbd{dw}, @kbd{J}, @kbd{a}, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 By repeatedly typing @kbd{C-c M-p} or @kbd{C-c M-n} you will cycle Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 through the recent history of Vi commands, displaying the commands one by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 one. Once
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 an appropriate command is found, it can be executed by typing `@kbd{.}'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 Since typing @kbd{C-c M-p} is tedious, it is more convenient to bind an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 appropriate function to a function key on the keyboard and use that key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434 @xref{Viper Specials}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 @item Ex commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 @findex @kbd{:args}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 @findex @kbd{:n}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 @findex @kbd{:pwd}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 @findex @kbd{:pre}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 The commands @kbd{:args}, @kbd{:next}, @kbd{:pre} behave
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 differently. @kbd{:pwd} exists to get current directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 The commands @kbd{:b} and @kbd{:B} switch buffers around. @xref{File and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 Buffer Handling}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 There are also the new commands @kbd{:RelatedFile} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 @kbd{PreviousRelatedFile} (which abbreviate to @kbd{R} and @kbd{P},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 respectively. @xref{Viper Specials}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 @findex @kbd{:RelatedFile}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449 @findex @kbd{:PreviousRelatedFile}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 Apart from the new commands, many old commands have been enhanced. Most
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 notably, Vi style macros are much more powerful in Viper than in Vi. @xref{Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 Macros}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 @node Useful Packages, ,New Commands, Improvements over Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 @section Useful Packages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 Some Emacs packages are mentioned here as an aid to the new Viper user, to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 indicate what Viper is capable of.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 A vast number comes with the standard Emacs distribution, and many more exist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 on the net and on the archives.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 This manual also mentions some Emacs features a new user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 should know about. The details of these are found in the GNU Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 Manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 The features first. For details, look up the Emacs Manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 @table @samp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 @item Make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 @cindex make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 @cindex compiling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 Makes and Compiles can be done from the editor. Error messages will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 parsed and you can move to the error lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 @item Shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 @cindex shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 @cindex interactive shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 You can talk to Shells from inside the editor. Your entire shell session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 can be treated as a file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 @item Mail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 @cindex email
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 @cindex mail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 Mail can be read from and sent within the editor. Several sophisticated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 packages exist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 @item Language Sensitive Editing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 Editing modes are written for most computer languages in existence. By
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 controlling indentation, they catch punctuation errors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 The packages, below, represents a drop in the sea of special-purpose
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 packages that come with standard distribution of Emacs 19.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 @table @samp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 @item Transparent FTP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 @cindex transparent ftp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 @pindex ange-ftp.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 @code{ange-ftp.el} can ftp from the editor to files on other machines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 transparent to the user.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 @item RCS Interfaces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 @cindex version maintenance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 @cindex RCS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 @pindex vc.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 @code{vc.el} for doing RCS commands from inside the editor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 @item Directory Editor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 @cindex dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 @pindex dired.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 @code{dired.el} for editing contents of directories and for navigating in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 the file system.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 @item Syntactic Highlighting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 @cindex hilit19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 @pindex hilit19.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 @cindex font-lock
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 @pindex font-lock.el
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1516 @code{font-lock.el} for automatic highlighting various parts of a buffer
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 using different fonts and colors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 @item Saving Emacs Configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 @cindex desktop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 @pindex desktop.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 @code{desktop.el} for saving/restoring configuration on Emacs exit/startup.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 @item Spell Checker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 @cindex ispell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 @pindex ispell.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 @code{ispell.el} for spell checking the buffer, words, regions, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 @item File and Buffer Comparison
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 @cindex ediff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 @pindex ediff.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 @code{ediff.el} for finding differences between files and for applying
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 patches.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 Emacs Lisp archives exist on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 @samp{archive.cis.ohio-state.edu}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 and @samp{wuarchive.wustl.edu}@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 @node Customization,Commands,Improvements over Vi,Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 @chapter Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 @cindex customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 Customization can be done in 2 ways.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 @cindex initialization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 @cindex .vip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 Elisp code in a @file{.vip} file in your home directory. Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 loads @file{.vip} just before it does the binding for mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 hooks. This is the recommended method.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 @cindex .emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 Elisp code in your @file{.emacs} file before and after the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 @code{(require 'viper)} line. This method is not recommended, unless you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 are know what you are doing.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 Emacs customization is done in Emacs Lisp. For the common cases,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 examples are provided that you can use directly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 * Rudimentary Changes:: Simple constant definitions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 * Keybindings:: Enabling Emacs Keys, Rebinding keys, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 * Packages that Change Keymaps:: How to deal with such beasts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 * Viper Specials:: Special Viper commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 * Vi Macros:: How to do Vi style macros.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 @node Rudimentary Changes,Keybindings,Customization,Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 @section Rudimentary Changes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 @cindex setting variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 @cindex variables for customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 @findex @kbd{:set}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 An easy way to customize Viper is to change the values of constants used in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 Viper. Here is the list of the constants used in Viper and their default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 values. The corresponding :se command is also indicated. (The symbols
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 @code{t} and @code{nil} represent ``true'' and ``false'' in Lisp).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 Viper supports both the abbreviated Vi variable names and their full
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 names. Variable completion is done on full names only. @kbd{TAB} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 @kbd{SPC} complete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 variable names. Typing `=' will complete the name and then will prompt for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 a value, if applicable. For instance, @kbd{:se auSPC} will complete the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 command to @kbd{:set autoindent}; @kbd{:se taSPC} will complete the command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 and prompt further like this: @kbd{:set tabstop = }.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 However, typing @kbd{:se tsSPC} will produce a ``No match'' message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 because @kbd{ts} is an abbreviation for @kbd{tabstop} and Viper supports
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 completion on full names only. However, you can still hit @kbd{RET}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 or @kbd{=}, which will complete the command like this: @kbd{:set ts = } and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 Viper will be waiting for you to type a value for the tabstop variable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 To get the full list of Vi variables, type @kbd{:se SPC TAB}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 @item vip-auto-indent nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 @itemx :se ai (:se autoindent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601 @itemx :se gai (:se global-autoindent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 If @code{t}, enable auto indentation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 by @kbd{RET}, @kbd{o} or @kbd{O} command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 @code{vip-auto-indent} is a local variable. To change the value globally, use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 @code{setq-default}. It may be useful for certain major modes to have their
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607 own values of @code{vip-auto-indent}. This can be achieved by using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608 @code{setq} to change the local value of this variable in the hooks to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609 appropriate major modes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611 @kbd{:se ai} changes the value of @code{vip-auto-indent} in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 buffer only; @kbd{:se gai} does the same globally.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 @item vip-electric-mode t
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1614 If not @code{nil}, auto-indentation becomes electric, which means that
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1615 @kbd{RET}, @kbd{O}, and @kbd{o} indent cursor according to the current
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1616 major mode. In the future, this variable may control additional electric
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1617 features.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619 This is a local variable: @code{setq} changes the value of this variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620 in the current buffer only. Use @code{setq-default} to change the value in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 all buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622 @item vip-case-fold-search nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 @itemx :se ic (:se ignorecase)
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1624 If not @code{nil}, search ignores cases.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 This can also be toggled by quickly hitting @kbd{/} twice.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626 @item vip-re-search nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 @itemx :se magic
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1628 If not @code{nil}, search will use regular expressions; if @code{nil} then
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1629 use vanilla search.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630 This behavior can also be toggled by quickly hitting @kbd{/} trice.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631 @item buffer-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 @itemx :se ro (:se readonly)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 Set current buffer to read only. To change globally put
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634 @code{(setq-default buffer-read-only t)} in your @file{.emacs} file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635 @item blink-matching-paren t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 @itemx :se sm (:se showmatch)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 Show matching parens by blinking cursor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638 @item tab-width t (default setting via @code{setq-default})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639 @itemx :se ts=value (:se tabstop=value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640 @itemx :se gts=value (:se global-tabstop=value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 @code{tab-width} is a local variable that controls the width of the tab stops.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 To change the value globally, use @code{setq-default}; for local settings,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643 use @code{setq}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 The command @kbd{:se ts}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 sets the tab width in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 buffer only; it has no effect on other buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 The command @kbd{:se gts} sets tab width globally,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 for all buffers where the tab is not yet set locally,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 including the new buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 Note that typing @kbd{TAB} normally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 doesn't insert the tab, since this key is usually bound to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 a text-formatting function, @code{indent-for-tab-command} (which facilitates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656 programming and document writing). Instead, the tab is inserted via the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1657 command @code{vip-insert-tab}, which is bound to @kbd{S-tab} (shift + tab).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659 On some non-windowing terminals, Shift doesn't modify the @kbd{TAB} key, so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 @kbd{S-tab} behaves as if it were @kbd{TAB}. In such a case, you will have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 to bind @code{vip-insert-tab} to some other convenient key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663 @item vip-shift-width 8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664 @itemx :se sw=value (:se shiftwidth=value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 The number of columns shifted by @kbd{>} and @kbd{<} commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 @item vip-search-wrap-around t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667 @itemx :se ws (:se wrapscan)
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1668 If not @code{nil}, search wraps around the end/beginning of buffer.
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
1669 @item vip-search-scroll-threshold 2
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
1670 In search lands within this many lines of the window top or bottom, the
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
1671 window will be scrolled up or down by about 1/7-th of its size, to reveal
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
1672 the context. If the value is negative---don't scroll.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673 @item vip-tags-file-name "TAGS"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 The name of the file used as the tag table.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675 @item vip-re-query-replace nil
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1676 If not @code{nil}, use reg-exp replace in query replace.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 @item vip-want-ctl-h-help nil
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1678 If not @code{nil}, @kbd{C-h} is bound to @code{help-command};
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 if @code{nil}, it is bound to @code{delete-backward-char}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680 @item vip-vi-style-in-minibuffer t
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1681 If not @code{nil}, Viper provides a high degree of compatibility with Vi
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1682 insert mode when you type text in the Minibuffer; if @code{nil}, typing in
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1683 the Minibuffer feels like plain Emacs.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 @item vip-no-multiple-ESC t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 If you set this to @code{nil}, you can use @kbd{ESC} as Meta in Vi state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686 Normally, this is not necessary, since graphical displays have separate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687 Meta keys (usually on each side of the space bar). On a dumb terminal, Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688 sets this variable to @code{twice}, which is almost like @code{nil}, except
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 that double @kbd{ESC} beeps. This, too, lets ESC to be used as a Meta.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 @item vip-keysequence-delay 140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 Escape sequences separated by this much delay are interpreted as command,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 ignoring the special meaning of ESC in VI. The default is suitable for most
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693 terminals. However, if your terminal is extremely slow, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694 might want to increase this slightly. You will know if your terminal is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695 slow if the ESC key sequences emitted by the arrow keys are interpreted as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 separately typed characters (and thus the arrow keys won't work).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 Making this value too large will slow you down, so exercise restraint.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698 @item vip-ex-style-motion t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 Set this to @code{nil}, if you want @kbd{l,h} to cross
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 lines, etc. @xref{Movement and Markers}, for more info.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 @item vip-ex-style-editing-in-insert t
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1702 Set this to to @code{nil}, if you want @kbd{ESC} to not move back and
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703 @kbd{C-h} to not stop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 at the beginning of a line in Insert state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 @item vip-always t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 Leave it to Viper to decide when a buffer must be brought up in Vi state,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707 Insert state, or Emacs state. This heuristics works well in virtually all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 cases.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709 This option must be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710 set before Viper is loaded or in the @file{.vip} file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711 @item vip-custom-file-name "~/.vip"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712 Change this if you want. Must be set in @file{.emacs} (not @file{.vip}!)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 before Viper is loaded. Note that you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714 have to set it as a string inside double quotes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715 @item vip-spell-function 'ispell-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 Function used by the command @kbd{#c<move>} to spell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717 @item ex-nontrivial-find-file-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 The value of this variable is the function used to find all files that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719 match a wildcard. This is usually done when the user types @kbd{:e} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 specifies a wildcard in the file name (or if the file name contains unusual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 symbols (e.g., a space). Viper provides two functions for this: one for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 Unix-like systems (@code{vip-ex-nontrivial-find-file-unix}) and one for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 DOS, W95, and NT (@code{vip-ex-nontrivial-find-file-ms}). If the default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 function doesn't quite do what you expect or if you prefer to use ``fancy''
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 shells, you may have to write your own version of this function and make it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 into the value of @code{ex-nontrivial-find-file-function}. Use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 @code{vip-ex-nontrivial-find-file-unix} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728 @code{vip-ex-nontrivial-find-file-ms} as examples.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 @vindex @code{ex-nontrivial-find-file-function}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 @findex @code{vip-ex-nontrivial-find-file-ms}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731 @findex @code{vip-ex-nontrivial-find-file-unix}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 @item ex-cycle-other-window t
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1733 If not @code{nil}, @kbd{:n} and @kbd{:b} will cycle through files in another
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 window, if one exists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 @item ex-cycle-through-non-files nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 @kbd{:n} does not normally cycle through buffers. Set this to get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 buffers also.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 @item vip-automatic-iso-accents nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 If @kbd{t}, ISO accents will be turned on in insert/replace Viper states
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 and turned off in Vi state. This is useful for editing text in European
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 languages. This variable is buffer-local. If used, it should be set in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 hooks to the appropriate major modes (usually setting it in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 @code{text-mode-hook} is enough).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 @item vip-want-emacs-keys-in-insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745 This is set to @code{nil} for user levels 1 and 2 and to @code{t} for user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 levels 3 and 4. Users who specify level 5 are allowed to set this variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747 as they please (the default for this level is @code{t}). If set to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 @code{nil}, complete Vi compatibility is provided in Insert state. This is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 really not recommended, as this precludes you from using language-specific
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 features provided by the major modes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 @item vip-want-emacs-keys-in-vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 This is set to @code{nil} for user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 level 1 and to @code{t} for user levels 2--4.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 At level 5, users are allowed to set this variable as they please (the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 default for this level is @code{t}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 If set to @code{nil}, complete Vi compatibility is provided
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 in Vi command state. Setting this to @code{nil} is really a bad idea,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758 unless you are a novice, as this precludes the use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 of language-specific features provided by the major modes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 @item vip-keep-point-on-repeat t
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1761 If not @code{nil}, point is not moved when the user repeats the previous
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1762 command by typing `.' This is very useful for doing repeated changes with
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1763 the @kbd{.} key.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 @item vip-repeat-from-history-key 'f12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 Prefix key used to invoke the macros @kbd{f12 1} and @kbd{f12 2} that repeat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766 the second-last and the third-last destructive command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 Both these macros are bound (as Viper macros) to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 @code{vip-repeat-from-history},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 which checks the second key by which it is invoked to see which of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770 previous commands to invoke. Viper binds @kbd{f12 1} and @kbd{f12 2} only,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771 but the user can bind more in @file{~/.vip}. @xref{Vi Macros}, for how to do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 @item vip-keep-point-on-undo nil
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1774 If not @code{nil}, Viper tries to not move point when undoing commands.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 Instead, it will briefly move the cursor to the place where change has
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776 taken place. However, if the undone piece of text is not seen in window,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777 then point will be moved to the place where the change took place.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 Set it to @code{t} and see if you like it better.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 @item vip-delete-backwards-in-replace nil
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1780 If not @code{nil}, DEL key will delete characters while moving the cursor
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1781 backwards. If @code{nil}, the cursor will move backwards without deleting
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1782 anything.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 @item vip-replace-overlay-face 'vip-replace-overlay-face
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1784 @itemx vip-replace-overlay-pixmap "grey3"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785 On a graphical display, Viper highlights replacement regions instead of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 putting a @samp{$} at the end. This variable controls the so called
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 @dfn{face} used to highlight the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1789 By default, @code{vip-replace-overlay-face} underlines the replacement on
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1790 monochrome displays and also lays a pixmap over them (as specified in the
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1791 variable @code{vip-replace-overlay-pixmap}. On color displays, replacement
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1792 regions are highlighted with color.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1793
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1794 If you know something about Emacs faces and don't like how Viper highlights
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1795 replacement regions, you can change @code{vip-replace-overlay-face} by
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1796 specifying a new face. (Emacs faces are described in the Emacs Lisp
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1797 reference.) On a color display, the following customization method is
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1798 usually most effective:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 (set-face-foreground vip-replace-overlay-face "DarkSlateBlue")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 (set-face-background vip-replace-overlay-face "yellow")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 @end example
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1803 For a complete list of colors available to you, evaluate the expression
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1804 @code{(x-defined-colors)}. (Type it in the buffer @code{*scratch*} and then
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1805 hit the @kbd{C-j} key.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1806
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1807 On a monochrome display, you can change the value of the variable
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1808 @code{vip-replace-overlay-pixmap} to specify the pixmap of your choice
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1809 (which should be a string denoting the file name of the pixmap). Emacs
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1810 takes pixmaps from the directory specified in the variable
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1811 @code{x-bitmap-file-path}.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 @item vip-replace-overlay-cursor-color "Red"
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1813 @vindex @code{vip-replace-overlay-cursor-color}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 Cursor color when it is inside the replacement region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 This has effect only on color displays and only when Emacs runs as an X
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816 application.
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1817 @item vip-insert-state-cursor-color nil
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1818 @vindex @code{vip-insert-state-cursor-color}
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1819 If set to a valid color, this will be the cursor color when Viper is in
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1820 insert state.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 @item vip-replace-region-end-delimiter "$"
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1822 A string used to mark the end of replacement regions. It is used only on
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 TTYs or if @code{vip-use-replace-region-delimiters} is non-nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 @item vip-replace-region-start-delimiter ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 A string used to mark the beginning of replacement regions. It is used
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1826 only on TTYs or if @code{vip-use-replace-region-delimiters} is non-nil.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 @item vip-use-replace-region-delimiters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 If non-nil, Viper will always use @code{vip-replace-region-end-delimiter} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 @code{vip-replace-region-start-delimiter} to delimit replacement regions,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 even on color displays (where this is unnecessary). By default, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831 variable is non-nil only on TTYs or monochrome displays.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
1832 @item vip-allow-multiline-replace-regions t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
1833 If non-nil, multi-line text replacement regions, such as those produced by
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
1834 commands @kbd{c55w}, @kbd{3C}, etc., will stay around until the user exits
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
1835 the replacement mode. In this variable is set to @code{nil}, Viper will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
1836 emulate the standard Vi behavior, which supports only intra-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
1837 replacement regions (and multi-line replacement regions are deleted).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 @item vip-toggle-key "\C-z"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 Specifies the key used to switch from Emacs to Vi and back.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 Must be set in @file{.vip} or prior to loading Viper. This variable can't be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841 changed interactively after Viper is loaded.
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1842
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1843 In Insert state, this key acts as a temporary escape to Vi state, i.e., it
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1844 will set Viper up so that the very next command will be executed as if it
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1845 were typed in Vi state.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 @item vip-ESC-key "\e"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 Specifies the key used to escape from Insert/Replace states to Vi.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 Must be set in @file{.vip} or prior to loading Viper. This variable cannot be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 changed interactively after Viper is loaded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 @item vip-buffer-search-char nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851 Key used for buffer search. @xref{Viper Specials}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852 @item vip-surrounding-word-function 'vip-surrounding-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 The value of this variable is a function name that is used to determine
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854 what constitutes a word clicked upon by the mouse. This is used by mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 search and insert.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856 @item vip-search-face 'vip-search-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857 Variable that controls how search patterns are highlighted when they are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858 found.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 @item vip-vi-state-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 List of parameterless functions to be run just after entering the Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861 command state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 @item vip-insert-state-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 Same for Insert state. This hook is also run after entering Replace state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 @item vip-replace-state-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865 List of (parameterless) functions called just after entering Replace state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866 (and after all @code{vip-insert-state-hook}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867 @item vip-emacs-state-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 List of (parameterless) functions called just after switching from Vi state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869 to Emacs state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 @item vip-load-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871 List of (parameterless) functions called just after loading Viper. This is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872 the last chance to do customization before Viper is up and running.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1873 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 You can reset some of these constants in Viper with the Ex command @kbd{:set}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 (when so indicated in the table). Or you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877 can include a line like this in your @file{.vip} file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879 (setq vip-case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 @vindex @code{vip-auto-indent}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882 @vindex @code{vip-electric-mode}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883 @vindex @code{vip-case-fold-search}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 @vindex @code{vip-re-search}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 @vindex @code{vip-shift-width}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886 @vindex @code{buffer-read-only}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887 @vindex @code{vip-search-wrap-around}
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
1888 @vindex @code{vip-search-scroll-threshold}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 @vindex @code{vip-search-face}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 @vindex @code{vip-tags-file-name}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 @vindex @code{vip-re-query-replace}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892 @vindex @code{vip-want-ctl-h-help}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 @vindex @code{vip-vi-style-in-minibuffer}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 @vindex @code{vip-no-multiple-ESC}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895 @vindex @code{vip-always}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 @vindex @code{vip-keysequence-delay}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 @vindex @code{vip-ex-style-motion}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898 @vindex @code{vip-ex-style-editing-in-insert}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 @vindex @code{vip-custom-file-name}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 @vindex @code{vip-spell-function}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901 @vindex @code{ex-cycle-other-window}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902 @vindex @code{ex-cycle-through-non-files}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 @vindex @code{vip-automatic-iso-accents}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 @vindex @code{vip-want-emacs-keys-in-insert}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905 @vindex @code{vip-want-emacs-keys-in-vi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906 @vindex @code{vip-keep-point-on-repeat}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907 @vindex @code{vip-keep-point-on-undo}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 @vindex @code{vip-delete-backwards-in-replace}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909 @vindex @code{vip-replace-overlay-face}
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1910 @vindex @code{vip-replace-overlay-pixmap}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 @vindex @code{vip-replace-region-end-symbol}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 @vindex @code{vip-replace-region-start-symbol}
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
1913 @vindex @code{vip-allow-multiline-replace-regions}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 @vindex @code{vip-toggle-key}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915 @vindex @code{vip-ESC-key}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 @vindex @code{vip-buffer-search-char}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 @vindex @code{vip-surrounding-word-function}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918 @vindex @code{vip-vi-state-hook}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919 @vindex @code{vip-insert-state-hook}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920 @vindex @code{vip-replace-state-hook}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921 @vindex @code{vip-emacs-state-hook}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 @node Keybindings, Packages that Change Keymaps, Rudimentary Changes,Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924 @section Keybindings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 @cindex keybindings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 @cindex keymaps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929 Viper lets you define hot keys, i.e., you can associate keyboard keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 such as F1, Help, PgDn, etc., with Emacs Lisp functions (that may already
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931 exist or that you will write). Each key has a "preferred form" in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 Emacs. For instance, the Up key's preferred form is [up], the Help key's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933 preferred form is [help], and the Undo key has the preferred form [f14].
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934 You can find out the preferred form of a key by typing @kbd{M-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 describe-key-briefly} and then typing the key you want to know about.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1936
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937 Under X Windows, every keyboard key emits its preferred form, so you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938 just type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941 (global-set-key [f11] 'calendar) ; L1, Stop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 (global-set-key [f14] 'undo) ; L4, Undo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 to bind L1 so it will invoke the Emacs Calendar and to bind L4 so it will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947 undo changes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948 However, on a dumb terminal or in an Xterm window, even the standard arrow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949 keys may
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950 not emit the right signals for Emacs to understand. To let Emacs know about
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951 those keys, you will have to find out which key sequences they emit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 by typing @kbd{C-q} and then the key (you should switch to Emacs state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953 first). Then you can bind those sequences to their preferred forms using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954 @code{function-key-map} as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957 (cond ((string= (getenv "TERM") "xterm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958 (define-key function-key-map "\e[192z" [f11]) ; L1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959 (define-key function-key-map "\e[195z" [f14]) ; L4, Undo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1960 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962 The above illustrates how to do this for Xterm. On VT100, you would have to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1963 replace "xterm" with "vt100" and also change the key sequences (the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1964 key may emit different sequences on different types of terminals).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1965
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1966 The above keys are global, so they are overwritten by the local maps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1967 defined by the major modes and by Viper itself. Therefore, if you wish to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1968 change a binding set by a major mode or by Viper, read this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1969
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1970 Viper users who wish to specify their own key bindings should be concerned
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1971 only with the following three keymaps:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1972 @code{vip-vi-global-user-map} for Vi state commands,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1973 @code{vip-insert-global-user-map} for Insert state commands,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1974 and @code{vip-emacs-global-user-map} for Emacs state commands (note:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1975 customized bindings for Emacs state made to @code{vip-emacs-global-user-map}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1976 are @emph{not} inherited by Insert state).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1977
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1978 For more information on Viper keymaps, see the header of the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1979 @file{viper.el}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980 If you wish to change a Viper binding, you can use the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981 @code{define-key} command, to modify @code{vip-vi-global-user-map},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1982 @code{vip-insert-global-user-map}, and @code{vip-emacs-global-user-map}, as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 explained below. Each of these key maps affects the corresponding Viper state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1984 The keymap @code{vip-vi-global-user-map} also affects Viper's Replace state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 If you want to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1988 bind a key, say @kbd{C-v}, to the function that scrolls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1989 page down and to make @kbd{0} display information on the current buffer,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990 putting this in @file{.vip} will do the trick in Vi state:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 (define-key vip-vi-global-user-map "\C-v" 'scroll-down)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1993 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1994 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1995 To set a key globally,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1996 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1997 (define-key vip-emacs-global-user-map "\C-c m" 'smail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1998 (define-key vip-vi-global-user-map "0" 'vip-info-on-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1999 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2000 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2001 Note, however, that this binding may be overwritten by other keymaps, since
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002 the global keymap has the lowest priority.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2003 To make sure that nothing will override a binding in Emacs state, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2004 can write this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2005 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2006 (define-key vip-emacs-global-user-map "\C-c m" 'smail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2007 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2008 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009 To customize the binding for @kbd{C-h} in Insert state:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2010 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011 (define-key vip-insert-global-user-map "\C-h" 'my-del-backwards-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2013 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2014
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015 Each Emacs command key calls some lisp function. If you have enabled the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016 Help, (@xref{Rudimentary Changes}) @kbd{C-h k} will show you the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 for each specific key; @kbd{C-h b} will show all bindings, and @kbd{C-h m}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018 will provide information on the major mode in effect. If Help is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2019 enabled, you can still get help in Vi state by prefixing the above commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 with @kbd{\}, e.g., @kbd{\ C-h k} (or you can use the Help menu in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 menu bar, if Emacs runs under X Windows).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 Viper users can also change bindings on a per major mode basis. As with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024 global bindings, this can be done separately for each of the three main Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 states. To this end, Viper provides the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026 @code{vip-modify-major-mode}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 @findex @code{vip-modify-major-mode}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029 To modify keys in Emacs state for @code{my-favorite-major-mode}, the user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030 needs to create a sparse keymap, say, @code{my-fancy-map}, bind whatever
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 keys necessary in that keymap, and put
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2033 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2034 (vip-modify-major-mode 'dired-mode 'emacs-state my-fancy-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2037 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 in @file{~/.vip}. To do the same in Vi and Insert states, one should use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 @code{vi-state} and @code{insert-state}. Changes in Insert state are also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 in effect in Replace state. For instance, suppose that the user wants to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041 use @kbd{dd} in Vi state under Dired mode to delete files, @kbd{u} to unmark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 files, etc. The following code in @file{~/.vip} will then do the job:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2045 (setq my-dired-modifier-map (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046 (define-key my-dired-modifier-map "dd" 'dired-flag-file-deletion)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047 (define-key my-dired-modifier-map "u" 'dired-unmark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048 (vip-modify-major-mode 'dired-mode 'vi-state my-dired-modifier-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051 A Vi purist may want to modify Emacs state under Dired mode so that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052 @kbd{k}, @kbd{l}, etc., will move around in directory buffers, as in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053 Vi. Although this is not recommended, as these keys are bound to useful
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2054 Dired functions, the trick can be accomplished via the following code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2055
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2056 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2057 (setq my-dired-vi-purist-map (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2058 (define-key my-dired-vi-purist-map "k" 'vip-previous-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2059 (define-key my-dired-vi-purist-map "l" 'vip-forward-char)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2060 (vip-modify-major-mode 'dired-mode 'emacs-state my-dired-vi-purist-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2061 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2062
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2063 Similar effect can be achieved by defining Vi keyboard macros using the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2064 Ex commands @kbd{:map} and @kbd{:map!}. The difference is that multi-key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2065 Vi macros do not override the keys they are bound to, unless these keys are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066 typed in quick succession. So, with macros, one can use the normal keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067 alongside with the macros. If per-mode modifications are needed, the user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 can try both ways and see which one is more convenient.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069 @findex @kbd{:map}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 @xref{Vi Macros}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072 Note: in major modes that come up in @emph{Emacs state} by default, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073 aforesaid modifications may not take place immediately (but only after the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 buffer switches to some other Viper state and then back to Emacs state). To
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 avoid this, one should add @code{vip-change-state-to-emacs} to an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 appropriate hook of that major mode. (Check the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077 @code{vip-set-hooks} in @file{viper.el} for examples.) However, if you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078 have set @code{vip-always} to @code{t}, chances are that you won't need to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 perform the above procedure, because Viper will take care of most useful
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 defaults.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 Finally, Viper has a facility that lets the user define per-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 bindings, i.e., bindings that are in effect in some specific buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 only. Unlike per-mode bindings described above, per-buffer bindings can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 defined based on considerations other than the major mode. This is done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 via the function @code{vip-add-local-keys}, which lets one specify bindings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088 that should be in effect in the current buffer only and for a specific Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089 state. For instance,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 (vip-add-local-keys 'vi-state '(("ZZ" . TeX-command-master)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 ("ZQ" . vip-save-kill-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2093 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095 redefines @kbd{ZZ} to invoke @code{TeX-command-master} in @code{vi-state}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096 and @kbd{ZQ} to save-then-kill the current buffer. These bindings take
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 effect only in the buffer where this command is executed. The typical use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098 of this function is to execute the above expression from within a function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2099 that is included in a hook to some major mode. For instance, the above
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100 expression
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 could be called from a function, @code{my-tex-init}, which may be added to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102 @code{tex-mode-hook} as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104 (add-hook 'tex-mode-hook 'my-tex-init)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2106 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 When TeX mode starts, the hook is executed and the above Lisp expression is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 evaluated. Then, the bindings for @kbd{ZZ} and @kbd{ZQ} are changed in Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109 command mode for all buffers in TeX mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111 Another useful application is to bind @kbd{ZZ} to @code{send-mail}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 in the Mail mode buffers (the specifics of this depend on which mail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 package you are using, @code{rmail}, @code{mh-e}, @code{vm}, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114 For instance, here is how to do this for @code{mh-e}, the Emacs interface
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 to MH:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117 (defun mh-add-vi-keys ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 "Set up ZZ for MH-e and XMH."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119 (vip-add-local-keys 'vi-state '(("ZZ" . mh-send-letter))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120 (add-hook 'mh-letter-mode-hook 'mh-add-vi-keys)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123 You can also use @code{vip-add-local-keys} to set per buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124 bindings in Insert state and Emacs state by passing as a parameter the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125 symbols @code{'insert-state} and @code{'emacs-state}, respectively.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126 As with global bindings, customized local bindings done to Emacs state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127 are not inherited by Insert state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129 On rare occasions, local keys may be added by mistake. Usually this is done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 indirectly, by invoking a major mode that adds local keys (e.g.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 @code{shell-mode} redefines @kbd{RET}). In such a case, exiting the wrong
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132 major mode won't rid you from unwanted local keys, since these keys are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133 local to Viper state and the current buffer, not to the major mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 In such situations, the remedy is to type @kbd{M-x vip-zap-local-keys}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136 So much about Viper-specific bindings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 @xref{Customization,,Customization,emacs,The GNU Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 Manual}, and the Emacs quick reference card for the general info on key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139 bindings in Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 @vindex @code{function-key-map}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142 @vindex @code{vip-vi-global-user-map}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 @vindex @code{vip-insert-global-user-map}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 @vindex @code{vip-emacs-global-user-map}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 @findex @code{vip-add-local-keys}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146 @findex @code{vip-zap-local-keys}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148 @node Packages that Change Keymaps,Viper Specials,Keybindings,Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149 @subsection Packages that Change Keymaps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 @cindex C-c and Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151 @cindex Viper and C-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 Viper is designed to coexist with all major and minor modes of Emacs. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2154 means that bindings set by those modes are generally available with Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155 (unless you explicitly prohibit them by setting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 @code{vip-want-emacs-keys-in-vi} and @code{vip-want-emacs-keys-in-insert} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157 @code{nil}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158 If @code{vip-always} is set to @code{t}, Viper will try to bring each buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 in the a Viper state that is most appropriate for that buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160 Usually, this would be the Vi state, but sometimes it could be the Insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 state or the Emacs state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163 Some major mode bindings will necessarily be overwritten by Viper. Indeed, in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 Vi state, most of the 1-character keys are used for Vi-style editing. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165 usually causes no problems because most packages designed for editing files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166 typically do not bind such keys. Instead, they use key sequences that start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 with @kbd{C-x} and @kbd{C-c}. This is why it was so important for us to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 free up @kbd{C-x} and @kbd{C-c}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169 It is common for language-specific major modes to bind @kbd{TAB} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 @kbd{LFD} (the line feed) keys to various formatting functions. This is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171 extremely useful, but may require some getting used to for a Vi user. If you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 decide that this feature is not for you, you can re-bind these keys as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 explained earlier (@xref{Customization}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2175 Binding for @kbd{TAB} is one of the most unusual aspects of Viper for many
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176 novice users. In Emacs, @kbd{TAB} is used to format text and programs, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177 is extremely useful. For instance, hitting @kbd{TAB} causes the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178 line to be re-indented in accordance with the context. In programming,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 this is very important, since improper automatic indentation would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 immediately alert the programmer to a possible error. For instance, if a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 @kbd{)} or a @kbd{"} is missing somewhere above the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2182 line, @kbd{TAB} is likely to mis-indent the line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184 For this reason, Viper doesn't change the standard Emacs binding of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2185 @kbd{TAB}, thereby sacrificing Vi compatibility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186 (except for users at level 1). Instead, in Viper, the key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 @kbd{S-tab} (shift+ tab) is chosen to emulate Vi's @kbd{TAB}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189 We should note that on some non-windowing terminals, Shift doesn't modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 the @kbd{TAB} key, so @kbd{S-tab} behaves as if it were @kbd{TAB}. In such
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 a case, you will have to bind @code{vip-insert-tab} to some other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192 convenient key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2194 Some packages, notably Dired, Gnus, Info, etc., attach special meaning to
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2195 common keys like @kbd{SPC}, @kbd{x}, @kbd{d}, @kbd{v}, and others. This
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 means that Vi command state is inappropriate for working with these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2197 packages. Fortunately, these modes operate on read-only buffers and are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2198 designed not for editing files, but for special-purpose browsing, reading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199 news, mail, etc., and Vi commands are meaningless in these situations. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 this reason, Viper doesn't force Vi state on such major modes. Rather, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 brings them in Emacs state. You can switch to Vi state by typing @kbd{C-z}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 if, for instance, you want to do Vi-style search in a buffer (although,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 usually, incremental search, which is bound to @kbd{C-s}, is sufficient in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204 these situations). But you should then switch back to Emacs state if you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205 plan to continue using these major modes productively. You can also switch
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2206 to Vi temporarily, to execute just one command. This is done by typing
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2207 @kbd{C-c \}. (In some of these modes, @kbd{/} and @kbd{:} are bound
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2208 Vi-style, unless these keys perform essential duties.)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 It is also possible to harness some major modes, even though they may bind
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 common keys to specialized commands. Harnessing can make sense for modes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212 that bind only a small number of common keys. For instance, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213 @code{vip-always} is set to @code{t} in your @file{~/.vip} file, Viper will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214 harness the Shell mode by changing the bindings for @kbd{C-m} and @kbd{C-d}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215 using @code{vip-add-local-keys} described in section on customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 (@xref{Customization}). In general, there is no single recipe for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 harnessing modes. It can be as simple as adding the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218 @code{viper-mode} to a hook associated with the mode, or it can be more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 complex, as in the case of Shell mode and Emerge. Take a look at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 @code{vip-set-hooks} function for some examples.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222 Conversely, it may be the case that most of the major modes harnessed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223 by @code{vip-set-hooks} function fit your working style, except one or two
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 cases. In this case, you may still be able to set @code{vip-always} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225 @code{t} and then remove a hook that forces Vi command state. For instance,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226 to unharness @code{lisp-interaction-mode}, you can put the following line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227 in your @file{.emacs} (not @code{.vip}!) file after @code{(require 'viper)}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 (remove-hook 'lisp-interaction-mode-hook 'viper-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 In some rare cases, some minor modes may override certain essential
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 bindings in Vi command state. This is not really catastrophic because this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 may happen only in the beginning, when the minor mode kicks in. Typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 @code{M-x viper-mode} will correct the situation. Viper knows about
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236 several such minor modes and takes care of them, so that the above trick
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237 is usually not necessary. If you find that some minor mode, e.g.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238 @code{nasty-mode.el} interferes with Viper, putting the following in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239 @file{.vip} should fix the problem:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 (vip-harness-minor-mode "nasty-mode")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 The argument to @code{vip-harness-minor-mode} is the name of the file for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 offending minor mode with the suffixes @file{.el} and @file{.elc} removed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 It may be tricky, however, to find out which minor mode is at fault. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248 only guidance here is to look into the file that defines the minor mode you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 are suspecting, say @code{nasty-mode.el}, and see if it has a variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 called @code{nasty-mode-map}. Then check if there is a statement of the form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252 (define-key nasty-mode-map key function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 that binds the misbehaving
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 keys. If so, use the above line to harness @code{nasty-mode}. If your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257 suspicion is wrong, no harm is done if you harness a minor mode that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 doesn't need to be harnessed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 @vindex @code{vip-want-emacs-keys-in-vi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 @vindex @code{vip-want-emacs-keys-in-insert}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 @vindex @code{vip-always}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 @findex @code{vip-set-hooks}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 @findex @code{viper-mode}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 @findex @code{vip-harness-minor-mode}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 @findex @code{remove-hook}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267 @findex @code{add-hook}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 @node Viper Specials,Vi Macros,Packages that Change Keymaps,Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 @section Viper Specials
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272 Viper extends Vi with a number of useful features. This includes various
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273 search functions, histories of search strings, Ex commands, insertions, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 Vi's destructive commands. In addition, Viper supports file name completion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 and history, completion of Ex commands and variables, and many other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 features. Some of these features are explained in detail elsewhere in this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277 document. Other features are explained here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 @item (vip-buffer-search-enable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 @item vip-buffer-search-char nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282 Enable buffer search. Explicit call to @code{vip-buffer-search-enable}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 sets @code{vip-buffer-search-char} to @kbd{g}. Alternatively, the user can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284 set @code{vip-buffer-search-char} in @file{.vip} to a key sequence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 to be used for buffer search. There is no need to call
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 @code{vip-buffer-search-enable} in that case.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 @findex @code{vip-buffer-search-enable}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 @vindex @code{vip-buffer-search-char}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 @item vip-toggle-search-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290 This function, bound to @kbd{C-c /}, lets one toggle case-sensitive and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 case-insensitive search, and also switch between plain vanilla search and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292 search via regular expressions. Without the prefix argument, the user is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293 asked which mode to toggle. With prefix argument 1, this toggles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 case-sensitivity. With prefix argument 2, regular expression/vanilla search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295 will be toggled.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 However, we found that the most convenient way to toggle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2298 these options is to bind a Vi macro to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299 bind @kbd{//} to toggles case sensitivity and to @kbd{///} to toggles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300 vanilla search. Thus, quickly hitting @kbd{/} twice will switch Viper from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 case sensitive search to case-insensitive. Repeating this once again will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 restore the original state. Likewise, quickly hitting @kbd{/} three times
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 will switch you from vanilla-style search to search via regular expressions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 If you hit something other than @kbd{/} after the first @kbd{/} or if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305 second @kbd{/} doesn't follow quickly enough, then Viper will issue the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 usual prompt @kbd{/} and will wait for input, as usual in Vi.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 If you don't like this behavior, you can ``unrecord'' these macros in your
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2308 @file{~/.vip} file. For instance, if you don't like the above feature, put
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309 this in @file{~/.vip}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310 @example
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2311 (vip-set-vi-search-style-macros 'undefine)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312 @end example
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2313 @findex @code{vip-set-vi-search-style-macros}
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2314
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2315 @item Vi-isms in Emacs state
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2316 Some people find it useful to use the Vi-style search key, `/', to invoke
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2317 search in modes which Viper leaves in emacs-state. These modes are:
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2318 @code{dired-mode}, @code{mh-folder-mode}, @code{gnus-group-mode},
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2319 @code{gnus-summary-mode}, @code{Info-mode}, and @code{Buffer-menu-mode}
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2320 (more may be added in the future). So, in the above modes, Viper binds `/'
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2321 so that it will behave Vi-style. Furthermore, in those major modes, Viper
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2322 binds `:' to invoke ex-style commands, like in vi-state. And, as described
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2323 above, `//' and `///' get bound to Vi-style macros that toggle
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2324 case-insensitivity and regexp-search.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2325
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2326 If you don't like these features---which I don't really understand---you
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2327 can unbind `/' and `:' in @code{vip-dired-modifier-map} (for Dired) or in
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2328 @code{vip-slash-and-colon-map}, for other modes.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2329 @vindex @code{vip-slash-and-colon-map}
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2330 @vindex @code{vip-dired-modifier-map}
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2331
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2332 To unbind the macros `//' and `///' for a major mode where you feel they
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2333 are undesirable, execute @code{vip-set-emacs-search-style-macros} with a
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2334 non-nil argument. This can be done either interactively, by supplying a
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2335 prefix argument, or by placing
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2336 @example
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2337 (vip-set-emacs-search-style-macros 'undefine)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2338 @end example
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2339 @findex @code{vip-set-emacs-search-style-macros}
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2340 in the hook to the major mode (e.g., @code{dired-mode-hook}).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 @xref{Vi Macros}, for more information on Vi macros.
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2342
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343 @item vip-heading-start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344 @item vip-heading-end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 @cindex headings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 @cindex sections
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 @cindex paragraphs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 @cindex sentences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 Regular Expressions for @kbd{[[} and @kbd{]]}. Note that Emacs defines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 Regexps for paragraphs and sentences. @xref{Paragraphs,,Paragraphs and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351 Sentences,emacs,The GNU Emacs Manual}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352 @item M-x vip-set-expert-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 @findex @code{vip-set-expert-level}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 Change your user level interactively.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355 @item vip-smart-suffix-list '("" "tex" "c" "cc" "el" "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 @vindex @code{vip-smart-suffix-list}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357 Viper supports Emacs-style file completion when it prompts the user for a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358 file name. However, in many cases, the same directory may contain files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 with identical prefix but different suffixes, e.g., prog.c, prog.o,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 paper.tex, paper.dvi. In such cases, completion will stop at the `.'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 If the above variable is a list of strings representing suffixes, Viper will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 try these suffixes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 in the order listed and will check if the corresponding file exists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365 For instance, if completion stopped at `paper.' and the user typed RET,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 then Viper will check if the files `paper.', `paper.tex', `paper.c', etc., exist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367 It will take the first such file. If no file exists, Viper will give a chance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 to complete the file name by typing the appropriate suffix. If `paper.' was
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 the intended file name, hitting return will accept it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371 To turn this feature off, set the above variable to @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373 @item vip-insertion-ring-size 14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374 @vindex @code{vip-insertion-ring-size}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 @cindex Insertion ring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 Viper remembers what was previously inserted in Insert and Replace states.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 Several such recent insertions are kept in a special ring of strings of size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 @code{vip-insertion-ring-size}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 If you enter Insert or Replace state you can reinsert strings from this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380 ring by typing @kbd{C-c M-p} or @kbd{C-c M-n}. The former will search the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 ring in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 the direction of older insertions, and the latter will search in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 the direction of newer insertions. Hitting @kbd{C-c M-p} or @kbd{C-c M-n}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384 in succession
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385 will undo the previous insertion from the ring and insert the next item on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 the ring. If a larger ring size is needed, change the value of the above
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387 variable in the @file{~/.vip} file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 Since typing these sequences of keys may be tedious, it is suggested that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390 user should bind a function key, such as @kbd{f31}, as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 (define-key vip-insert-global-user-map [f31]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393 'vip-insert-prev-from-insertion-ring)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 This binds @kbd{f31} (which is usually @kbd{R11} on a Sun workstation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396 to the function that inserts the previous string in the insertion history.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 To rotate the history in the opposite
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 direction, you can either bind an unused key to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399 @code{vip-insert-next-from-insertion-ring} or hit any digit (1 to 9) then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400 @kbd{f31}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 One should not bind the above functions to @kbd{M-p} or @kbd{M-n}, since
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2403 this will interfere with the Minibuffer histories and, possibly, other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 major modes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 @item vip-command-ring-size 14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407 @vindex @code{vip-command-ring-size}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 @cindex Destructive command ring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409 @cindex Destructive command history
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410 Viper keeps track of the recent history of destructive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 commands, such as @kbd{dw}, @kbd{i}, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 In Vi state,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413 the most recent command can be re-executed by hitting `@kbd{.}', as in Vi.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 However, repeated typing @kbd{C-c M-p} will cause Viper to show the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415 previous destructive commands in the minibuffer. Subsequent hitting `@kbd{.}'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416 will execute the command that was displayed last.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 The key @kbd{C-c M-n} will cycle through the command history in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 opposite direction.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 Since typing @kbd{C-c M-p} may be tedious, it is more convenient to bind an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 appropriate function to an unused function key on the keyboard and use that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421 key. For instance, the following
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 (define-key vip-vi-global-user-map [f31]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 'vip-prev-destructive-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 binds the key @kbd{f31} (which is usually @kbd{R11} on a Sun workstation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 to the function that searches the command history in the direction of older
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 commands. To search in the opposite
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 direction, you can either bind an unused key to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 @code{vip-next-destructive-command} or hit any digit (1 to 9) then @kbd{f31}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 One should not bind the above functions to @kbd{M-p} or @kbd{M-n}, since
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433 this will interfere with the Minibuffer histories and, possibly, other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434 major modes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436 @item vip-minibuffer-vi-face 'vip-minibuffer-vi-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437 @item vip-minibuffer-insert-face 'vip-minibuffer-insert-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438 @item vip-minibuffer-emacs-face 'vip-minibuffer-emacs-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439 These faces control the appearance of the minibuffer text in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 corresponding Viper states. For heavy-duty customization, consult
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441 the Lisp Reference to Emacs. You can also take a look how these faces are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 defined in @file{viper.el}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 However, on a color workstation, the following method usually suffices:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446 (set-face-foreground vip-minibuffer-vi-face "blue")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 (set-face-background vip-minibuffer-emacs-face "orchid")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449 This will make a blue foreground in the Minibuffer when it is in Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 state; its background will turn to orchid when it switches to Emacs state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 Note that only the text you type in is affected by the above faces.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 Prompts and Minibuffer messages are not affected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 Purists who do not like adornments in the minibuffer can always zap them by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456 putting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 (copy-face 'default 'vip-minibuffer-vi-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 (copy-face 'default 'vip-minibuffer-insert-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 (copy-face 'default 'vip-minibuffer-emacs-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 in the @file{~/.vip} file. However, in that case, the user will not have any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 indication of the current Viper state in the minibuffer. (This is important
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464 if the user accidentally switches to another Viper state by typing @kbd{ESC} or
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2465 @kbd{C-z}).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 @cindex Multifile documents and programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 Viper provides some support for multi-file documents and programs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471 If a document consists of several files we can designate one of them as a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472 master and put the following at the end of that file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 ;;; Local Variables:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 ;;; eval: (vip-setup-master-buffer "file1" "file2" "file3" "file5" "file5")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476 ;;; End:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 where @code{file1} to @code{file5} are names of files related to the master
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480 file. Next time, when the master file is visited, the command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481 @code{vip-setup-master-buffer} will be evaluated and the above files will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 be associated with the master file. Then, the new Ex command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 @kbd{:RelatedFile} (abbr. @kbd{:R}) will display files 1 to 5 one after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 another, so you can edit them. If a file is not in any Emacs buffer, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 will be visited. The command @kbd{PreviousRelatedFile} (abbr., @kbd{:P})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486 goes through the file list in the opposite direction.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 @findex @kbd{:RelatedFile}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 @findex @kbd{:PreviousRelatedFile}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 These commands are akin to @kbd{:n} and @kbd{:N}, but they allow the user to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 focus on relevant files only.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493 Note that only the master file needs to have the aforementioned block of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 commands. Also, ";;;" above can be replaced by some other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495 markers. Semicolon is good for Lisp programs, since it is considered a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 comment designator there. For LaTeX, this could be "%%%", and for C the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497 above block should be commented out.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499 Even though these commands are sometimes useful, they are no substitute for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 the powerful @emph{tag table} facility of Emacs. Viper's @kbd{:tag} command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501 in a primitive interface to Emacs tags. @xref{Tags,Tags,Tags,emacs,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 The Gnu Emacs Manual}, for more information on tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 The following two commands are normally bound to a mouse click and are part
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 of Viper. They work only if Emacs runs as an application under X
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 Windows (or under some other window system for which a port of GNU Emacs 19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 is available). Clicking the mouse when Emacs is invoked in an Xterm window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 (using @code{emacs -nw}) will do no good.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511 @cindex mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 @item M-S-mouse-1 (Emacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513 @item meta shift button1up (XEmacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 Holding Meta and Shift while clicking mouse button 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 will initiate search for a region under the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516 mouse pointer (defined below). This command can take a prefix argument,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 which indicates the occurrence of the pattern to search for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 Note: Viper binds this mouse action only if it is not already bound to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 something else. If you want to use this feature and @kbd{M-S-mouse-1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 is already used for something else, you can rebind mouse-search as, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522 example, in the following example:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 (global-set-key [M-mouse-1] 'vip-mouse-click-search-word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 (global-set-key [M-down-mouse-1] 'vip-mouse-catch-frame-switch)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527 This would bind mouse search to the action invoked by pressing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528 Meta key and clicking mouse button 1. Note: if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 @code{vip-mouse-click-search-word} is bound to an action, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 @code{vip-mouse-catch-frame-switch} must be bound to a down-action, as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 shown in the above example.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533 In XEmacs, you can change bindings as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535 (global-set-key [(meta control button1up)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536 'vip-mouse-click-search-word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 (global-set-key [(meta control button1)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 'vip-mouse-catch-frame-switch)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 if, say, you prefer to hold both meta and control while clicking.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 Like in Emacs, there are special rules for binding these functions: the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 first must be bound to a button-up event while the second must be bound to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 a button-event (which is XEmacs' equivalent of a down-mouse event). Also,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 in Emacs, the double-click and triple-click actions for the same button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 (@code{double-S-mouse-1}, etc., if the above default binding is used)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 should not be bound (or it should be bound to the same function,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 @code{vip-mouse-click-search-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550 The region that is chosen as a pattern to search for is determined as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 follows. If search is invoked via a single click, Viper chooses the region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 that lies between the beginning of the ``word'' under the pointer (``word''
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553 is understood in Vi sense) and the end of that word. The only difference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 with Vi's words is that in Lisp major modes `-' is considered an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 alphanumeric symbol. This is done for the convenience of working with Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 symbols, which often have an `-' in them. Also, if you click on a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 non-alphanumeric character that is not a word separator (in Vi sense) then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 this character will also be considered alphanumeric, provided that it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559 adjacent (from either side) to an alphanumeric character. This useful
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 feature gives added control over the patterns selected by the mouse click.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 On a double-click, the region is determined by the beginning of the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563 Vi's ``Word'' (i.e., the largest non-separator chunk of text) and the End
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564 of that ``Word'' (as determined by the @kbd{E} command).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 On a triple-click, the region consists of the entire line where the click
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 occurred with all leading and trailing spaces and tabs removed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 @item M-S-mouse-2 (Emacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 @item meta shift button2up (XEmacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571 Holding Meta and Shift while clicking mouse button 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572 will insert the region surrounding the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573 mouse pointer. The rules defining this region are the same as for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 mouse-search. This command takes an optional prefix argument, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575 indicates how many such regions to snarf from the buffer and insert. (In
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 case of a triple-click, the prefix argument is ignored.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578 Note: Viper binds this mouse action only if it not already bound to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2579 something else. If you want to use this feature and @kbd{S-mouse-2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580 is already used for something else, you can rebind mouse-insert as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2581 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2582 (global-set-key [M-mouse-2] 'vip-mouse-click-insert-word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2583 (global-set-key [M-down-mouse-2] 'vip-mouse-catch-frame-switch)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2584 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585 In XEmacs, you can change the bindings as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2586 @lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2587 (global-set-key [(meta control button2up)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588 'vip-mouse-click-insert-word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 (global-set-key [(meta control button2)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590 'vip-mouse-catch-frame-switch)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591 @end lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 @item vip-multiclick-timeout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 This variable controls the rate at which double-clicking must occur for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 purpose of mouse search and mouse insert. By default, this is set to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 @code{double-click-time} in Emacs and to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 @code{mouse-track-multi-click-time} milliseconds in XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 @kindex @kbd{S-mouse-1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 @kindex @kbd{S-mouse-2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 @kindex @kbd{meta shift button1up}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 @kindex @kbd{meta shift button2up}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603 @vindex @code{vip-multiclick-timeout}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604 @findex @code{vip-mouse-click-insert-word}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 @findex @code{vip-mouse-click-search-word}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 Note: The above functions search and insert in the selected window of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608 the latest active frame. This means that you can click in another window or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 another frame and have search or insertion done in the frame and window you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 just left. This lets one use these functions in a multi-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 configuration. However, this may require some getting used to. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612 instance, if you are typing in a frame, A, and then move the mouse to frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 B and click to invoke mouse search, search (or insertion) will be performed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614 in frame A. To perform search/insertion in frame B, you will first have to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615 shift focus there, which doesn't happen until you type a character or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616 perform some other action in frame B---mouse search doesn't shift focus (in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 XEmacs, to shift focus to frame B, you will have to select this frame with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618 a mouse, by clicking.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620 If you decide that you don't like the above feature and always want
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621 search/insertion be performed in the frame where the click occurs, don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 bind (and unbind, if necessary) @code{vip-mouse-catch-frame-switch} from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 the mouse event it is bound to.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625 Mouse search is integrated with Vi-style search, so you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 repeat it with @kbd{n} and @kbd{N}. It should be also noted that, while
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 case-sensitivity of search in Viper is controlled by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628 @code{vip-case-fold-search}, the case of mouse search is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629 controlled by the Emacs variable @code{case-fold-search}, which may be set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630 differently from @code{vip-case-fold-search}. Therefore, case-sensitivity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631 of mouse search may be different from that of the usual Vi-style search.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633 Finally, if the way Viper determines the word to be searched for or to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634 inserted is not what you want, there is a variable,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635 @code{vip-surrounding-word-function}, which can be changed to indicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636 another function for snarfing words out of the buffer. The catch is that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2637 you will then have to write such a function and make it known to your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 Emacs. The function @code{vip-surrounding-word} in @file{viper.el} can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639 used as a guiding example.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 @node Vi Macros, ,Viper Specials,Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642 @section Vi Macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644 @cindex Vi macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646 Viper supports much enhanced Vi-style macros and also facilitates the use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 of Emacs-style macros. To define a temporary macro, it is generally more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 convenient to use Emacs keyboard macro facility. Emacs keyboard macros are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649 usually defined anonymously, and the latest macro can be executed by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 @kbd{C-x e} (or @kbd{*}, if Viper is in Vi state). If you need to use several
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651 temporary macros, Viper lets you save them to a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 register (a lowercase letter); such macros can then be executed by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653 @kbd{@@a} in Vi state (if a macro was previously saved in register
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654 @kbd{a}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655 @xref{Macros and Registers}, for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 If, however, you need to use a macro regularly, it must be given a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 permanent name and saved. Emacs manual explains how to do this, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659 invocation of named Emacs macros is quite different from Vi's. First,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 invocation of permanent Emacs macros takes time because of the extra keys.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661 Second, binding such macros to function keys, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 fast access, hogs valuable real estate on the keyboard.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 Vi-style macros are better in that respect, since Vi lets the user overload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 the meaning of key sequences: keys typed in fast succession are treated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666 specially, if this key sequence is bound to a macro.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668 Viper provides keyboard macros through the usual Ex commands, @kbd{:map} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669 @kbd{:map!}. Vi-style macros are much more powerful in Viper than
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670 they are in the original Vi and in other emulators. This is because Viper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671 implements an enhanced vi-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2672 interface to the powerful Emacs keyboard macro facility.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2673
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674 First, any Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675 command can be executed while defining a macro, not just the Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 commands. In particular, the user can invoke Emacs commands via @kbd{M-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677 command-name} or by pressing various function keys on the keyboard. One
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2678 can even use the mouse, although this is usually not useful and is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679 recommended (and macros defined with the use of the mouse cannot be saved in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680 command history and in the startup file, for future use).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2681
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2682 Macros defined by mixing Vi and Emacs commands are represented as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2683 vectors. So, don't be confused when you see one (usually through the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2684 history of Ex commands). For instance, if @kbd{gg} is defined by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2685 @kbd{l}, the up-arrow key and @kbd{M-x next-line}, its definition will look
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2686 as follows in Emacs (in XEmacs, it looks slightly different, see below):
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2687
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2688 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2689 [l up (meta x) n e x t - l i n e return]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2690 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2691
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692 Second, Viper macros are defined in a WYSIWYG style. This means that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693 commands are executed as you type them, so you can see precisely what is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2694 being defined. Third, macros can be bound to arbitrary sequences of keys,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2695 not just to printable keys. For instance, one can define a macro that will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2696 be invoked by hitting @kbd{f3} then @kbd{f2} function keys. (The keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2697 @kbd{delete} and @kbd{backspace} are excluded; also, a macro invocation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2698 sequence can't start with ESC. Some other keys, such as @kbd{f1} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2699 @kbd{help}, can't be bound to macros under Emacs (not XEmacs), since they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2700 are bound in @code{key-translation-map}, which overrides any other binding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2701 the user gives to keys. In general, keys that have a binding in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2702 @code{key-translation-map} can't be bound to a macro.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 Fourth, in Viper, one can define macros that are specific to a given
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 buffer, a given major mode, or macros that are defined for all buffers. In
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706 fact, the same macro name can have several different definitions: one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 global, several definitions for various major modes, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708 definitions for various specific buffers. Buffer-specific definitions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 override mode-specific definitions, which, in turn, override global
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 definitions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712 As if all that is not enough, Viper (through its interface to Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 macros) lets the user define keyboard macros that ask for confirmation or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 even prompt the user for input and then continue. To do this, one should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715 type @kbd{C-x q} (for confirmation) or @kbd{C-u C-x q} (for prompt).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 For details, @pxref{Kbd Macro Query,,Customization,emacs,The GNU Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717 Manual} @refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719 When the user finishes defining a macro (which is done by typing @kbd{C-x)} ---
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 a departure from Vi), you will be asked whether you want this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721 macro to be global, mode-specific, or buffer-specific. You will also be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722 given a chance to save the macro in your @file{~/.vip} file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723 This is the easiest way to save a macro and make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 it permanently available. If you work your startup files with bare hands,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725 here is how Viper saves the above macro so that it will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726 available in Viper's Insert state (and Replace state) in buffer @code{my-buf}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727 only:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730 (vip-record-kbd-macro "gg" 'insert-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2731 [l up (meta x) n e x t - l i n e return]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2732 "my-buf")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2733 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736 To do the same for Vi state and all buffers with the major mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737 @code{cc-mode}, use:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740 (vip-record-kbd-macro "gg" 'vi-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2741 [l up (meta x) n e x t - l i n e return]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2742 'cc-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2744
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746 Both macro names and macro definitions are vectors of symbols that denote
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747 keys on the keyboard. Some keys, like @kbd{\}, @kbd{ }, or digit-keys must
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 be escaped with a backslash. Modified keys are represented as lists. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 instance, holding Meta and Control and pressing @kbd{f4} is represented as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750 @kbd{(control meta f4)}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 If all members of a vectors are printable characters (or sequences, such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 @kbd{\e}, @kbd{\t}, for ESC and TAB), then they can also be represented as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 strings:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2756 (vip-record-kbd-macro "aa" 'vi-state "aaa\e" "my-buffer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 Thus, typing @kbd{aa} fast in Vi state will switch Viper to Insert state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761 (due to the first @kbd{a}), insert @kbd{aa}, and then it will switch back to Vi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2762 state. All this will take effect only in the buffer named @code{my-buffer}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2763
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764 Note that the last argument to @code{vip-record-kbd-macro} must be either a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2765 string (a buffer name), a symbol representing a major mode, or @code{t};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2766 the latter says that the macro is to be defined for all buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2767 (which is how macros are defined in original Vi).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2768
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769 For convenience, Viper also lets you define Vi-style macros in its Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 state. There is no Ex command, like @kbd{:map} and @kbd{:map!} for doing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771 this, but the user can include such a macro in the @file{~/.vip} file. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772 only thing is that the @code{vip-record-kbd-macro} command should specify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773 @code{'emacs-state} instead of @code{'vi-state} or @code{'insert-state}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2774
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2775 The user can get rid of a macro either by using the Ex commands @kbd{:unmap}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776 and @kbd{:unmap!} or by issuing a call to @code{vip-unrecord-kbd-macro}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777 The latter is more powerful, since it can delete macros even in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778 @code{'emacs-state}. However, @code{vip-unrecord-kbd-macro} is usually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779 needed only when the user needs to get rid of the macros that are already
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 predefined in Viper.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 The syntax is:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782 @findex @code{vip-unrecord-kbd-macro}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784 (vip-unrecord-kbd-macro macro state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787 The second argument must be @code{'vi-state}, @code{'insert-state}, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788 @code{'emacs-state}. The first argument is a name of a macro. To avoid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 mistakes in specifying names of existing macros, type @kbd{M-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2790 vip-describe-kbd-macros} and use a name from the list displayed by this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 If an error occurs during macro definition, Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794 aborts the process, and it must be repeated. This is analogous to Vi,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 except that in Vi the user doesn't know there is an error until the macro is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 actually run. All that means that in order for a definition to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 successful, the user must do some simple planning of the process in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798 advance, to avoid errors. For instance, if you want to map @kbd{gg} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799 @kbd{llll} in Vi state, you must make sure that there is enough room on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 current line. Since @kbd{l} moves the cursor forward, it may signal an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801 error on reaching the end of line, which will abort the definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803 These precautions are necessary only when defining macros; they will help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804 avoid the need to redo the job. When macros are actually run, an error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805 during the execution will simply terminate the current execution
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2806 (but the macro will remain mapped).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2808 A macro name can be a string of characters or a vector of keys.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2809 The latter makes it possible to define macros bound to, say, double-hits
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2810 on a function key, such as @kbd{up} or @kbd{f13}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2811 This is very useful if you run out of function keys on your keyboard; it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2812 makes Viper macro facility a @emph{keyboard doubler}, so to speak.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2813
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2814 Elsewhere (@xref{Keybindings}, for details), we review
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815 the standard Emacs mechanism for binding function keys to commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 For instance,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2817
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819 (global-set-key [f13] 'repeat-complex-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2821
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2822 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823 binds the key f13 to the Emacs function that repeats the last minibuffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2824 command. Under Viper, however, you may still use this key for additional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 purposes, if you bind, say, a double-hitting action for that key to some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 other function. Emacs doesn't allow the user to do that, but Viper does
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827 this through its keyboard macro facility. To do this, type @kbd{:map }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828 first. When you are asked to enter a macro name, hit f13 twice, followed by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829 RET or SPC.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2831 Emacs will now start the mapping process by actually executing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2832 Vi and Emacs commands, so that you could see what will happen each time the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2833 macro is executed. Suppose now we wanted to bind the key sequence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2834 @kbd{f13 f13} to the command @code{eval-last-sexp}. To accomplish this, we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 can type @kbd{M-x eval-last-sexp} followed by @kbd{C-x )}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836 If you answer positively to Viper's offer to save this macro in @file{~/.vip}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 for future uses, the following will be inserted in that file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 (vip-record-kbd-macro [f16 f16] 'vi-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 [(meta x) e v a l - l a s t - s e x p]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842 'lisp-interaction-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845 To illustrate the above point, Viper provides two canned macros, which, by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846 default, are bound to @kbd{[f12 \1]} and @kbd{[f12 \2]} (invoked by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847 @kbd{f12} then @kbd{1} and @kbd{2}, respectively). These macros are useful
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2848 shortcuts to Viper's command ring history. The first macro will execute the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2849 second-last destructive command (the last one is executed by @kbd{.}, as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2850 usual). The second macro executes the third-last command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2851
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2852 If you need to go deeper into the command history, you will have to use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853 other commands, as described earlier in this section; or you can bind,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854 say, @kbd{f12 \3} like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 (vip-record-kbd-macro [f12 \3] 'vi-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 [(meta x) r e p e a t - f r o m - h i s t o r y]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863 Note that even though the macro uses the function key @kbd{f12}, the key is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864 actually free and can still be bound to some Emacs function via
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865 @code{define-key} or @code{global-set-key}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2866
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2868 Viper allows the user to define macro names that are prefixes of other macros.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2869 For instance, one can define @kbd{[[} and @kbd{[[[[} to be macros.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2870 If you type the exact sequence of such keys and then pause, Viper will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2871 execute the right macro. However, if you don't pause and, say, type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2872 @kbd{[[[[text} then the conflict is resolved as follows. If only one of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2873 key sequences, @kbd{[[} or @kbd{[[[[} has a definition applicable to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2874 current buffer, then, in fact, there is no conflict and the right macro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875 will be chosen. If both have applicable definitions, then the first one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 found will be executed. Usually this is the macro with a shorter name. So,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877 in our case, @kbd{[[[[text} will cause the macro @kbd{[[} to be executed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878 twice and then the remaining keys, @kbd{t e x t}, will be processed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2880 When defining macros using @kbd{:map} or @kbd{:map!}, the user enters the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881 actually keys to be used to invoke the macro. For instance, you should hit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882 the actual key @kbd{f6} if it is to be part of a macro name; you do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 @emph{not} write `f 6'. When entering keys, Viper displays them as strings or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884 vectors (e.g., "abc" or [f6 f7 a]). The same holds for unmapping. Hitting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2885 TAB while typing a macro name in the @kbd{:unmap} or @kbd{:unmap!} command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886 will cause name completion. Completions are displayed as strings or vectors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2887 However, as before, you don't actually type ``"'', ``['', or ``]'' that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2888 appear in the completions. These are meta-symbols that indicate whether
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2889 the corresponding macro name is a vector or a string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2890
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2891 One last difference from Vi: Vi-style keyboard macros cannot be defined in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2892 terms of other Vi-style keyboard macros (but named Emacs macros are OK).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2893 More precisely, while defining or executing a macro, the special meaning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2894 of key sequences (as Vi macros) is ignored.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 This is because it is all too easy to create an infinite loop in this way.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2896 Since Viper macros are much more powerful than Vi's it is impossible to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2897 detect such loops. In practice, this is not really a limitation but,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2898 rather, a feature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2899
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2900 We should also note that Vi macros are disabled in the Minibuffer, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2901 helps keep some potential troubles away.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2902
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2903 The rate at which the user must type keys in order for them to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2904 recognized as a timeout macro is controlled by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2905 @code{vip-fast-keyseq-timeout}, which defaults to 200 milliseconds.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906 @vindex @code{vip-fast-keyseq-timeout}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908 For the most part, Viper macros defined in @file{~/.vip} can be shared
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2909 between Emacs, XEmacs, and X and TTY modes. However, macros defined via
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2910 function keys may need separate definitions when XEmacs and Emacs have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2911 different names for the same keyboard key. For instance, the `Page Up' key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2912 may be known in Emacs as @kbd{prior} and in XEmacs as @kbd{pgup}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2913 The problem with TTY may be that the function keys there generate sequences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2914 of events instead of a single event (as under a window system).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2915 Both Emacs and XEmacs mape some of these sequences back to the logical keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2916 (e.g., the sequences generated by the arrow keys are mapped to @kbd{up},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2917 @kbd{left}, etc.). However, not all function keys are mapped in this way.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2918 Macros that are bound to key sequences that contain such unmapped function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2919 keys have to be redefined for TTY's (and possibly for every type of TTY you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2920 may be using). To do this, start Emacs on an appropriate TTY device and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2921 define the macro using @kbd{:map}, as usual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2922
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2923 @findex @code{vip-describe-kbd-macros}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2924 Finally, Viper provides a function that conveniently displays all macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2925 currently defined. To see all macros along with their definitions, type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2926 @kbd{M-x vip-describe-kbd-macros}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2927
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2928 @include viper-cmd.texi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2930 @node Acknowledgments,,,Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2931 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2932 @unnumbered Acknowledgments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2934 Viper, formerly known as VIP-19, was written by Michael Kifer. Viper is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2935 based on the original VIP package by Masahiko Sato and on its enhancement,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936 VIP 4.4, by Aamod Sane. This manual is an adaptation of the manual for VIP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937 4.4, which, in turn, was based on Sato's manual for VIP 3.5.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2939 Many contributors on the net pointed out bugs and suggested a number of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940 useful features. Here is a (hopefully) complete list of contributors:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2942 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2943 jjm@@hplb.hpl.hp.com (Jean-Jacques Moreau), jl@@cse.ogi.edu (John
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2944 Launchbury), rxga@@ulysses.att.com, jamesm@@bga.com (D.J. Miller II),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2945 ascott@@fws214.intel.com (Andy Scott), toma@@convex.convex.com,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946 dave@@hellgate.utah.edu, cook@@biostat.wisc.edu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 (Tom Cook), lindstro@@biostat.wisc.edu (Mary Lindstrom),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 edmonds@@edmonds.home.cs.ubc.ca (Brian Edmonds), mveiga@@dit.upm.es
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949 (Marcelino Veiga Tuimil), dwight@@toolucky.llnl.gov (Dwight Shih),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2950 phil_brooks@@MENTORG.COM (Phil Brooks), kin@@isi.com (Kin Cho),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2951 ahg@@panix.com (Al Gelders), dwallach@@cs.princeton.edu (Dan Wallach),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2952 hpz@@ibmhpz.aug.ipp-garching.mpg.de (Hans-Peter Zehrfeld),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2953 simonb@@prl.philips.co.uk (Simon Blanchard), Mark.Bordas@@East.Sun.COM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2954 (Mark Bordas), gviswana@@cs.wisc.edu (Guhan Viswanathan),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2955 meyering@@comco.com (Jim Meyering), pfister@@cs.sunysb.edu (Hanspeter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2956 Pfister), amade@@diagram.fr (Paul-Bernard Amade),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2957 jackr@@dblues.engr.sgi.com (Jack Repenning),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958 pogrell@@informatik.hu-berlin.de (Lutz Pogrell),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 csdayton@@midway.uchicago.edu (Soren Dayton),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960 pradyut@@cs.uchicago.edu (Pradyut Shah),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961 vrenjak@@sun1.racal.com (Milan Vrenjak),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 gvr@@halcyon.com (George V. Reilly),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963 whicken@@dragon.parasoft.com (Wendell Hicken),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2964 terra@@diku.dk (Morten Welinder),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2965 kanze@@gabi-soft.fr (James Kanze),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2966 hatazaki@@bach.convex.com (Takao Hatazaki),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2967 sawdey@@lcse.umn.edu (Aaron Sawdey),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2968 jobrien@@hchp.org (John O'Brien),
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2969 mrb@@Eng.Sun.COM (Martin Buchholz),
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
2970 kwzh@@gnu.ai.mit.edu (Karl Heuer),
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 16
diff changeset
2971 sudish@@MindSpring.COM (Sudish Joseph),
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 16
diff changeset
2972 paulk@@summit.esg.apertus.com (Paul Keusemann)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2973 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2974
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2975
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2976 @node Key Index,Function Index,,Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2977 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2978 @unnumbered Key Index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2979
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2980 @printindex ky
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2981
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2982 @node Function Index,Variable Index,Key Index,Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2983 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2984 @unnumbered Function Index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2985
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2986 @printindex fn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2987
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2988 @node Variable Index,Package Index,Function Index,Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2989 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 @unnumbered Variable Index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2992 @printindex vr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994 @node Package Index,Concept Index,Variable Index,Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996 @unnumbered Package Index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998 @printindex pg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000 @node Concept Index,,Package Index,Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3001 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002 @unnumbered Concept Index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004 @printindex cp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006 @contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 @bye