comparison man/viper.texi @ 175:2d532a89d707 r20-3b14

Import from CVS: tag r20-3b14
author cvs
date Mon, 13 Aug 2007 09:50:14 +0200
parents 0132846995bd
children bfd6434d15b3
comparison
equal deleted inserted replaced
174:bb3568571b84 175:2d532a89d707
13 @end iftex 13 @end iftex
14 14
15 @titlepage 15 @titlepage
16 @title Viper Is a Package for Emacs Rebels 16 @title Viper Is a Package for Emacs Rebels
17 @subtitle a Vi emulator for GNU Emacs 19 and XEmacs 19 17 @subtitle a Vi emulator for GNU Emacs 19 and XEmacs 19
18 @subtitle June 1997, Viper Version 2.94 18 @subtitle July 1997, Viper Version 2.95
19 19
20 @author Masahiko Sato (VIP 3.5) 20 @author Masahiko Sato (VIP 3.5)
21 @author Aamod Sane (VIP 4.4) 21 @author Aamod Sane (VIP 4.4)
22 @author Michael Kifer (Viper) 22 @author Michael Kifer (Viper)
23 23
26 @end titlepage 26 @end titlepage
27 27
28 @unnumbered Distribution 28 @unnumbered Distribution
29 29
30 @noindent 30 @noindent
31 Copyright @copyright{} 1995, 1996 Free Software Foundation, Inc. 31 Copyright @copyright{} 1995, 1996, 1997 Free Software Foundation, Inc.
32 32
33 Permission is granted to make and distribute verbatim copies of 33 Permission is granted to make and distribute verbatim copies of
34 this manual provided the copyright notice and this permission notice 34 this manual provided the copyright notice and this permission notice
35 are preserved on all copies. 35 are preserved on all copies.
36 36
117 Viper Is a Package for Emacs Rebels; 117 Viper Is a Package for Emacs Rebels;
118 it is a VI Plan for Emacs Rescue 118 it is a VI Plan for Emacs Rescue
119 and/or a venomous VI PERil. 119 and/or a venomous VI PERil.
120 @end example 120 @end example
121 121
122 Technically speaking, Viper is a Vi emulation package for GNU Emacs 19 and 122 Viper is a Vi emulation package for GNU Emacs 19 and XEmacs 19. Because of
123 XEmacs 19. Because of its reliance on minor mode keymaps, 123 its reliance on minor mode keymaps, it will not work under Emacs 18. Viper
124 it will not work under Emacs 18. Viper contains virtually all of 124 contains virtually all of Vi and Ex functionality and much more. It gives
125 Vi and Ex functionality and much more. It gives you the best of both 125 you the best of both worlds: Vi keystrokes for editing combined with the
126 worlds: Vi keystrokes for editing combined with the GNU Emacs 126 GNU Emacs environment. Viper also fixes some common complaints with Vi
127 environment. Viper also fixes some common complaints with Vi commands. 127 commands. This manual describes Viper, concentrating on the differences
128 This manual describes Viper, concentrating on the differences from Vi and 128 from Vi and on the new features of Viper.
129 on the new features of Viper. 129
130 130 Viper was written by Michael Kifer. It is based on VIP version 3.5 by
131 Viper, formerly known as VIP-19, was written by Michael Kifer. It is based 131 Masahiko Sato and VIP version 4.4 by Aamod Sane. Viper tries to be
132 on VIP version 3.5 by Masahiko Sato and VIP version 4.4 by Aamod Sane. 132 compatible with these packages.
133 Viper tries to be compatible with these packages. 133
134 134 Viper is intended to be usable out of the box, without reading this manual
135 Viper is intended to be usable without reading this manual --- the defaults 135 --- the defaults are set to make Viper as close to Vi as possible. At
136 are set to make Viper as close to Vi as possible. At startup, Viper will 136 startup, Viper will attempt to set the most appropriate default environment
137 attempt to set the most appropriate default environment for you, based on 137 for you, based on your familiarity with Emacs. It will also tell you the
138 your familiarity with Emacs. It will also tell you the basic GNU Emacs window 138 basic GNU Emacs window management commands to help you start immediately.
139 management commands to help you start immediately.
140 139
141 Although this manual explains how to customize Viper, some basic 140 Although this manual explains how to customize Viper, some basic
142 familiarity with Emacs Lisp would be a plus. 141 familiarity with Emacs Lisp would be a plus.
143 142
144 It is recommended that you read the chapter Overview. The other chapters 143 It is recommended that you read the chapter Overview. The other chapters
280 are involved when Viper emulates Vi command mode, Vi insert mode, etc. 279 are involved when Viper emulates Vi command mode, Vi insert mode, etc.
281 You can also turn Viper on and off at any time while in Vi command mode. 280 You can also turn Viper on and off at any time while in Vi command mode.
282 @xref{States in Viper}, for 281 @xref{States in Viper}, for
283 more information.@refill 282 more information.@refill
284 283
285 Emacs uses Control and Meta modifiers. These are denoted as C 284 Emacs uses Control and Meta modifiers. These are denoted as C and M,
286 and M, e.g. @kbd{^Z} as @kbd{C-z} and @kbd{Meta-x} as @kbd{M-x}. 285 e.g. @kbd{^Z} as @kbd{C-z} and @kbd{Meta-x} as @kbd{M-x}. The Meta key is
287 The Meta key is usually located on each side of the Space bar; it is used 286 usually located on each side of the Space bar; it is used in a manner
288 in a manner similar to the Control key, e.g., @kbd{M-x} means typing 287 similar to the Control key, e.g., @kbd{M-x} means typing @kbd{x} while
289 @kbd{x} while holding the Meta key down. 288 holding the Meta key down. For keyboards that do not have a Meta key,
290 For keyboards that do not have a Meta key, @key{ESC} is used as Meta. 289 @key{ESC} is used as Meta. Thus @kbd{M-x} is typed as @kbd{@key{ESC}
291 Thus @kbd{M-x} is typed as @kbd{@key{ESC} x}. Viper uses @key{ESC} to switch 290 x}. Viper uses @key{ESC} to switch from Insert state to Vi state. Therefore
292 from Insert state to Vi state. Therefore Viper defines @kbd{C-\} as its Meta 291 Viper defines @kbd{C-\} as its Meta key in Vi state. @xref{Vi State}, for
293 key in Vi state. @xref{Vi State}, for more info.@refill 292 more info.@refill
294 293
295 Emacs is structured as a lisp interpreter around a C core. Emacs keys 294 Emacs is structured as a lisp interpreter around a C core. Emacs keys
296 cause lisp functions to be called. It is possible to call these 295 cause lisp functions to be called. It is possible to call these
297 functions directly, by typing @kbd{M-x function-name}. 296 functions directly, by typing @kbd{M-x function-name}.
298 297
299 @node Loading Viper, States in Viper, Emacs Preliminaries, Overview 298 @node Loading Viper, States in Viper, Emacs Preliminaries, Overview
300 @section Loading Viper 299 @section Loading Viper
301 300
302 The most common way to load it automatically is to include the lines (in 301 The most common way to load it automatically is to include the following
303 the given order!): 302 lines (in the given order!):
304 303
305 @lisp 304 @lisp
306 (setq viper-mode t) 305 (setq viper-mode t)
307 (require 'viper) 306 (require 'viper)
308 @end lisp 307 @end lisp
309 308
310 @noindent 309 @noindent
311 in your @file{~/.emacs} file. The @file{.emacs} file is placed in your 310 in your @file{~/.emacs} file. The @file{.emacs} file is placed in your
312 home directory and it is be executed every time you invoke Emacs. Viper 311 home directory and it is be executed every time you invoke Emacs. This is
313 also uses the file @file{~/.viper} for Viper-specific customization. If you 312 the place where all general Emacs customization takes place. Beginning with
314 wish to be in Vi command state whenever this is deemed appropriate by the 313 version 20.0, Emacsen have an interactive interface, which simplifies the
315 author, you can include the following line in your @file{.viper}: 314 job of customization significantly.
315
316 Viper also uses the file @file{~/.viper} for Viper-specific customization.
317 If you wish to be in Vi command state whenever this is deemed appropriate
318 by the author, you can include the following line in your @file{.viper}:
316 @lisp 319 @lisp
317 (setq viper-always t) 320 (setq viper-always t)
318 @end lisp 321 @end lisp
319 @noindent 322 @noindent
320 (@xref{Vi State}, for the explanation of Vi command state.) 323 (@xref{Vi State}, for the explanation of Vi command state.)
324
325 The location of Viper customization file can be changed by setting the
326 variable @code{vip-custom-file-name} in @file{.emacs} @emph{prior} to loading
327 Viper.
321 328
322 Once invoked, Viper will arrange to bring up Emacs buffers in Vi state 329 Once invoked, Viper will arrange to bring up Emacs buffers in Vi state
323 whenever this makes sense. 330 whenever this makes sense.
324 @xref{Packages that Change Keymaps}, to find out when forcing Vi command state 331 @xref{Packages that Change Keymaps}, to find out when forcing Vi command state
325 on a buffer may be counter-productive. 332 on a buffer may be counter-productive.
337 @samp{Lisp Interaction} mode. After you invoke Viper, you can start 344 @samp{Lisp Interaction} mode. After you invoke Viper, you can start
338 editing files by using @kbd{:e}, @kbd{:vi}, or @kbd{v} commands. 345 editing files by using @kbd{:e}, @kbd{:vi}, or @kbd{v} commands.
339 (@xref{File and Buffer Handling}, for more information on @kbd{v} and other 346 (@xref{File and Buffer Handling}, for more information on @kbd{v} and other
340 new commands that, in many cases, are more convenient than @kbd{:e}, 347 new commands that, in many cases, are more convenient than @kbd{:e},
341 @kbd{:vi}, and similar old-style Vi commands.)@refill 348 @kbd{:vi}, and similar old-style Vi commands.)@refill
349
350 Finally, if at some point you would want to get de-Viperize your running
351 copy of Emacs after Viper has been loaded, the command @kbd{M-x
352 viper-go-away} will do it for you.
342 353
343 @node States in Viper, The Minibuffer, Loading Viper,Overview 354 @node States in Viper, The Minibuffer, Loading Viper,Overview
344 @section States in Viper 355 @section States in Viper
345 356
346 @kindex @kbd{C-z} 357 @kindex @kbd{C-z}
349 @cindex Emacs state 360 @cindex Emacs state
350 @cindex Vi state 361 @cindex Vi state
351 @cindex Insert state 362 @cindex Insert state
352 @cindex Replace state 363 @cindex Replace state
353 @cindex Ex commands 364 @cindex Ex commands
365 @findex @code{viper-go-away}
354 366
355 Viper has four states, Emacs, Vi, Insert, and Replace. 367 Viper has four states, Emacs, Vi, Insert, and Replace.
356 368
357 @table @samp 369 @table @samp
358 @item Emacs state 370 @item Emacs state
359 This is the state plain vanilla Emacs is normally in. After you have loaded 371 This is the state plain vanilla Emacs is normally in. After you have loaded
360 Viper, @kbd{C-z} will normally take you to Vi command state. Another 372 Viper, @kbd{C-z} will normally take you to Vi command state. Another
361 @kbd{C-z} will take you back to Emacs state. This toggle key can be 373 @kbd{C-z} will take you back to Emacs state. This toggle key can be
362 changed, @pxref{Customization} You can also type @kbd{M-x viper-mode} to 374 changed, @pxref{Customization} You can also type @kbd{M-x viper-mode} to
363 change to Vi state.@refill 375 change to Vi state.@refill
376
364 377
365 For users who chose to set their user level to 1 at Viper setup time, 378 For users who chose to set their user level to 1 at Viper setup time,
366 switching to Emacs state is deliberately made harder in order to not 379 switching to Emacs state is deliberately made harder in order to not
367 confuse the novice user. In this case, @kbd{C-z} will either iconify Emacs 380 confuse the novice user. In this case, @kbd{C-z} will either iconify Emacs
368 (if Emacs runs as an application under X Windows) or it will stop Emacs (if 381 (if Emacs runs as an application under X Windows) or it will stop Emacs (if
512 @item C-\ 525 @item C-\
513 @kindex @kbd{C-\} 526 @kindex @kbd{C-\}
514 @cindex Meta key 527 @cindex Meta key
515 528
516 Viper uses @key{ESC} as a switch between Insert and Vi states. Emacs uses 529 Viper uses @key{ESC} as a switch between Insert and Vi states. Emacs uses
517 @key{ESC} for Meta. We need a Meta key to call the Meta key functions 530 @key{ESC} for Meta. We need a Meta key to call the Meta key functions such
518 such as @kbd{M-x function name}. This role is played by the key @kbd{C-\}. 531 as @kbd{M-x function name}. This role is played by the key @kbd{C-\}.
519 Thus, to 532 Thus, to get @kbd{M-x}, you should type @kbd{C-\ x} (if the keyboard has no
520 get @kbd{M-x}, you should type @kbd{C-\ x} (if the keyboard has no Meta key). 533 Meta key). This works both in the Vi state and the Insert state.
521 This works both in the Vi state and the Insert state. 534 Alternatively, you can use @kbd{\ @key{ESC}} in Vi state to simulate the
522 Alternatively, you can use @kbd{\ @key{ESC}} in Vi state to simulate the meta 535 meta key. It is possible to use @key{ESC} as Meta, but then you cannot
523 key.
524 It is possible to use @key{ESC} as Meta, but then you cannot
525 press @key{ESC} multiple times in Vi state. @xref{Customization}, to find 536 press @key{ESC} multiple times in Vi state. @xref{Customization}, to find
526 out how to rebind @key{ESC} to be Meta.@refill 537 out how to rebind @key{ESC} to be Meta.@refill
527 @end table 538 @end table
528 @noindent 539 @noindent
529 Other differences are mostly improvements. The ones you should know 540 Other differences are mostly improvements. The ones you should know
685 @subsection Replace State 696 @subsection Replace State
686 697
687 @cindex Replace state 698 @cindex Replace state
688 699
689 This state is entered through Vi replacement commands, such as @kbd{C}, 700 This state is entered through Vi replacement commands, such as @kbd{C},
690 @kbd{cw}, etc., or by typing @kbd{R}. In Replace state, Viper puts <R> in the 701 @kbd{cw}, etc., or by typing @kbd{R}. In Replace state, Viper puts <R> in
691 mode line to let you know which state is in effect. If Replace state is 702 the mode line to let you know which state is in effect. If Replace state is
692 entered through @kbd{R}, Viper stays in that state until the user hits 703 entered through @kbd{R}, Viper stays in that state until the user hits
693 @key{ESC}. 704 @key{ESC}. If this state is entered via the other replacement commands,
694 If this state is entered via the other replacement commands, then Replace 705 then Replace state is in effect until you hit @key{ESC} or until you cross
695 state is in effect until you hit @key{ESC} or until you cross the rightmost 706 the rightmost boundary of the replacement region. In the latter case, Viper
696 boundary of the replacement region. In the latter case, Viper changes its 707 changes its state from Replace to Insert (which you will notice by the
697 state from Replace to Insert (which you will notice by the change in the 708 change in the mode line).
698 mode line).
699 709
700 Since Viper runs under Emacs, it is possible to switch between buffers 710 Since Viper runs under Emacs, it is possible to switch between buffers
701 while in Replace state. You can also move the cursor using the arrow keys 711 while in Replace state. You can also move the cursor using the arrow keys
702 (even on dumb terminals!) and the mouse. Because of this freedom (which is 712 (even on dumb terminals!) and the mouse. Because of this freedom (which is
703 unattainable in regular Vi), it is possible to take the cursor outside the 713 unattainable in regular Vi), it is possible to take the cursor outside the
1199 @code{vip-syntax-preference} is set to @code{strict-vi} (the default) then 1209 @code{vip-syntax-preference} is set to @code{strict-vi} (the default) then
1200 the meaning of @emph{word} is the same as in 1210 the meaning of @emph{word} is the same as in
1201 Vi. However, if the value is @code{reformed-vi} then the alphanumeric 1211 Vi. However, if the value is @code{reformed-vi} then the alphanumeric
1202 symbols will be those specified by the current Emacs syntax table (which 1212 symbols will be those specified by the current Emacs syntax table (which
1203 may be different for different major modes) plus the underscore symbol 1213 may be different for different major modes) plus the underscore symbol
1204 @code{_}. The user can also specify the value @code{emacs}, which would 1214 @kbd{_}. The user can also specify the value @code{emacs}, which would
1205 make Viper use exactly the Emacs notion of word. In particular, the 1215 make Viper use exactly the Emacs notion of word. In particular, the
1206 underscore may not be part of a word. Finally, if 1216 underscore may not be part of a word. Finally, if
1207 @code{vip-syntax-preference} is set to @code{extended}, Viper words would 1217 @code{vip-syntax-preference} is set to @code{extended}, Viper words would
1208 consist of characters that are classified as alphanumeric @emph{or} as 1218 consist of characters that are classified as alphanumeric @emph{or} as
1209 parts of symbols. This is convenient for writing programs and in many other 1219 parts of symbols. This is convenient for writing programs and in many other
1517 Elisp code in a @file{.viper} file in your home directory. Viper 1527 Elisp code in a @file{.viper} file in your home directory. Viper
1518 loads @file{.viper} just before it does the binding for mode 1528 loads @file{.viper} just before it does the binding for mode
1519 hooks. This is the recommended method. 1529 hooks. This is the recommended method.
1520 @item 1530 @item
1521 @cindex .emacs 1531 @cindex .emacs
1522 Elisp code in your @file{.emacs} file before and after the 1532 Elisp code in your @file{.emacs} file before and after the @code{(require
1523 @code{(require 'viper)} line. This method is not recommended, unless you 1533 'viper)} line. This method is not recommended, unless you know what you are
1524 are know what you are doing.@refill 1534 doing. Only two variables, @code{viper-mode} and
1535 @code{vip-custom-file-name} are supposed to be customized in @file{.emacs},
1536 prior to loading Viper.@refill
1525 @end itemize 1537 @end itemize
1526 1538
1527 @noindent 1539 @noindent
1528 Emacs customization is done in Emacs Lisp. For the common cases, 1540 Most of Viper's behavior can be customized via the interactive Emacs user
1529 examples are provided that you can use directly. 1541 interface. Choose "Customize" from the menubar, click on "Editing", then on
1542 "Emulations". The customization widget is self-explanatory. Once you are
1543 satisfied with your changes, save them into a file and then include the
1544 contents of that file in the Viper customization repository, @file{.viper}
1545 (except for @code{viper-mode} and @code{vip-custom-file-name}, which are
1546 supposed to go into @code{.emacs}).
1547
1548 Some advanced customization cannot be accomplished this way, however, and
1549 has to be done in Emacs Lisp. For the common cases, examples are provided
1550 that you can use directly.
1530 1551
1531 @menu 1552 @menu
1532 * Rudimentary Changes:: Simple constant definitions. 1553 * Rudimentary Changes:: Simple constant definitions.
1533 * Keybindings:: Enabling Emacs Keys, Rebinding keys, etc. 1554 * Keybindings:: Enabling Emacs Keys, Rebinding keys, etc.
1534 * Packages that Change Keymaps:: How to deal with such beasts. 1555 * Packages that Change Keymaps:: How to deal with such beasts.
1574 own values of @code{vip-auto-indent}. This can be achieved by using 1595 own values of @code{vip-auto-indent}. This can be achieved by using
1575 @code{setq} to change the local value of this variable in the hooks to the 1596 @code{setq} to change the local value of this variable in the hooks to the
1576 appropriate major modes. 1597 appropriate major modes.
1577 1598
1578 @kbd{:se ai} changes the value of @code{vip-auto-indent} in the current 1599 @kbd{:se ai} changes the value of @code{vip-auto-indent} in the current
1579 buffer only; @kbd{:se gai} does the same globally. 1600 buffer only; @kbd{:se ai-g} does the same globally.
1580 @item vip-electric-mode t 1601 @item vip-electric-mode t
1581 If not @code{nil}, auto-indentation becomes electric, which means that 1602 If not @code{nil}, auto-indentation becomes electric, which means that
1582 @key{RET}, @kbd{O}, and @kbd{o} indent cursor according to the current 1603 @key{RET}, @kbd{O}, and @kbd{o} indent cursor according to the current
1583 major mode. In the future, this variable may control additional electric 1604 major mode. In the future, this variable may control additional electric
1584 features. 1605 features.
1611 1632
1612 The command @kbd{:se ts} 1633 The command @kbd{:se ts}
1613 sets the tab width in the current 1634 sets the tab width in the current
1614 buffer only; it has no effect on other buffers. 1635 buffer only; it has no effect on other buffers.
1615 1636
1616 The command @kbd{:se gts} sets tab width globally, 1637 The command @kbd{:se ts-g} sets tab width globally,
1617 for all buffers where the tab is not yet set locally, 1638 for all buffers where the tab is not yet set locally,
1618 including the new buffers. 1639 including the new buffers.
1619 1640
1620 Note that typing @key{TAB} normally 1641 Note that typing @key{TAB} normally
1621 doesn't insert the tab, since this key is usually bound to 1642 doesn't insert the tab, since this key is usually bound to
1632 The number of columns shifted by @kbd{>} and @kbd{<} commands. 1653 The number of columns shifted by @kbd{>} and @kbd{<} commands.
1633 @item vip-search-wrap-around t 1654 @item vip-search-wrap-around t
1634 @itemx :se ws (:se wrapscan) 1655 @itemx :se ws (:se wrapscan)
1635 If not @code{nil}, search wraps around the end/beginning of buffer. 1656 If not @code{nil}, search wraps around the end/beginning of buffer.
1636 @item vip-search-scroll-threshold 2 1657 @item vip-search-scroll-threshold 2
1637 In search lands within this many lines of the window top or bottom, the 1658 If search lands within this many lines of the window top or bottom, the
1638 window will be scrolled up or down by about 1/7-th of its size, to reveal 1659 window will be scrolled up or down by about 1/7-th of its size, to reveal
1639 the context. If the value is negative---don't scroll. 1660 the context. If the value is negative---don't scroll.
1640 @item vip-tags-file-name "TAGS" 1661 @item vip-tags-file-name "TAGS"
1641 The name of the file used as the tag table. 1662 The name of the file used as the tag table.
1642 @item vip-re-query-replace nil 1663 @item vip-re-query-replace nil
1652 If you set this to @code{nil}, you can use @key{ESC} as Meta in Vi state. 1673 If you set this to @code{nil}, you can use @key{ESC} as Meta in Vi state.
1653 Normally, this is not necessary, since graphical displays have separate 1674 Normally, this is not necessary, since graphical displays have separate
1654 Meta keys (usually on each side of the space bar). On a dumb terminal, Viper 1675 Meta keys (usually on each side of the space bar). On a dumb terminal, Viper
1655 sets this variable to @code{twice}, which is almost like @code{nil}, except 1676 sets this variable to @code{twice}, which is almost like @code{nil}, except
1656 that double @key{ESC} beeps. This, too, lets @key{ESC} to be used as a Meta. 1677 that double @key{ESC} beeps. This, too, lets @key{ESC} to be used as a Meta.
1657 @item vip-keysequence-delay 140 1678 @item vip-ESC-keyseq-timeout 200 on tty, 0 on windowing display
1658 Escape sequences separated by this much delay are interpreted as command, 1679 Escape key sequences separated by this much delay (in miliseconds) are
1659 ignoring the special meaning of @key{ESC} in VI. The default is suitable 1680 interpreted as command, ignoring the special meaning of @key{ESC} in
1660 for most terminals. However, if your terminal is extremely slow, you might 1681 VI. The default is suitable for most terminals. However, if your terminal
1661 want to increase this slightly. You will know if your terminal is slow if 1682 is extremely slow, you might want to increase this slightly. You will know
1662 the @key{ESC} key sequences emitted by the arrow keys are interpreted as 1683 if your terminal is slow if the @key{ESC} key sequences emitted by the
1663 separately typed characters (and thus the arrow keys won't work). Making 1684 arrow keys are interpreted as separately typed characters (and thus the
1664 this value too large will slow you down, so exercise restraint. 1685 arrow keys won't work). Making this value too large will slow you down, so
1686 exercise restraint.
1687 @item vip-fast-keyseq-timeout 200
1688 Key sequences separated by this many miliseconds are treated as Vi-style
1689 keyboard macros. If the key sequence is defined as such a macro, it will be
1690 executed. Otherwise, it is processed as an ordinary sequence of typed keys.
1691
1692 Setting this variable too high may slow down your typing. Setting it too
1693 low may make it hard to type macros quickly enough.
1665 @item vip-ex-style-motion t 1694 @item vip-ex-style-motion t
1666 Set this to @code{nil}, if you want @kbd{l,h} to cross 1695 Set this to @code{nil}, if you want @kbd{l,h} to cross
1667 lines, etc. @xref{Movement and Markers}, for more info. 1696 lines, etc. @xref{Movement and Markers}, for more info.
1668 @item vip-ex-style-editing-in-insert t 1697 @item vip-ex-style-editing-in-insert t
1669 Set this to to @code{nil}, if you want @key{ESC} to not move back and 1698 Set this to to @code{nil}, if you want
1670 @kbd{C-h} to not stop 1699 @kbd{C-h} and @key{DEL} to not stop
1671 at the beginning of a line in Insert state. 1700 at the beginning of a line in Insert state.
1701 @item vip-ESC-moves-cursor-back t
1702 It t, cursor moves back 1 character when switching from insert state to vi
1703 state. If nil, the cursor stays where it was before the switch.
1672 @item viper-always t 1704 @item viper-always t
1673 @code{t} means: leave it to Viper to decide when a buffer must be brought 1705 @code{t} means: leave it to Viper to decide when a buffer must be brought
1674 up in Vi state, 1706 up in Vi state,
1675 Insert state, or Emacs state. This heuristics works well in virtually all 1707 Insert state, or Emacs state. This heuristics works well in virtually all
1676 cases. @code{nil} means you either has to invoke @code{viper-mode} manually 1708 cases. @code{nil} means you either has to invoke @code{viper-mode} manually
1806 the replacement mode. In this variable is set to @code{nil}, Viper will 1838 the replacement mode. In this variable is set to @code{nil}, Viper will
1807 emulate the standard Vi behavior, which supports only intra-line 1839 emulate the standard Vi behavior, which supports only intra-line
1808 replacement regions (and multi-line replacement regions are deleted). 1840 replacement regions (and multi-line replacement regions are deleted).
1809 @item vip-toggle-key "\C-z" 1841 @item vip-toggle-key "\C-z"
1810 Specifies the key used to switch from Emacs to Vi and back. 1842 Specifies the key used to switch from Emacs to Vi and back.
1811 Must be set in @file{.viper} or prior to loading Viper. This variable can't be 1843 Must be set in @file{.viper}. This variable can't be
1812 changed interactively after Viper is loaded. 1844 changed interactively after Viper is loaded.
1813 1845
1814 In Insert state, this key acts as a temporary escape to Vi state, i.e., it 1846 In Insert state, this key acts as a temporary escape to Vi state, i.e., it
1815 will set Viper up so that the very next command will be executed as if it 1847 will set Viper up so that the very next command will be executed as if it
1816 were typed in Vi state. 1848 were typed in Vi state.
1817 @item vip-ESC-key "\e" 1849 @item vip-ESC-key "\e"
1818 Specifies the key used to escape from Insert/Replace states to Vi. 1850 Specifies the key used to escape from Insert/Replace states to Vi.
1819 Must be set in @file{.viper} or prior to loading Viper. This variable cannot be 1851 Must be set in @file{.viper}. This variable cannot be
1820 changed interactively after Viper is loaded. 1852 changed interactively after Viper is loaded.
1821 @item vip-buffer-search-char nil 1853 @item vip-buffer-search-char nil
1822 Key used for buffer search. @xref{Viper Specials}, for details. 1854 Key used for buffer search. @xref{Viper Specials}, for details.
1823 @item vip-surrounding-word-function 'vip-surrounding-word 1855 @item vip-surrounding-word-function 'vip-surrounding-word
1824 The value of this variable is a function name that is used to determine 1856 The value of this variable is a function name that is used to determine
1862 @vindex @code{vip-re-query-replace} 1894 @vindex @code{vip-re-query-replace}
1863 @vindex @code{vip-want-ctl-h-help} 1895 @vindex @code{vip-want-ctl-h-help}
1864 @vindex @code{vip-vi-style-in-minibuffer} 1896 @vindex @code{vip-vi-style-in-minibuffer}
1865 @vindex @code{vip-no-multiple-ESC} 1897 @vindex @code{vip-no-multiple-ESC}
1866 @vindex @code{viper-always} 1898 @vindex @code{viper-always}
1867 @vindex @code{vip-keysequence-delay} 1899 @vindex @code{vip-ESC-keyseq-timeout}
1900 @vindex @code{vip-fast-keyseq-timeout}
1868 @vindex @code{vip-ex-style-motion} 1901 @vindex @code{vip-ex-style-motion}
1869 @vindex @code{vip-ex-style-editing-in-insert} 1902 @vindex @code{vip-ex-style-editing-in-insert}
1903 @vindex @code{vip-ESC-moves-cursor-back}
1870 @vindex @code{vip-custom-file-name} 1904 @vindex @code{vip-custom-file-name}
1871 @vindex @code{vip-spell-function} 1905 @vindex @code{vip-spell-function}
1872 @vindex @code{ex-cycle-other-window} 1906 @vindex @code{ex-cycle-other-window}
1873 @vindex @code{ex-cycle-through-non-files} 1907 @vindex @code{ex-cycle-through-non-files}
1874 @vindex @code{vip-automatic-iso-accents} 1908 @vindex @code{vip-automatic-iso-accents}
2192 2226
2193 Conversely, it may be the case that most of the major modes harnessed 2227 Conversely, it may be the case that most of the major modes harnessed
2194 by @code{vip-set-hooks} function fit your working style, except one or two 2228 by @code{vip-set-hooks} function fit your working style, except one or two
2195 cases. In this case, you may still be able to set @code{viper-always} to 2229 cases. In this case, you may still be able to set @code{viper-always} to
2196 @code{t} and then remove a hook that forces Vi command state. For instance, 2230 @code{t} and then remove a hook that forces Vi command state. For instance,
2197 to unharness @code{lisp-interaction-mode}, you can put the following line 2231 to unharness @code{lisp-interaction-mode}, you can execute the following line
2198 in your @file{.emacs} (not @code{.viper}!) file after @code{(require 'viper)}: 2232 in @code{vip-load-hook}:
2199 @lisp 2233 @lisp
2200 (remove-hook 'lisp-interaction-mode-hook 'viper-mode) 2234 (remove-hook 'lisp-interaction-mode-hook 'viper-mode)
2201 @end lisp 2235 @end lisp
2236 Note: this type of customization cannot be done in @code{.viper}!
2202 2237
2203 In some rare cases, some minor modes may override certain essential 2238 In some rare cases, some minor modes may override certain essential
2204 bindings in Vi command state. This is not really catastrophic because this 2239 bindings in Vi command state. This is not really catastrophic because this
2205 may happen only in the beginning, when the minor mode kicks in. Typing 2240 may happen only in the beginning, when the minor mode kicks in. Typing
2206 @code{M-x viper-mode} will correct the situation. Viper knows about 2241 @code{M-x viper-mode} will correct the situation. Viper knows about
2277 usual prompt @kbd{/} and will wait for input, as usual in Vi. 2312 usual prompt @kbd{/} and will wait for input, as usual in Vi.
2278 If you don't like this behavior, you can ``unrecord'' these macros in your 2313 If you don't like this behavior, you can ``unrecord'' these macros in your
2279 @file{~/.viper} file. For instance, if you don't like the above feature, put 2314 @file{~/.viper} file. For instance, if you don't like the above feature, put
2280 this in @file{~/.viper}: 2315 this in @file{~/.viper}:
2281 @example 2316 @example
2282 (vip-set-vi-search-style-macros 'undefine) 2317 (vip-set-searchstyle-toggling-macros 'undefine)
2283 @end example 2318 @end example
2284 @findex @code{vip-set-vi-search-style-macros} 2319 @findex @code{vip-set-searchstyle-toggling-macros}
2285 2320
2286 @item Vi-isms in Emacs state 2321 @item Vi-isms in Emacs state
2287 Some people find it useful to use the Vi-style search key, `/', to invoke 2322 Some people find it useful to use the Vi-style search key, `/', to invoke
2288 search in modes which Viper leaves in emacs-state. These modes are: 2323 search in modes which Viper leaves in emacs-state. These modes are:
2289 @code{dired-mode}, @code{mh-folder-mode}, @code{gnus-group-mode}, 2324 @code{dired-mode}, @code{mh-folder-mode}, @code{gnus-group-mode},
2299 @code{vip-slash-and-colon-map}, for other modes. 2334 @code{vip-slash-and-colon-map}, for other modes.
2300 @vindex @code{vip-slash-and-colon-map} 2335 @vindex @code{vip-slash-and-colon-map}
2301 @vindex @code{vip-dired-modifier-map} 2336 @vindex @code{vip-dired-modifier-map}
2302 2337
2303 To unbind the macros `//' and `///' for a major mode where you feel they 2338 To unbind the macros `//' and `///' for a major mode where you feel they
2304 are undesirable, execute @code{vip-set-emacs-search-style-macros} with a 2339 are undesirable, execute @code{vip-set-emacs-state-searchstyle-macros} with a
2305 non-nil argument. This can be done either interactively, by supplying a 2340 non-nil argument. This can be done either interactively, by supplying a
2306 prefix argument, or by placing 2341 prefix argument, or by placing
2307 @example 2342 @example
2308 (vip-set-emacs-search-style-macros 'undefine) 2343 (vip-set-emacs-state-searchstyle-macros 'undefine)
2309 @end example 2344 @end example
2310 @findex @code{vip-set-emacs-search-style-macros} 2345 @findex @code{vip-set-emacs-state-searchstyle-macros}
2311 in the hook to the major mode (e.g., @code{dired-mode-hook}). 2346 in the hook to the major mode (e.g., @code{dired-mode-hook}).
2312 @xref{Vi Macros}, for more information on Vi macros. 2347 @xref{Vi Macros}, for more information on Vi macros.
2313 2348
2314 @item vip-heading-start 2349 @item vip-heading-start
2315 @item vip-heading-end 2350 @item vip-heading-end
2318 @cindex paragraphs 2353 @cindex paragraphs
2319 @cindex sentences 2354 @cindex sentences
2320 Regular Expressions for @kbd{[[} and @kbd{]]}. Note that Emacs defines 2355 Regular Expressions for @kbd{[[} and @kbd{]]}. Note that Emacs defines
2321 Regexps for paragraphs and sentences. @xref{Paragraphs,,Paragraphs and 2356 Regexps for paragraphs and sentences. @xref{Paragraphs,,Paragraphs and
2322 Sentences,emacs,The GNU Emacs Manual}, for details. 2357 Sentences,emacs,The GNU Emacs Manual}, for details.
2323 @item M-x vip-set-expert-level 2358 @item M-x viper-set-expert-level
2324 @findex @code{vip-set-expert-level} 2359 @findex @code{viper-set-expert-level}
2325 Change your user level interactively. 2360 Change your user level interactively.
2326 @item vip-smart-suffix-list '("" "tex" "c" "cc" "el" "p") 2361 @item vip-smart-suffix-list '("" "tex" "c" "cc" "el" "p")
2327 @vindex @code{vip-smart-suffix-list} 2362 @vindex @code{vip-smart-suffix-list}
2328 Viper supports Emacs-style file completion when it prompts the user for a 2363 Viper supports Emacs-style file completion when it prompts the user for a
2329 file name. However, in many cases, the same directory may contain files 2364 file name. However, in many cases, the same directory may contain files
2433 @end example 2468 @end example
2434 in the @file{~/.viper} file. However, in that case, the user will not have any 2469 in the @file{~/.viper} file. However, in that case, the user will not have any
2435 indication of the current Viper state in the minibuffer. (This is important 2470 indication of the current Viper state in the minibuffer. (This is important
2436 if the user accidentally switches to another Viper state by typing @key{ESC} or 2471 if the user accidentally switches to another Viper state by typing @key{ESC} or
2437 @kbd{C-z}). 2472 @kbd{C-z}).
2473 @item M-x viper-go-away
2474 @findex @code{viper-go-away}
2475 Make Viper disappear from the face of your running Emacs instance. If your
2476 fingers start aching again, @kbd{M-x viper-mode} might save your day.
2438 @end table 2477 @end table
2439 2478
2440 @cindex Multifile documents and programs 2479 @cindex Multifile documents and programs
2441 2480
2442 Viper provides some support for multi-file documents and programs. 2481 Viper provides some support for multi-file documents and programs.
2873 helps keep some potential troubles away. 2912 helps keep some potential troubles away.
2874 2913
2875 The rate at which the user must type keys in order for them to be 2914 The rate at which the user must type keys in order for them to be
2876 recognized as a timeout macro is controlled by the variable 2915 recognized as a timeout macro is controlled by the variable
2877 @code{vip-fast-keyseq-timeout}, which defaults to 200 milliseconds. 2916 @code{vip-fast-keyseq-timeout}, which defaults to 200 milliseconds.
2878 @vindex @code{vip-fast-keyseq-timeout}
2879 2917
2880 For the most part, Viper macros defined in @file{~/.viper} can be shared 2918 For the most part, Viper macros defined in @file{~/.viper} can be shared
2881 between Emacs, XEmacs, and X and TTY modes. However, macros defined via 2919 between Emacs, XEmacs, and X and TTY modes. However, macros defined via
2882 function keys may need separate definitions when XEmacs and Emacs have 2920 function keys may need separate definitions when XEmacs and Emacs have
2883 different names for the same keyboard key. For instance, the `Page Up' key 2921 different names for the same keyboard key. For instance, the `Page Up' key
3057 @code{strict-vi}, which means that alphanumeric symbols are exactly as 3095 @code{strict-vi}, which means that alphanumeric symbols are exactly as
3058 in Vi. 3096 in Vi.
3059 However, if the value is @code{reformed-vi} then alphanumeric 3097 However, if the value is @code{reformed-vi} then alphanumeric
3060 symbols will be those specified by the current Emacs syntax table (which 3098 symbols will be those specified by the current Emacs syntax table (which
3061 may be different for different major modes) plus the underscore symbol 3099 may be different for different major modes) plus the underscore symbol
3062 @code{_}. The user can also specify the value @code{emacs}, which would 3100 @kbd{_}. The user can also specify the value @code{emacs}, which would
3063 make Viper use exactly the Emacs notion of word. In particular, the 3101 make Viper use exactly the Emacs notion of word. In particular, the
3064 underscore may not be part of a word. Finally, if 3102 underscore may not be part of a word. Finally, if
3065 @code{vip-syntax-preference} is set to @code{extended}, Viper words would 3103 @code{vip-syntax-preference} is set to @code{extended}, Viper words would
3066 consist of characters that are classified as alphanumeric @emph{or} as 3104 consist of characters that are classified as alphanumeric @emph{or} as
3067 parts of symbols. This is convenient for writing programs and in many other 3105 parts of symbols. This is convenient for writing programs and in many other
3234 @item % 3272 @item %
3235 Find the next bracket/parenthesis/brace and go to its match. 3273 Find the next bracket/parenthesis/brace and go to its match.
3236 By default, Viper ignores brackets/parentheses/braces that occur inside 3274 By default, Viper ignores brackets/parentheses/braces that occur inside
3237 parentheses. You can change this by setting 3275 parentheses. You can change this by setting
3238 @code{vip-parse-sexp-ignore-comments} to nil in your @file{.viper} fipe. 3276 @code{vip-parse-sexp-ignore-comments} to nil in your @file{.viper} fipe.
3239 This option can also be toggled interactively if you quickly hit @kbd{%} 3277 This option can also be toggled interactively if you quickly hit @kbd{%%%}.
3240 three times. 3278
3279 This latter feature is implemented as a vi-style keyboard macro. If you
3280 don't want this macro, put
3281
3282 @example
3283 (vip-set-parsing-style-toggling-macro 'undefine)
3284 @end example
3285 @findex @code{vip-set-parsing-style-toggling-macro}
3286
3287 in your @file{~/.viper} file.
3288
3241 @end table 3289 @end table
3242 @kindex @kbd{%} 3290 @kindex @kbd{%}
3243 @kindex @kbd{C-c /} 3291 @kindex @kbd{C-c /}
3244 @kindex @kbd{N} 3292 @kindex @kbd{N}
3245 @kindex @kbd{n} 3293 @kindex @kbd{n}
3621 pattern) with <r>. Useful 3669 pattern) with <r>. Useful
3622 flags <f> are @samp{g} for @samp{global} (i.e. change every 3670 flags <f> are @samp{g} for @samp{global} (i.e. change every
3623 non-overlapping occurrence of <p>) and @samp{c} for 3671 non-overlapping occurrence of <p>) and @samp{c} for
3624 @samp{confirm} (type @samp{y} to confirm a particular 3672 @samp{confirm} (type @samp{y} to confirm a particular
3625 substitution, else @samp{n}). Instead of @kbd{/} any 3673 substitution, else @samp{n}). Instead of @kbd{/} any
3626 punctuation CHAR unequal to <space> <tab> and <lf> can be used as delimiter. 3674 punctuation character other than <space> <tab> and <lf> can be used as
3675 delimiter.
3627 @item & 3676 @item &
3628 Repeat latest Ex substitute command, e.g. @kbd{:s/wrong/good}. 3677 Repeat latest Ex substitute command, e.g. @kbd{:s/wrong/good}.
3678 @item :global /<pattern>/<ex-command>
3679 @itemx :g /<pattern>/<ex-command>
3680 Execute <ex-command> on all lines that match <pattern>.
3681 @item :vglobal /<pattern>/<ex-command>
3682 @itemx :v /<pattern>/<ex-command>
3683 Execute <ex-command> on all lines that do not match <pattern>.
3629 @end table 3684 @end table
3630 @kindex @kbd{&} 3685 @kindex @kbd{&}
3631 @findex @kbd{:substitute/<p>/<r>/<f>} 3686 @findex @kbd{:substitute/<p>/<r>/<f>}
3632 @kindex @kbd{Q} 3687 @kindex @kbd{Q}
3633 @kindex @kbd{#g<move>} 3688 @kindex @kbd{#g<move>}
3634 @findex @kbd{:v/<string>/<cmd>} 3689 @findex @kbd{:v}
3635 @findex @kbd{:g/<string>/<cmd>} 3690 @findex @kbd{:g}
3636 @findex @kbd{:global/<string>/<cmd>} 3691 @findex @kbd{:global}
3692 @findex @kbd{:vglobal}
3637 @findex @kbd{:tag <name>} 3693 @findex @kbd{:tag <name>}
3638 @kindex @kbd{%} 3694 @kindex @kbd{%}
3639 @kindex @kbd{N} 3695 @kindex @kbd{N}
3640 @kindex @kbd{n} 3696 @kindex @kbd{n}
3641 @kindex @kbd{g<move>} 3697 @kindex @kbd{g<move>}
3788 Quit buffer except if modified. 3844 Quit buffer except if modified.
3789 @item :q! 3845 @item :q!
3790 Quit buffer without checking. In Viper, these two commands 3846 Quit buffer without checking. In Viper, these two commands
3791 are identical. Confirmation is required if exiting modified buffers that 3847 are identical. Confirmation is required if exiting modified buffers that
3792 visit files. 3848 visit files.
3793 @item :susp 3849 @item :suspend
3794 @item :stop 3850 @item :stop
3795 Suspend Viper 3851 Suspend Viper
3796 @item :[x,y] w 3852 @item :[x,y] w
3797 Write the file. Viper nakes sure that a final newline is always added to 3853 Write the file. Viper nakes sure that a final newline is always added to
3798 any file where this newline is missing. This is done by setting Emacs 3854 any file where this newline is missing. This is done by setting Emacs
3799 variable @code{require-final-newline} to @code{t}. If you don't like this 3855 variable @code{require-final-newline} to @code{t}. If you don't like this
3800 feature, use @code{setq-default} to set @code{require-final-newline} to 3856 feature, use @code{setq-default} to set @code{require-final-newline} to
3801 @code{nil}. This must be done either in @file{.viper} file or in 3857 @code{nil}. This must be done in @file{.viper} file.
3802 @code{.emacs} after Viper is loaded.
3803 @item :[x,y] w <name> 3858 @item :[x,y] w <name>
3804 Write to the file <name>. 3859 Write to the file <name>.
3805 @item :[x,y] w>> <name> 3860 @item :[x,y] w>> <name>
3806 Append the buffer to the file <name>. There should be no space between 3861 Append the buffer to the file <name>. There should be no space between
3807 @kbd{w} and @kbd{>>}. Type space after the @kbd{>>} and see what happens. 3862 @kbd{w} and @kbd{>>}. Type space after the @kbd{>>} and see what happens.
3815 Write the file and kill buffer. 3870 Write the file and kill buffer.
3816 @item :r <file> [<file> ...] 3871 @item :r <file> [<file> ...]
3817 Read file into a buffer, inserting its contents after the current line. 3872 Read file into a buffer, inserting its contents after the current line.
3818 @item :xit 3873 @item :xit
3819 Same as @kbd{:wq}. 3874 Same as @kbd{:wq}.
3820 @item :W 3875 @item :Write
3821 Save unsaved buffers, asking for confirmation. 3876 @itemx :W
3822 @item :WW 3877 Save all unsaved buffers, asking for confirmation.
3878 @item :WWrite
3879 @itemx :WW
3823 Like @kbd{W}, but without asking for confirmation. 3880 Like @kbd{W}, but without asking for confirmation.
3824 @item ZZ 3881 @item ZZ
3825 Save current buffer and kill it. If user level is 1, then save all files 3882 Save current buffer and kill it. If user level is 1, then save all files
3826 and kill Emacs. Killing Emacs is the wrong way to use it, so you should 3883 and kill Emacs. Killing Emacs is the wrong way to use it, so you should
3827 switch to higher user levels as soon as possible. 3884 switch to higher user levels as soon as possible.
3905 @findex @kbd{:Write} 3962 @findex @kbd{:Write}
3906 @findex @kbd{:WWrite} 3963 @findex @kbd{:WWrite}
3907 @findex @kbd{:WWrite} 3964 @findex @kbd{:WWrite}
3908 @findex @kbd{:x} 3965 @findex @kbd{:x}
3909 @findex @kbd{:x!} 3966 @findex @kbd{:x!}
3910 @findex @kbd{:susp} 3967 @findex @kbd{:suspend}
3911 @findex @kbd{:stop} 3968 @findex @kbd{:stop}
3912 @findex @kbd{:n [<count> | <file>]} 3969 @findex @kbd{:n [<count> | <file>]}
3913 @findex @kbd{:cd [<dir>]} 3970 @findex @kbd{:cd [<dir>]}
3914 @findex @kbd{:pwd} 3971 @findex @kbd{:pwd}
3915 3972
4042 @section Options 4099 @section Options
4043 4100
4044 @cindex Vi options 4101 @cindex Vi options
4045 4102
4046 @table @kbd 4103 @table @kbd
4047 @item ai 4104 @item autoindent
4105 @itemx ai
4048 @cindex autoindent 4106 @cindex autoindent
4049 autoindent -- In append mode after a <cr> the 4107 autoindent -- In append mode after a <cr> the
4050 cursor will move directly below the first 4108 cursor will move directly below the first
4051 CHAR on the previous line. 4109 character on the previous line.
4052 @item ic 4110 This setting affects the current buffer only.
4111 @item autoindent-global
4112 @itemx ai-global
4113 Same as `autoindent', but affects all buffers.
4114 @item noautoindent
4115 @itemx noai
4116 Cancel autoindent.
4117 @item noautoindent-global
4118 @itemx noai-g
4119 Cancel autoindent-global.
4120 @item ignorecase
4121 @itemx ic
4053 @cindex case and searching 4122 @cindex case and searching
4054 ignorecase -- No distinction between upper and lower cases when searching. 4123 ignorecase -- No distinction between upper and lower cases when searching.
4124 @item noignorecase
4125 @itemx noic
4126 Cancel ignorecase.
4055 @item magic 4127 @item magic
4128 @itemx ma
4056 @cindex literal searching 4129 @cindex literal searching
4057 Regular expressions used in searches; nomagic means no regexps. 4130 Regular expressions used in searches; nomagic means no regexps.
4058 @item ro 4131 @item nomagic
4132 @item noma
4133 Cancel magic.
4134 @item readonly
4135 @itemx ro
4059 @cindex readonly files 4136 @cindex readonly files
4060 readonly -- The file is not to be changed. 4137 readonly -- The file is not to be changed.
4061 If the user attempts to write to this file, confirmation will be requested. 4138 If the user attempts to write to this file, confirmation will be requested.
4062 @item sh=<string> 4139 @item noreadonly
4140 @itemx noro
4141 Cancel readonly.
4142 @item shell=<string>
4143 @itemx sh=<string>
4063 @cindex shell 4144 @cindex shell
4064 shell -- The program to be used for shell escapes 4145 shell -- The program to be used for shell escapes
4065 (default @samp{$SHELL} (default @file{/bin/sh})). 4146 (default @samp{$SHELL} (default @file{/bin/sh})).
4066 @item sw=<count> 4147 @item shiftwidth=<count>
4148 @itemx sw=<count>
4067 @cindex layout 4149 @cindex layout
4068 @cindex shifting text 4150 @cindex shifting text
4069 shiftwidth -- Gives the shiftwidth (default 8 positions). 4151 shiftwidth -- Gives the shiftwidth (default 8 positions).
4070 @item sm 4152 @item showmatch
4153 @itemx sm
4071 @cindex paren matching 4154 @cindex paren matching
4072 @cindex matching parens 4155 @cindex matching parens
4073 showmatch -- Whenever you append a @kbd{)}, Vi shows 4156 showmatch -- Whenever you append a @kbd{)}, Vi shows
4074 its match if it's on the same page; also with 4157 its match if it's on the same page; also with
4075 @kbd{@{} and @kbd{@}}. If there's no match, Vi will beep. 4158 @kbd{@{} and @kbd{@}}. If there's no match, Vi will beep.
4076 @item ts=<count> 4159 @item noshowmatch
4160 @itemx nosm
4161 Cancel showmatch.
4162 @item tabstop=<count>
4163 @itemx ts=<count>
4077 @cindex changing tab width 4164 @cindex changing tab width
4078 @cindex tabbing 4165 @cindex tabbing
4079 tabstop -- The length of a <ht>; warning: this is 4166 tabstop -- The length of a <ht>; warning: this is
4080 only IN the editor, outside of it <ht>s have 4167 only IN the editor, outside of it <ht>s have
4081 their normal length (default 8 positions). 4168 their normal length (default 8 positions).
4082 @item wm=<count> 4169 This setting affects the current buffer only.
4170 @item tabstop-global
4171 @itemx ts-g
4172 Same as `tabstop', but affects all buffers.
4173 @item wrapmargin=<count>
4174 @itemx wm=<count>
4083 @cindex auto fill 4175 @cindex auto fill
4084 @cindex word wrap 4176 @cindex word wrap
4085 wrapmargin -- In append mode Vi automatically 4177 wrapmargin -- In append mode Vi automatically
4086 puts a <lf> whenever there is a <sp> or <ht> 4178 puts a <lf> whenever there is a <sp> or <ht>
4087 within <wm> columns from the right margin. 4179 within <wm> columns from the right margin.
4088 @item ws 4180 @item wrapscan
4181 @itemx ws
4089 @cindex searching 4182 @cindex searching
4090 wrapscan -- When searching, the end is 4183 wrapscan -- When searching, the end is
4091 considered @samp{stuck} to the begin of the file. 4184 considered @samp{stuck} to the begin of the file.
4185 @item nowrapscan
4186 @itemx nows
4187 Cancel wrapscan.
4092 @item :set <option> 4188 @item :set <option>
4093 Turn <option> on. 4189 Turn <option> on.
4094 @item :set no<option> 4190 @item :set no<option>
4095 Turn <option> off. 4191 Turn <option> off.
4096 @item :set <option>=<value> 4192 @item :set <option>=<value>
4122 4218
4123 @node Emacs Related Commands,,Options,Commands 4219 @node Emacs Related Commands,,Options,Commands
4124 @section Emacs Related Commands 4220 @section Emacs Related Commands
4125 4221
4126 @table @kbd 4222 @table @kbd
4127 @item _ 4223 @item C-\
4128 Begin Meta command in Vi state. Most often used as _x (M-x). 4224 Begin Meta command in Vi or Insert states. Most often used as C-\ x (M-x).
4129 @item C-z 4225 @item C-z
4130 Begin Meta command in Insert state. 4226 In Insert and Replace states, prepare Viper to accept the next command and
4131 @item C-z 4227 execute it as if Viper was in Vi state. Then return to Insert state.
4132 Switch between Emacs and Vi states. 4228
4229 In Vi state, switch to Emacs state; in Emacs state, switch to Vi state.
4230 @item C-c \
4231 Switches to Vi state for the duration of a single command. Then goes back
4232 to the original Viper state. Works from Vi, Insert, Replace, and Emacs states.
4133 @item C-x0 4233 @item C-x0
4134 Close Window 4234 Close Window
4135 @item C-x1 4235 @item C-x1
4136 Close Other Windows 4236 Close Other Windows
4137 @item C-x2 4237 @item C-x2
4155 @kindex @kbd{C-xo} 4255 @kindex @kbd{C-xo}
4156 @kindex @kbd{C-x2} 4256 @kindex @kbd{C-x2}
4157 @kindex @kbd{C-x1} 4257 @kindex @kbd{C-x1}
4158 @kindex @kbd{C-x0} 4258 @kindex @kbd{C-x0}
4159 @kindex @kbd{C-z} 4259 @kindex @kbd{C-z}
4160 @kindex @kbd{C-z} 4260 @kindex @kbd{C-\}
4161 @kindex @kbd{_} 4261 @kindex @kbd{C-c\}
4162 4262
4163 @node Mouse-bound Commands,,,Commands 4263 @node Mouse-bound Commands,,,Commands
4164 @section Mouse-bound Commands 4264 @section Mouse-bound Commands
4165 4265
4166 The following two mouse actions are normally bound to to special search and 4266 The following two mouse actions are normally bound to to special search and
4232 jobrien@@hchp.org (John O'Brien), 4332 jobrien@@hchp.org (John O'Brien),
4233 mrb@@Eng.Sun.COM (Martin Buchholz), 4333 mrb@@Eng.Sun.COM (Martin Buchholz),
4234 kwzh@@gnu.ai.mit.edu (Karl Heuer), 4334 kwzh@@gnu.ai.mit.edu (Karl Heuer),
4235 sudish@@MindSpring.COM (Sudish Joseph), 4335 sudish@@MindSpring.COM (Sudish Joseph),
4236 paulk@@summit.esg.apertus.com (Paul Keusemann), 4336 paulk@@summit.esg.apertus.com (Paul Keusemann),
4237 roderick@@argon.org (Roderick Schertler) 4337 roderick@@argon.org (Roderick Schertler),
4338 johnw@@borland.com (John Wiegley)
4238 @end example 4339 @end example
4239 4340
4240 4341
4241 @node Key Index,Function Index,,Top 4342 @node Key Index,Function Index,,Top
4242 @comment node-name, next, previous, up 4343 @comment node-name, next, previous, up