home *** CD-ROM | disk | FTP | other *** search
/ Dream 49 / Amiga_Dream_49.iso / beos / emacs / emacs-19.34-bin / emacs-19 / info / viper-1 < prev    next >
Encoding:
GNU Info File  |  1997-09-17  |  47.8 KB  |  1,052 lines

  1. This is Info file ../info/viper, produced by Makeinfo-1.63 from the
  2. input file viper.texi.
  3.  
  4. Distribution
  5. ************
  6.  
  7. Copyright (C) 1995, 1996 Free Software Foundation, Inc.
  8.  
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.  
  13.    Permission is granted to copy and distribute modified versions of
  14. this manual under the conditions for verbatim copying, provided that
  15. the entire resulting derived work is distributed under the terms of a
  16. permission notice identical to this one.
  17.  
  18.    Permission is granted to copy and distribute translations of this
  19. manual into another language, under the same conditions as for modified
  20. versions.
  21.  
  22. 
  23. File: viper,  Node: Top,  Next: Overview,  Up: (DIR)
  24.  
  25. Viper
  26. *****
  27.  
  28.    We believe that one or more of the following statements are adequate
  29. descriptions:
  30.  
  31.      Viper Is a Package for Emacs Rebels;
  32.      it is a VI Plan for Emacs Rescue
  33.      and/or a venomous VI PERil.
  34.  
  35.    Technically speaking, Viper is a Vi emulation package for Emacs 19
  36. and XEmacs 19. Because of its reliance on minor mode keymaps, Viper
  37. will not work under Emacs 18. Viper implements most Vi and Ex commands.
  38. It gives you the best of both worlds: Vi keystrokes for editing
  39. combined with the GNU Emacs environment. Viper also fixes some common
  40. complaints with Vi commands.  This manual describes Viper,
  41. concentrating on the differences from Vi and new features of Viper.
  42.  
  43.    Viper, formerly known as VIP-19, was written by Michael Kifer.  It
  44. is based on VIP version 3.5 by Masahiko Sato and VIP version 4.4 by
  45. Aamod Sane.  Viper tries to be compatible with these packages.
  46.  
  47.    Viper is intended to be usable without reading this manual -- the
  48. defaults are set to make Viper as close to Vi as possible.  At startup,
  49. Viper will try to set the most appropriate default environment for you,
  50. based on your familiarity with Emacs. It will also tell you the basic
  51. GNU Emacs window management commands to help you start immediately.
  52.  
  53.    Although this manual explains how to customize Viper, some basic
  54. familiarity with Emacs Lisp would be a plus.
  55.  
  56.    It is recommended that you read the Overview node. The other nodes
  57. may be visited as needed.
  58.  
  59.    Comments and bug reports are welcome.  `kifer@cs.emacs.edu' is the
  60. current address for Viper bug reports.  Please use the Ex command
  61. `:submitReport' for this purpose.
  62.  
  63. * Menu:
  64.  
  65. * Overview::                    Must read to get started
  66. * Improvements over Vi::        New features, Improvements
  67. * Customization::               How to customize Viper
  68. * Commands::                    Vi and Ex Commands
  69.  
  70. * Key Index::                   Index of Vi and Ex Commands
  71. * Function Index::              Index of Viper Functions
  72. * Variable Index::              Index of Viper Variables
  73. * Package Index::               Index of Packages Mentioned in this Document
  74. * Concept Index::               Vi, Ex and Emacs concepts
  75.  
  76. * Acknowledgments::
  77.  
  78. 
  79. File: viper,  Node: Overview,  Next: Improvements over Vi,  Prev: Top,  Up: Top
  80.  
  81. Overview of Viper
  82. *****************
  83.  
  84.    Viper is a Vi emulation on top of Emacs. At the same time, Viper
  85. provides a virtually unrestricted access to Emacs facilities. Perfect
  86. compatibility with Vi is possible but not desirable. This chapter tells
  87. you about the Emacs ideas that you should know about, how to use Viper
  88. within Emacs and some incompatibilities.
  89.  
  90.    Viper was formerly known as VIP-19, which was a descendant of VIP
  91. 3.5 by Masahiko Sato and VIP 4.4 by Aamod Sane.
  92.  
  93. * Menu:
  94.  
  95. * Emacs Preliminaries::         Basic concepts in Emacs.
  96. * Loading Viper::                       Loading and Preliminary Configuration.
  97. * States in Viper::             Viper has four states orthogonal to
  98.                                 modes in Emacs.
  99. * The Minibuffer::              Command line in Emacs.
  100. * Multiple Files in Viper::     True multiple file handling.
  101. * Unimplemented Features::      That are unlikely to be implemented.
  102.  
  103. 
  104. File: viper,  Node: Emacs Preliminaries,  Next: Loading Viper,  Prev: Overview,  Up: Overview
  105.  
  106. Emacs Preliminaries
  107. ===================
  108.  
  109.    Emacs can edit several files at once. A file in Emacs is placed in a
  110. "buffer" that usually has the same name as the file. Buffers are also
  111. used for other purposes, such as shell interfaces, directory editing,
  112. etc.  *Note Directory Editor: (emacs)Dired, for an example.
  113.  
  114.    A buffer has a distinguished position called the "point".  A "point"
  115. is always between 2 characters, and is "looking at" the right hand
  116. character. The cursor is positioned on the right hand character. Thus,
  117. when the "point" is looking at the end-of-line, the cursor is on the
  118. end-of-line character, i.e. beyond the last character on the line. This
  119. is the default Emacs behavior.
  120.  
  121.    The default settings of Viper try to mimic the behavior of Vi,
  122. preventing the cursor from going beyond the last character on the line.
  123. By using Emacs commands directly (such as those bound to arrow keys),
  124. it is possible to get the cursor beyond the end-of-line. However, this
  125. won't (or shouldn't) happen if you restrict yourself to standard Vi
  126. keys, unless you modify the default editing style. *Note
  127. Customization::.
  128.  
  129.    In addition to the "point", there is another distinguished buffer
  130. position called the "mark". *Note Mark: (emacs)Mark, for more info on
  131. the mark. The text between the "point" and the "mark" is called the
  132. "region" of the buffer. For the Viper user, this simply means that in
  133. addition to the Vi textmarkers a-z, there is another marker called
  134. "mark". This is similar to the unnamed Vi marker used by the jump
  135. commands (" and "), which move the cursor to the position of the last
  136. absolute jump.  Viper provides access to the region in most text
  137. manipulation commands as `r' and `R' suffix to commands that operate on
  138. text regions, e.g., `dr' to delete region, etc.  *Note Basics::, for
  139. more info.
  140.  
  141.    Emacs divides the screen into tiled "windows". You can see the
  142. contents of a buffer through the window associated with the buffer.  The
  143. cursor of the screen is positioned on the character after "point".
  144. Every window has a "mode line" that displays information about the
  145. buffer.  You can change the format of the mode line, but normally if
  146. you see `**' at the beginning of a mode line it means that the buffer
  147. is "modified".  If you write out the contents of a buffer to a file,
  148. then the buffer will become not modified.  Also if you see `%%' at the
  149. beginning of the mode line, it means that the file associated with the
  150. buffer is write protected. The mode line will also show the buffer name
  151. and current major and minor modes (see below).  A special buffer called
  152. "Minibuffer" is displayed as the last line in a Minibuffer window. The
  153. Minibuffer window is used for command input output. Viper uses
  154. Minibuffer window for `/' and `:' commands.
  155.  
  156.    An Emacs buffer can have a "major mode" that customizes Emacs for
  157. editing text of a particular sort by changing the functionality of the
  158. keys.  Keys are defined using a "keymap" that records the bindings
  159. between keystrokes and functions. The "global keymap" is common to all
  160. the buffers.  Additionally, each buffer has its "local keymap" that
  161. determines the "mode" of the buffer.  If a function is bound to some
  162. key in the local keymap then that function will be executed when you
  163. type the key.  If no function is bound to a key in the local map,
  164. however, the function bound to the key in the global map will be
  165. executed. *Note Major Modes: (emacs)Major Modes, for more information.
  166.  
  167.    A buffer can also have a "minor mode". Minor modes are options that
  168. you can use or not. A buffer in `text-mode' can have `auto-fill-mode'
  169. as minor mode, which can be turned off or on at any time. In Emacs 19, a
  170. minor mode may have it own keymap, which overrides the local keymap when
  171. the minor mode is turned on.  For more information, *note Minor Modes:
  172. (emacs)Minor Modes.
  173.  
  174.    Viper is implemented as a collection of minor modes. Different minor
  175. modes are involved when Viper emulates Vi command mode, Vi insert mode,
  176. etc.  You can also turn Viper on and off at any time while in Vi
  177. command mode.  *Note States in Viper::, for more information.
  178.  
  179.    Emacs uses Control and Meta modifiers. These are denoted as C and M,
  180. e.g. `^Z' as `C-z' and `Meta-x' as `M-x'.  The Meta key is usually
  181. located on each side of the Space bar; it is used in a manner similar
  182. to the Control key, e.g., `M-x' means typing `x' while holding the Meta
  183. key down.  For keyboards that do not have a Meta key, ESC is used as
  184. Meta.  Thus `M-x' is typed as `ESC x'. Viper uses ESC to switch from
  185. Insert state to Vi state. Therefore Viper defines `_' as its Meta key
  186. in Vi state. *Note Vi State::, for more info.
  187.  
  188.    Emacs is structured as a lisp interpreter around a C core. Emacs keys
  189. cause lisp functions to be called. It is possible to call these
  190. functions directly, by typing `M-x function-name'.
  191.  
  192. 
  193. File: viper,  Node: Loading Viper,  Next: States in Viper,  Prev: Emacs Preliminaries,  Up: Overview
  194.  
  195. Loading Viper
  196. =============
  197.  
  198.    First, make sure that all six Viper files `viper*.el' are somewhere
  199. on Emacs "load path". The load path is a list of directories where Emacs
  200. looks for its Lisp code; it is similar to Unix environment variable
  201. PATH.  The load path is determined by the Lisp variable `load-path'.
  202.  
  203.    Type `C-h v load-path RET' to check the current load path of your
  204. Emacs. (Here and later, `RET' stands for carriage return.) If the files
  205. `viper*.el' are not in any directory on the load path, you should
  206. create your own directory and put it on the load path; then put
  207. `viper*.el' in that directory.  To put a new directory, say
  208. `~/emacslib', on your load path, add the following line at the
  209. beginning of your `~/.emacs' file:
  210.      (setq load-path (cons "~/emacslib" load-path))
  211.    It is recommended that you compile `viper.el' by running
  212.      make all
  213.    in the directory where Viper was unpacked. The best way to ensure
  214. that Viper is installed properly is to run
  215.      make install
  216.    in the directory where Viper was unpacked. See README in the Viper
  217. distribution for the details on which modifications to the make file
  218. may be necessary.
  219.  
  220.    Once Viper is settled on the load path, the most common way to load
  221. it automatically is to include the line:
  222.  
  223.      (require 'viper)
  224.  
  225. in your `~/.emacs' file.  The `.emacs' file is placed in your home
  226. directory and it will be executed every time you invoke Emacs.  Viper
  227. also uses the file `~/.vip' for Viper-specific customization.  If you
  228. wish to be in Vi command state whenever this is appropriate, you can
  229. include the following line in your `.vip':
  230.      (setq vip-always t)
  231.  
  232. (*Note Vi State::, for the explanation of Vi mode.)
  233.  
  234.    Once invoked, Viper will arrange to bring up Emacs buffers in Vi
  235. state whenever this makes sense.  *Note Packages that Change Keymaps::,
  236. to find out when forcing Vi command state on a buffer may be
  237. counter-productive.
  238.  
  239.    Even if your `.emacs' and `.vip' files do not contain any of the
  240. above lines, you can still load Viper and enter Vi state by typing the
  241. following from within Emacs:
  242.  
  243.      M-x load-library RET viper RET
  244.      M-x viper-mode
  245.  
  246. Ask your local Emacs administrator if this fails to work.
  247.  
  248.    When Emacs first comes up, if you have not specified a file on the
  249. command line, it will show the `*scratch*' buffer, in the `Lisp
  250. Interaction' mode. After you invoke Viper, you can start editing files
  251. by using `:e', `:vi', or `v' commands.  (*Note File and Buffer
  252. Handling::, for more information on `v' and other new commands that, in
  253. many cases, are more convenient than `:e', `:vi', and similar old-style
  254. Vi commands.)
  255.  
  256. 
  257. File: viper,  Node: States in Viper,  Next: The Minibuffer,  Prev: Loading Viper,  Up: Overview
  258.  
  259. States in Viper
  260. ===============
  261.  
  262.    Viper has four states, Emacs, Vi, Insert, and Replace.
  263.  
  264. `Emacs state'
  265.      This is the mode plain vanilla Emacs is normally in. After you
  266.      have loaded Viper, `C-z' will normally take you to Vi command
  267.      state. Another `C-z' will take you back to Emacs state.  This
  268.      toggle key can be changed, *note Customization::. You can also
  269.      type `M-x viper-mode' to change to Vi state.
  270.  
  271.      For users who chose to set their user level to 1 at Viper setup
  272.      time, switching to Emacs state is deliberately made harder in
  273.      order to not confuse the novice user. In this case, `C-z' will
  274.      either iconify Emacs (if Emacs runs as an application under X
  275.      Windows) or it will stop Emacs (if Emacs runs on a dumb terminal
  276.      or in an Xterm window).
  277.  
  278. `Vi state'
  279.      This is the Vi command mode. Any of the Vi commands, such as `i,
  280.      o, a', ..., will take you to Insert state. All Vi commands may be
  281.      used in this mode. Most Ex commands can also be used.  For a full
  282.      list of Ex commands supported by Viper, type `:' and then `TAB'.
  283.      To get help on any issue, including the Ex commands, type `:help'.
  284.      This will invoke Viper Info (if it is installed). Then typing `i'
  285.      will prompt you for a topic to search in the index. Note, to
  286.      search for Ex commands in the index, you should start them with a
  287.      "`:'", e.g., `:WW'.
  288.  
  289. `Insert state'
  290.      Insert state is the Vi insertion mode. `ESC' will take you back to
  291.      Vi state. Insert state editing can be done, including
  292.      auto-indentation. By default, Viper disables Emacs keybindings in
  293.      Insert state.
  294.  
  295. `Replace state'
  296.      Commands like `cw' invoke the Replace state. When you cross the
  297.      boundary of a replacement region (usually designated via a `$'
  298.      sign), it will automatically change to Insert state. You do not
  299.      have to worry about it. The key bindings remain practically the
  300.      same as in Insert state. If you type ESC, Viper will switch to Vi
  301.      command mode, terminating the replacement state.
  302.  
  303.    The modes are indicated on the "mode line" as <E>, <I>, <V>, and <R>,
  304. so that the multiple modes do not confuse you. Most of your editing can
  305. be done in Vi and Insert states. Viper will try to make all new buffers
  306. be in Vi state, but sometimes they may come up in Emacs state.  `C-z'
  307. will take you to Vi state in such a case.  In some major modes, like
  308. Dired, Info, Gnus, etc., you should not switch to Vi state (and Viper
  309. will not attempt to do so) because these modes are not intended for
  310. text editing and many of the Vi keys have special meaning there. If you
  311. plan to read news, browse directories, read mail, etc., from Emacs
  312. (which you should start doing soon!), you should learn about the
  313. meaning of the various keys in those special modes (typing `C-h m' in a
  314. buffer provides help with key bindings for the major mode of that
  315. buffer).
  316.  
  317.    If you switch to Vi in Dired or similar modes--no harm is done. It
  318. is just that the special keybindings provided by those modes will be
  319. temporarily overshadowed by Viper's bindings. Switching back to Viper's
  320. Emacs state will revive the environment provided by the current major
  321. mode.
  322.  
  323.    States in Viper are orthogonal to Emacs major modes, such as C mode
  324. or Dired mode. You can turn Viper on and off for any Emacs state. When
  325. Viper is turned on, Vi state can be used to move around. In Insert
  326. state, the bindings for these modes can be accessed.  For beginners
  327. (users at Viper levels 1 and 2), these bindings are suppressed in
  328. Insert state, so that new users are not confused by the Emacs states.
  329. Note that unless you allow Emacs bindings in Insert state, you cannot
  330. do many interesting things, like language sensitive editing. For the
  331. novice user (at Viper level 1), all major mode bindings are turned off
  332. in Vi state as well. This includes the bindings for key sequences that
  333. start with `C-c', which practically means that all major mode bindings
  334. are supported.  *Note Customization::, to find out how to allow Emacs
  335. keys in Insert state.
  336.  
  337. * Menu:
  338.  
  339. * Emacs State::         This is the state you should learn more about when
  340.                         you get up to speed with Viper.
  341. * Vi State::            Vi commands are executed in this state.
  342. * Insert State::        You can enter text, and also can do sophisticated
  343.                         editing if you know enough Emacs commands.
  344. * Replace State::       Like Insert mode, but it is invoked via the
  345.                         replacement commands, such as cw, C, R, etc.
  346.  
  347. 
  348. File: viper,  Node: Emacs State,  Next: Vi State,  Prev: States in Viper,  Up: States in Viper
  349.  
  350. Emacs State
  351. -----------
  352.  
  353.    You will be in this mode only by accident (hopefully). This is the
  354. state Emacs is normally in (imagine!!). Now leave it as soon as
  355. possible by typing `C-z'. The you will be in Vi state (sigh of relief)
  356. :-).
  357.  
  358.    Emacs state is actually a Viperism to denote all the major and minor
  359. modes (*Note Emacs Preliminaries::)  other than Viper that Emacs can be
  360. in. Emacs can have several modes, such as C mode for editing C
  361. programs, LaTeX mode for editing LaTeX documents, Dired for directory
  362. editing, etc. These are major modes, each with a different set of
  363. key-bindings. Viper states are orthogonal to these Emacs major modes.
  364. The presence of these language sensitive and other modes is a major win
  365. over Vi.  *Note Improvements over Vi::, for more.
  366.  
  367.    The bindings for these modes can be made available in the Viper
  368. Insert state as well as in Emacs state.  Unless you specify your user
  369. level as 1 (a novice), all major mode key sequences that start with
  370. `C-x' and `C-c' are also available in Vi state.  This is important
  371. because major modes designed for editing files, such as cc-mode or
  372. latex-mode, use key sequences that begin with `C-x' and `C-c'.
  373.  
  374.    There is also a key that lets you temporarily escape to Vi command
  375. state from Emacs state: typing `M-C-z' (or `ESC C-z') will let you
  376. execute a single Vi command while staying in Viper's Emacs state.  At
  377. present, this works only for 1-character Vi commands (and for some
  378. complex commands).
  379.  
  380. 
  381. File: viper,  Node: Vi State,  Next: Insert State,  Prev: Emacs State,  Up: States in Viper
  382.  
  383. Vi State
  384. --------
  385.  
  386.    This is the Vi command mode. When Viper is in Vi state, you will see
  387. the sign <V> in the mode line. Most keys will work as in Vi. The notable
  388. exceptions are:
  389.  
  390. `C-x'
  391.      `C-x' is used to invoke Emacs commands, mainly those that do window
  392.      management. `C-x 2' will split a window, `C-x 0' will close a
  393.      window. `C-x 1' will close all other windows. `C-xb' is used to
  394.      switch buffers in a window, and `C-xo' to move through windows.
  395.      These are about the only necessary keystrokes.  For the rest, see
  396.      the GNU Emacs Manual.
  397.  
  398. `C-c'
  399.      For user levels 2 and higher, this key serves as a prefix key for
  400.      the key sequences used by various major modes. For users at Viper
  401.      level 1, `C-c' simply beeps.
  402.  
  403. `C-g and C-]'
  404.      These are the Emacs `quit' keys.  There will be cases where you
  405.      will have to use `C-g' to quit. Similarly, `C-]' is used to exit
  406.      `Recursive Edits' in Emacs for which there is no comparable Vi
  407.      functionality and no key-binding. Recursive edits are indicated by
  408.      `[]' brackets framing the modes on the mode line.  *Note Recursive
  409.      Edit: (emacs)Recursive Edit.  At user level 1, `C-g' is bound to
  410.      `vip-info-on-file' function instead.
  411.  
  412. `Underscore'
  413.      Viper uses `ESC' as a switch between Insert and Vi states. Emacs
  414.      uses `ESC' for Meta. We need a Meta key to call the Meta key
  415.      functions such as `M-x function name'. The underscore key, `_',
  416.      was chosen, since it is the only reasonable, free Vi key left.
  417.      Thus, in Vi state, to get `M-x', you should type `_x' (if the
  418.      keyboard has no Meta key).  It is possible to use `ESC' as Meta,
  419.      but then you cannot press `ESC' multiple times in Vi state. *Note
  420.      Customization::, to find out how to rebind ESC to be Meta.
  421.  
  422. Other differences are mostly improvements. The ones you should know
  423. about are:
  424.  
  425. `Undo'
  426.      `u' will undo. Undo can be repeated by the `.' key. Undo itself
  427.      can be undone. Another `u' will change the direction. The presence
  428.      of repeatable undo means that `U', undoing lines, is not very
  429.      important. Therefore, `U' also calls `vip-undo'.
  430.  
  431. `Counts'
  432.      Most commands, `~', `[[', `p', `/', ..., etc., take counts.
  433.  
  434. `Regexps'
  435.      Viper uses Emacs Regular Expressions for searches. These are a
  436.      superset of Vi regular expressions, excepting the change-of-case
  437.      escapes `\u', `\L', ..., etc. *Note Regular Expressions:
  438.      (emacs)Regular Expressions, for details.  Files specified to `:e'
  439.      use `csh' regular expressions (globbing, wildcards, what have you).
  440.      However, the function `vip-toggle-search-style', bound to `C-c /',
  441.      lets the user switch from search with regular expressions to plain
  442.      vanilla search and vice versa. It also lets one switch from
  443.      case-sensitive search to case-insensitive and back.  *Note Viper
  444.      Specials::, for more details.
  445.  
  446. `Ex commands'
  447.      The current working directory of a buffer is automatically
  448.      inserted in the minibuffer if you type `:e' then space.  Absolute
  449.      filenames are required less often in Viper.  For path names, Emacs
  450.      uses a convention that is slightly different from that of Unix.
  451.      It is designed to minimize the need for deleting path names that
  452.      Emacs provides in its prompts. (This is usually convenient, but
  453.      occasionally the prompt may suggest a wrong path name for you.) If
  454.      you see a prompt `/usr/foo/' and you wish to edit the file
  455.      `~/.vip', you don't have to erase the prompt. Instead, simply
  456.      continue typing what you need. Emacs will interpret
  457.      `/usr/foo/~/.vip' correctly. Similarly, if the prompt is `~/foo/'
  458.      and you need to get to `/bar/file', keep typing. Emacs interprets
  459.      `~/foo//bar/' as `/bar/file', since when it sees `//', it
  460.      understands that `~/foo/' is to be discarded.
  461.  
  462.      The command `:cd' will change the default directory for the
  463.      current buffer. The command `:e' will interpret the filename
  464.      argument in `csh'. *Note Customization::, if you want to change
  465.      the default shell.  The command `:next' takes counts from `:args',
  466.      so that `:rew' is obsolete. Also, `:args' will show only the
  467.      invisible files (i.e., those that are not currently seen in Emacs
  468.      windows).
  469.  
  470.      When applicable, Ex commands support file completion and history.
  471.      This means that by typing a partial file name and then `TAB',
  472.      Emacs will try to complete the name or it will offer a menu of
  473.      possible completions.  This works similarly to Tcsh and extends
  474.      the behavior of Csh. While Emacs is waiting for a file name, you
  475.      can type `M-p' to get the previous file name you typed. Repeatedly
  476.      typing `M-p' and `M-n' will let you browse through the file
  477.      history.
  478.  
  479.      Like file names, partially typed Ex commands can be completed by
  480.      typing `TAB', and Viper keeps the history of Ex commands. After
  481.      typing `:', you can browse through the previously entered Ex
  482.      commands by typing `M-p' and `M-n'.  Viper tries to rationalize
  483.      when it puts Ex commands on the history list.  For instance, if
  484.      you typed `:w! foo', only `:w!'  will be placed on the history
  485.      list. This is because the last history element is the default that
  486.      can be invoked simply by typing `: RET'. If `:w! foo' were placed
  487.      on the list, it would be all to easy to override valuable data in
  488.      another file. Reconstructing the full command, `:w!  foo', from
  489.      the history is still not that hard, since Viper has a separate
  490.      history for file names. By typing `: M-p', you will get `:w!' in
  491.      the Minibuffer. Then, repeated `M-p' will get you through the file
  492.      history, inserting one file name after another.
  493.  
  494.      In contrast to `:w! foo', if the command were `:r foo', the entire
  495.      command will appear in the history list. This is because having
  496.      `:r' alone as a default is meaningless, since this command
  497.      requires a file argument.
  498.  
  499. As Vi, Viper's destructive commands can be re-executed by typing ``.''.
  500. However, in addition, Viper keeps track of the history of such
  501. commands. This history can be perused by typing `C-c M-p' and `C-c M-n'.
  502. Having found the appropriate command, it can be then executed by typing
  503. ``.''.  *Note Improvements over Vi::, for more information.
  504.  
  505. 
  506. File: viper,  Node: Insert State,  Next: Replace State,  Prev: Vi State,  Up: States in Viper
  507.  
  508. Insert State
  509. ------------
  510.  
  511.    To avoid confusing the beginner (at Viper level 1 and 2), Viper
  512. makes only the standard Vi keys available in Insert state. The
  513. implication is that Emacs major modes cannot be used Insert state.  It
  514. is strongly recommended that as soon as you are comfortable, make the
  515. Emacs state bindings visible (by changing your user level to 3 or
  516. higher).  *Note Customization::, to see how to do this.
  517.  
  518.    Once this is done, it is possible to do quite a bit of editing in
  519. Insert state. For instance, Emacs has a "yank" command, `C-y', which is
  520. similar to Vi's `p'. However, unlike `p', `C-y' can be used in Insert
  521. state of Viper. Emacs also has a kill ring where it keeps pieces of
  522. text you deleted while editing buffers. The command `M-y' is used to
  523. delete the text previously put back by Emacs' `C-y' or by Vi's `p'
  524. command and reinsert text that was placed on the kill-ring earlier.
  525.  
  526.    This works both in Vi and Insert states.  In Vi state, `M-y' is a
  527. much better alternative to the usual Vi's way of recovering the 10
  528. previously deleted chunks of text. In Insert state, you can use this as
  529. follows. Suppose you deleted a piece of text and now you need to
  530. re-insert it while editing in Insert mode. The key `C-y' will put back
  531. the most recently deleted chunk. If this is not what you want, type
  532. `M-y' repeatedly and, hopefully, you will find the chunk you want.
  533.  
  534.    Finally, in Insert and Replace states, Viper provides the history of
  535. pieces of text inserted in previous insert or replace commands.  These
  536. strings of text can be recovered by repeatedly typing `C-c M-p' or `C-c
  537. M-n' while in Insert or Replace state. (This feature is disabled in the
  538. minibuffer: the above keys are usually bound to other histories, which
  539. are more appropriate in the minibuffer.)
  540.  
  541.    You can call Meta functions from Insert state. The Vi-to-Emacs
  542. toggle key, normally `C-z', is bound to Meta in Insert state. Thus
  543. `M-x' is typed as `C-zx'. The key `_' will now insert itself--it is not
  544. a Meta key in Insert state. (It is well understood that switching Meta
  545. keys around is inconvenient. However, there seems to be no way around
  546. this problem, short of changing Vi ESC key to something else. *Note
  547. Customization::, for the information on `vip-ESC-key', which can be
  548. used to free up `ESC' and designate some other key to do escape from
  549. Insert state to Vi state.)
  550.  
  551.    Other Emacs commands that are useful in Insert state are `C-e' and
  552. `C-a', which move the cursor to the end and the beginning of the
  553. current line, respectively. You can also use `M-f' and `M-b', which
  554. move the cursor forward (or backward) one word.  If your display has a
  555. Meta key, these functions are invoked by holding the Meta key and then
  556. typing `f' and `b', respectively. On displays without the Meta key,
  557. these functions are invoked by typing `C-z f' and `C-z b' (`C-z'
  558. simulates the Meta key in Insert state, as explained above).
  559.  
  560.    When Viper is in Insert state, you will see <I> in the mode line.
  561.  
  562. 
  563. File: viper,  Node: Replace State,  Prev: Insert State,  Up: States in Viper
  564.  
  565. Replace State
  566. -------------
  567.  
  568.    This state is entered through Vi replacement commands, such as `C',
  569. `cw', etc., or by typing `R'. In Replace state, Viper puts <R> in the
  570. mode line to let you know which state is in effect. If Replace state is
  571. entered through `R', Viper stays in that state until the user hits ESC.
  572. If this state is entered via the other replacement commands, then
  573. Replace state is in effect until you hit `ESC' or until you cross the
  574. rightmost boundary of the replacement region. In the latter case, Viper
  575. changes its state from Replace to Insert (which you will notice by the
  576. change in the mode line).
  577.  
  578.    Since Viper runs under Emacs, it is possible to switch between
  579. buffers while in Replace state. You can also move the cursor using the
  580. arrow keys (even on dumb terminals!) and the mouse. Because of this
  581. freedom (which is unattainable in regular Vi), it is possible to take
  582. the cursor outside the replacement region. (This may be necessary for
  583. several reasons, including the need to enable text selection and
  584. region-setting with the mouse.)
  585.  
  586.    The issue then arises as to what to do when the user hits the ESC
  587. key. In Vi, this would cause the text between cursor and the end of the
  588. replacement region to be deleted. But what if, as is possible in Viper,
  589. the cursor is not inside the replacement region?
  590.  
  591.    To solve the problem, Viper keeps track of the last cursor position
  592. while it was still inside the replacement region. So, in the above
  593. situation, Viper would delete text between this position and the end of
  594. the replacement region.
  595.  
  596. 
  597. File: viper,  Node: The Minibuffer,  Next: Multiple Files in Viper,  Prev: States in Viper,  Up: Overview
  598.  
  599. The Minibuffer
  600. ==============
  601.  
  602.    The Minibuffer is where commands are entered in. Editing can be done
  603. by commands from Insert state, namely:
  604.  
  605. `C-h'
  606.      Backspace
  607.  
  608. `C-w'
  609.      Delete Word
  610.  
  611. `C-u'
  612.      Erase line
  613.  
  614. `C-v'
  615.      Quote the following character
  616.  
  617. `RET'
  618.      Execute command
  619.  
  620. `C-g and C-]'
  621.      Emacs quit and abort keys. These may be necessary. *Note Vi
  622.      State::, for an explanation.
  623.  
  624. `M-p and M-n'
  625.      These keys are bound to functions that peruse minibuffer history.
  626.      The precise history to be perused depends on the context. It may
  627.      be the history of search strings, Ex commands, file names, etc.
  628.  
  629.    Most of the Emacs keys are functional in the Minibuffer.  While in
  630. the Minibuffer, Viper tries to make editing resemble Vi's behavior when
  631. the latter is waiting for the user to type an Ex command. In
  632. particular, you can use the regular Vi commands to edit the Minibuffer.
  633. You can switch between the Vi state and Insert state at will, and even
  634. use the replace mode.  Initially, the Minibuffer comes up in Insert
  635. state.
  636.  
  637.    Some users prefer plain Emacs bindings in the Minibuffer. To this
  638. end, set `vip-vi-style-in-minibuffer' to `nil' in `.vip'.  *Note
  639. Customization::, to learn how to do this.
  640.  
  641.    When the Minibuffer changes Viper states, you will notice that the
  642. appearance of the text there changes as well. This is useful because
  643. the Minibuffer has no mode line to tell which Vi state it is in.  The
  644. appearance of the text in the Minibuffer can be changed.  *Note Viper
  645. Specials::, for more details.
  646.  
  647. 
  648. File: viper,  Node: Multiple Files in Viper,  Next: Unimplemented Features,  Prev: The Minibuffer,  Up: Overview
  649.  
  650. Multiple Files in Viper
  651. =======================
  652.  
  653.    Viper can edit multiple files. This means, for example that you
  654. never need to suffer through `No write since last change' errors.  Some
  655. Viper elements are common over all the files.
  656.  
  657. `Textmarkers'
  658.      Textmarkers remember *files and positions*.  If you set marker `a'
  659.      in file `foo', start editing file `bar' and type `'a', then *YOU
  660.      WILL SWITCH TO FILE `foo'*. You can see the contents of a
  661.      textmarker using the Viper command `[<a-z>' where <a-z> are the
  662.      textmarkers, e.g., `[a' to view marker `a' .
  663.  
  664. `Repeated Commands'
  665.      Command repetitions are common over files. Typing `!!' will repeat
  666.      the last `!' command whichever file it was issued from.  Typing
  667.      `.' will repeat the last command from any file, and searches will
  668.      repeat the last search. Ex commands can be repeated by typing
  669.      `:RET'.  Note: in some rare cases, that `:RET' may do something
  670.      dangerous.  However, usually its effect can be undone by typing
  671.      `u'.
  672.  
  673. `Registers'
  674.      Registers are common to files. Also, text yanked with `y' can be
  675.      put back (`p') into any file. The Viper command `]<a-z>', where
  676.      <a-z> are the registers, can be used to look at the contents of a
  677.      register, e.g., type `]a' to view register `a'.
  678.  
  679.      There is one difference in text deletion that you should be aware
  680.      of. This difference comes from Emacs and was adopted in Viper
  681.      because we find it very useful. In Vi, if you delete a line, say,
  682.      and then another line, these two deletions are separated and are
  683.      put back separately if you use the `p' command. In Emacs (and
  684.      Viper), successive series of deletions that are *not interrupted*
  685.      by other commands are lumped together, so the deleted text gets
  686.      accumulated and can be put back as one chunk. If you want to break
  687.      a sequence of deletions so that the newly deleted text could be
  688.      put back separately from the previously deleted text, you should
  689.      perform a non-deleting action, e.g., move the cursor one character
  690.      in any direction.
  691.  
  692. `Absolute Filenames'
  693.      The current directory name for a file is automatically prepended
  694.      to the file name in any `:e', `:r', `:w', etc., command (in Emacs,
  695.      each buffer has a current directory).  This directory is inserted
  696.      in the Minibuffer once you type space after `:e, r', etc. Viper
  697.      also supports completion of file names and Ex commands (`TAB'),
  698.      and it keeps track of command and file history (`M-p', `M-n').
  699.      Absolute filenames are required less often in Viper.
  700.  
  701.      You should be aware that Emacs interprets `/foo/bar//bla' as
  702.      `/bla' and `/foo/~/bar' as `~/bar'. This is designed to minimize
  703.      the need for erasing path names that Emacs suggests in its
  704.      prompts, if a suggested path name is not what you wanted.
  705.  
  706.      The command `:cd' will change the default directory for the
  707.      current Emacs buffer. The Ex command `:e' will interpret the
  708.      filename argument in `csh', by default. *Note Customization::, if
  709.      you want to change this.
  710.  
  711. Currently undisplayed files can be listed using the `:ar' command.  The
  712. command `:n' can be given counts from the `:ar' list to switch to other
  713. files.
  714.  
  715. 
  716. File: viper,  Node: Unimplemented Features,  Prev: Multiple Files in Viper,  Up: Overview
  717.  
  718. Unimplemented Features
  719. ======================
  720.  
  721.    Unimplemented features include:
  722.  
  723.    * `:ab' and `:una' are not implemented.  Both `:map' and `:ab' are
  724.      considered obsolete, since Emacs has much more powerful facilities
  725.      for defining keyboard macros and abbreviations.
  726.  
  727.    * `:set option?' is not implemented. The current `:set' can also be
  728.      used to set Emacs variables.
  729.  
  730.    * `:se list' requires modification of the display code for Emacs, so
  731.      it is not implemented.  A useful alternative is `cat -t -e file'.
  732.      Unfortunately, it cannot be used directly inside Emacs, since
  733.      Emacs will obdurately change `^I' back to normal tabs.
  734.  
  735. 
  736. File: viper,  Node: Improvements over Vi,  Next: Customization,  Prev: Overview,  Up: Top
  737.  
  738. Improvements over Vi
  739. ********************
  740.  
  741.    Some common problems with Vi and Ex have been solved in Viper. This
  742. includes better implementation of existing commands, new commands, and
  743. the facilities provided by Emacs.
  744.  
  745. * Menu:
  746.  
  747. * Basics::                  Basic Viper differences, Multi-file effects.
  748. * Undo and Backups::        Multiple undo, auto-save, backups and changes
  749. * History::                 History for Ex and Vi commands.
  750. * Macros and Registers::    Keyboard Macros (extended ".") @reg execution.
  751. * Completion::              Filename and Command Completion for Ex.
  752. * Improved Search::         Incremental Search and Buffer Content Search.
  753. * Abbreviation Facilities:: Normal Abbrevs, Templates, and Dynamic Abbrevs.
  754. * Movement and Markers::    Screen Editor movements, viewing textmarkers.
  755. * New Commands::            Commands that do not exist in Vi.
  756. * Useful Packages::         A Sampling of some Emacs packages, and things
  757.                             you should know about.
  758.  
  759. 
  760. File: viper,  Node: Basics,  Next: Undo and Backups,  Prev: Improvements over Vi,  Up: Improvements over Vi
  761.  
  762. Basics
  763. ======
  764.  
  765.    The Vi command set is based on the idea of combining motion commands
  766. with other commands. The motion command is used as a text region
  767. specifier for other commands.  We classify motion commands into "point
  768. commands" and "line commands".
  769.  
  770.    The point commands are:
  771.  
  772.      `h', `l', `0',  `$', `w', `W', `b', `B', `e', `E', `(', `)', `/',
  773.      `?', ``', `f', `F', `t', `T', `%', `;', `,', `^'
  774.  
  775.    The line commands are:
  776.  
  777.      `j', `k', `+', `-', `H', `M', `L', `{', `}', `G', `'',  `[[',
  778.      `]]', `[]'
  779.  
  780. If a point command is given as an argument to a modifying command, the
  781. region determined by the point command will be affected by the modifying
  782. command. On the other hand, if a line command is given as an argument
  783. to a modifying command, the region determined by the line command will
  784. be enlarged so that it will become the smallest region properly
  785. containing the region and consisting of whole lines (we call this
  786. process "expanding the region"), and then the enlarged region will be
  787. affected by the modifying command.  Text Deletion Commands (*Note
  788. Deleting Text::), Change commands (*Note Changing Text::), even Shell
  789. Commands (*Note Shell Commands::) use these commands to describe a
  790. region of text to operate on.  Thus, type `dw' to delete a word, `>}'
  791. to shift a paragraph, or `!'afmt' to format a region from `point' to
  792. textmarker `a'.
  793.  
  794.    Viper adds the region specifiers `r' and `R'. Emacs has a special
  795. marker called "mark". The text-area between the current cursor position
  796. "point" and the "mark" is called the "region".  `r' specifies the raw
  797. region and `R' is the expanded region (i.e., the minimal contiguous
  798. chunk of full lines that contains the raw region).  `dr' will now
  799. delete the region, `>r' will shift it, etc.  `r,R' are not motion
  800. commands, however. The special mark is set by `m.' and other commands.
  801. *Note Marking::, for more info.
  802.  
  803.    Viper also adds counts to most commands for which it would make
  804. sense.
  805.  
  806.    In the Overview chapter, some Multiple File issues were discussed
  807. (*Note Multiple Files in Viper::). In addition to the files, Emacs has
  808. buffers. These can be seen in the `:args' list and switched using
  809. `:next' if you type `:set ex-cycle-through-non-files t', or specify
  810. `(setq ex-cycle-through-non-files t)' in your `.vip' file. *Note
  811. Customization::, for details.
  812.  
  813. 
  814. File: viper,  Node: Undo and Backups,  Next: History,  Prev: Basics,  Up: Improvements over Vi
  815.  
  816. Undo and Backups
  817. ================
  818.  
  819.    Viper provides multiple undo. The number of undo's and the size is
  820. limited by the machine. The Viper command `u' does an undo. Undo can be
  821. repeated by typing `.' (a period). Another `u' will undo the undo, and
  822. further `.' will repeat it. Typing `u' does the first undo, and changes
  823. the direction.
  824.  
  825.    Since the undo size is limited, Viper can create backup files and
  826. auto-save files. It will normally do this automatically. It is possible
  827. to have numbered backups, etc. For details, *note Backup and Auto-Save:
  828. (emacs)Backup.
  829.  
  830.    The results of the 9 previous changes are available in the 9 numeric
  831. registers, as in Vi. The extra goody is the ability to *view* these
  832. registers, in addition to being able to access them through `p' and
  833. `M-y' (*Note Insert State::, for details.) The Viper command `]
  834. register' will display the contents of any register, numeric or
  835. alphabetical. The related command `[ textmarker' will show the text
  836. around the textmarker. `register' and `textmarker' can be any letters
  837. from a through z.
  838.  
  839. 
  840. File: viper,  Node: History,  Next: Macros and Registers,  Prev: Undo and Backups,  Up: Improvements over Vi
  841.  
  842. History
  843. =======
  844.  
  845.    History is provided for Ex commands, Vi searches, file names, pieces
  846. of text inserted in earlier commands that use Insert or Replace state,
  847. and for destructive commands in Vi state. These are useful for fixing
  848. those small typos that screw up searches and `:s', and for eliminating
  849. routine associated with repeated typing of file names or pieces of text
  850. that need to be inserted frequently.  At the `:' or `/' prompts in the
  851. Minibuffer, you can do the following:
  852.  
  853. `M-p and M-n'
  854.      To move to previous and next history items. This causes the history
  855.      items to appear on the command line, where you can edit them, or
  856.      simply type Return to execute.
  857.  
  858. `M-r and M-s'
  859.      To search backward and forward through the history.
  860.  
  861. `RET'
  862.      Type RET to accept a default (which is displayed in the prompt).
  863.  
  864.    The history of insertions  can be perused by typing `C-c M-p' and
  865. `C-c M-n' while in Insert or Replace state.  The history of destructive
  866. Vi commands can be perused via the same keys when Viper is in Vi state.
  867. *Note Viper Specials::, for details.
  868.  
  869.    All Ex commands have a file history. For instance, typing `:e', space
  870. and then `M-p' will bring up the name of the previously typed file
  871. name. Repeatedly typing `M-p', `M-n', etc., will let you browse through
  872. the file history.
  873.  
  874.    Similarly, commands that have to do with switching buffers have a
  875. buffer history, and commands that expect strings or regular expressions
  876. keep a history on those items.
  877.  
  878. 
  879. File: viper,  Node: Macros and Registers,  Next: Completion,  Prev: History,  Up: Improvements over Vi
  880.  
  881. Macros and Registers
  882. ====================
  883.  
  884.    Viper facilitates the use of Emacs-style keyboard macros. `@#' will
  885. start a macro definition.  As you type, the commands will be executed,
  886. and remembered (This is called "learn mode" in some editors.)
  887. `@register' will complete the macro, putting it into `register', where
  888. `register' is any character from `a' through `z'. Then you can execute
  889. this macro using `@register'. It is, of course, possible to yank some
  890. text into a register and execute it using `@register'. Typing `@@',
  891. `@RET', or `@LF' will execute the last macro that was executed using
  892. `@register'.
  893.  
  894.    Viper will automatically lowercase the register, so that pressing the
  895. `SHIFT' key for `@' will not create problems. This is for `@' macros
  896. and `"p' *only*. In the case of `y', `"Ayy' will append to *register
  897. a*. For `[,],',`', it is an error to use a Uppercase register name.
  898.  
  899.    The contents of a register can be seen by `]register'. (`[textmarker'
  900. will show the contents of a textmarker).
  901.  
  902.    The last keyboard macro can also be executed using `*', and it can
  903. be yanked into a register using `@!register'.  This is useful for Emacs
  904. style keyboard macros defined using `C-x(' and `C-x)'. Emacs keyboard
  905. macros have more capabilities.  *Note Keyboard Macros: (emacs)Keyboard
  906. Macros, for details.
  907.  
  908.    Keyboard Macros allow an interesting form of Query-Replace:
  909. `/pattern' or `n' to go to the next pattern (the query), followed by a
  910. Keyboard Macro execution `@@' (the replace).
  911.  
  912.    Viper also provides Vi-style macros. *Note Vi Macros::, for details.
  913.  
  914. 
  915. File: viper,  Node: Completion,  Next: Improved Search,  Prev: Macros and Registers,  Up: Improvements over Vi
  916.  
  917. Completion
  918. ==========
  919.  
  920.    Completion is done when you type `TAB'. The Emacs completer does not
  921. grok wildcards in filenames. Once you type a wildcard, the completer
  922. will no longer work for that path.  Remember that Emacs interprets a
  923. file name of the form `/foo//bar' as `/bar' and `/foo/~/bar' as `~/bar'.
  924.  
  925. 
  926. File: viper,  Node: Improved Search,  Next: Abbreviation Facilities,  Prev: Completion,  Up: Improvements over Vi
  927.  
  928. Improved Search
  929. ===============
  930.  
  931.    Viper provides buffer search, the ability to search the buffer for a
  932. region under the cursor. You have to turn this on in `.vip' either by
  933. calling
  934.  
  935.      (vip-buffer-search-enable)
  936.  
  937. or by setting `vip-buffer-search-char' to, say, `f3':
  938.      (setq vip-buffer-search-char [f3])
  939.  
  940. If the user calls `vip-buffer-search-enable' explicitly (the first
  941. method), then `vip-buffer-search-char' will be set to `g'.  Regardless
  942. of how this feature is enabled, the key `vip-buffer-search-char' will
  943. take movement commands, like `w,/,e', to find a region and then search
  944. for the contents of that region. This command is very useful for
  945. searching for variable names, etc., in a program. The search can be
  946. repeated by `n' or reversed by `N'.
  947.  
  948.    Emacs provides incremental search. As you type the string in, the
  949. cursor will move to the next match. You can snarf words from the buffer
  950. as you go along. Incremental Search is normally bound to `C-s' and
  951. `C-r'. *Note Customization::, to find out how to change the bindings of
  952. `C-r or C-s'.  For details, *note Incremental Search:
  953. (emacs)Incremental Search.
  954.  
  955.    Viper also provides a query replace function that prompts through the
  956. Minibuffer. It is invoked by the `Q' key in Vi state.
  957.  
  958.    On a window display, Viper supports mouse search, i.e., you can
  959. search for a word by clicking on it. *Note Viper Specials::, for
  960. details.
  961.  
  962.    Finally, on a window display, Viper highlights search patterns as it
  963. finds them. This is done through what is known as *faces* in Emacs. The
  964. variable that controls how search patterns are highlighted is
  965. `vip-search-face'.  If you don't want any highlighting at all, put
  966.      (copy-face 'default 'vip-search-face)
  967.  
  968. in `~/.vip'. If you want to change how patterns are highlighted, you
  969. will have to set the variable `vip-search-face' to some other face,
  970. such as `highlight'. If none of the existing faces fits the bill, you
  971. may have to create your own. Further details on faces can be found in
  972. the Emacs Lisp Manual.
  973.  
  974. 
  975. File: viper,  Node: Abbreviation Facilities,  Next: Movement and Markers,  Prev: Improved Search,  Up: Improvements over Vi
  976.  
  977. Abbreviation Facilities
  978. =======================
  979.  
  980.    It is possible in Emacs to define abbrevs based on the contents of
  981. the buffer.  Sophisticated templates can be defined using the Emacs
  982. abbreviation facilities. *Note Abbreviations: (emacs)Abbrevs, for
  983. details.
  984.  
  985.    Emacs also provides Dynamic Abbreviations. Given a partial word,
  986. Emacs will search the buffer to find an extension for this word. For
  987. instance, one can type `Abbreviations' by typing `A', followed by a
  988. keystroke that completed the `A' to `Abbreviations'. Repeated typing
  989. will search further back in the buffer, so that one could get `Abbrevs'
  990. by repeating the keystroke, which appears earlier in the text. Emacs
  991. binds this to `ESC /', so you will have to find a key and bind the
  992. function `dabbrev-expand' to that key.  Facilities like this make Vi's
  993. `:ab' command obsolete.
  994.  
  995. 
  996. File: viper,  Node: Movement and Markers,  Next: New Commands,  Prev: Abbreviation Facilities,  Up: Improvements over Vi
  997.  
  998. Movement and Markers
  999. ====================
  1000.  
  1001.    Viper can be set free from the line-limited movements in Vi, such as
  1002. `l' refusing to move beyond the line, `ESC' moving one character back,
  1003. etc. These derive from Ex, which is a line editor. If your `.vip'
  1004. contains
  1005.  
  1006.      `(setq vip-ex-style-motion nil)'
  1007.  
  1008. the motion will be a true screen editor motion. One thing you must then
  1009. watch out for is that it is possible to be on the end-of-line character.
  1010. The keys `x' and `%' will still work correctly, i.e., as if they were
  1011. on the last character.
  1012.  
  1013.    The word-movement commands `w', `e', etc., and the associated
  1014. deletion/yanking commands, `dw', `yw', etc., can be made to understand
  1015. Emacs syntax tables. If the variable `vip-syntax-preference' is set to
  1016. `'strict-vi' (the default) then the meaning of *word* is the same as in
  1017. Vi. However, if the value is `'reformed-vi' then the alphanumeric
  1018. symbols will be those specified by the current Emacs syntax table (which
  1019. may be different for different major modes) plus the underscore symbol
  1020. `_'. The user can also specify the value `'emacs', which would make
  1021. Viper use exactly the Emacs notion of word. In particular, the
  1022. underscore may not be part of a word. Finally, if
  1023. `vip-syntax-preference' is set to `'extended', Viper words would
  1024. consist of characters that are classified as alphanumeric *or* as parts
  1025. of symbols. This is convenient for writing programs and in many other
  1026. situations.
  1027.  
  1028.    `vip-syntax-preference' is a local variable, so it can have different
  1029. values for different major modes. For instance, in programming modes it
  1030. can have the value `'extended'. In text modes where words contain
  1031. special characters, such as European (non-English) letters, Cyrillic
  1032. letters, etc., the value can be `'reformed-vi' or `'emacs'.
  1033.  
  1034.    Changes to `vip-syntax-preference' should be done in the hooks to
  1035. various major modes. Furthermore, for these changes to take effect, you
  1036. should execute `(vip-update-alphanumeric-class)' right after changing
  1037. the value of `vip-syntax-preference'.
  1038.  
  1039.    The above discussion of the meaning of Viper's words concerns only
  1040. Viper's movement commands. In regular expressions, words remain the
  1041. same as in Emacs.  That is, the expressions `\w', `\>', `\<', etc., use
  1042. Emacs' idea of what is a word, and they don't look into the value of
  1043. variable `vip-syntax-preference'. This is because Viper doesn't change
  1044. syntax tables in fear of upsetting the various major modes that set
  1045. these tables.
  1046.  
  1047.    Textmarkers in Viper remember the file and the position, so that you
  1048. can switch files by simply doing `'a'. If you set up a regimen for using
  1049. Textmarkers, this is very useful. Contents of textmarkers can be viewed
  1050. by `[marker'. (Contents of registers can be viewed by `]register').
  1051.  
  1052.