home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / vip.i01 (.txt) < prev    next >
GNU Info File  |  1993-06-14  |  51KB  |  996 lines

  1. This is Info file ../info/vip, produced by Makeinfo-1.47 from the input
  2. file vip.texinfo.
  3. Distribution
  4. ************
  5.    Copyright (C) 1987 Masahiko Sato.
  6.    Permission is granted to make and distribute verbatim copies of this
  7. manual provided the copyright notice and this permission notice are
  8. preserved on all copies.
  9.    Permission is granted to copy and distribute modified versions of
  10. this manual under the conditions for verbatim copying, provided that
  11. the entire resulting derived work is distributed under the terms of a
  12. permission notice identical to this one.
  13.    Permission is granted to copy and distribute translations of this
  14. manual into another language, under the same conditions as for modified
  15. versions.
  16. File: vip,  Node: Top,  Next: Survey,  Up: (DIR)
  17.    VIP ***
  18.    VIP is a Vi emulating package written in Emacs Lisp.  VIP implements
  19. most Vi commands including Ex commands.  It is therefore hoped that
  20. this package will enable you to do Vi style editing under the powerful
  21. GNU Emacs environment.  This info file describes the usage of VIP
  22. assuming that you are fairly accustomed to Vi but not so much with
  23. Emacs.  Also we will concentrate mainly on differences from Vi,
  24. especially features unique to VIP.
  25.    It is recommended that you read nodes on survey and on customization
  26. before you start using VIP.  Other nodes may be visited as needed.
  27.    Comments and bug reports are welcome.  Please send messages to
  28. `ms@Sail.Stanford.Edu' if you are outside of Japan and to
  29. `masahiko@sato.riec.tohoku.junet' if you are in Japan.
  30. * Menu:
  31. * Survey::        A survey of VIP.
  32. * Vi Commands::        Details of Vi commands.
  33. * Ex Commands::        Details of Ex commands.
  34. * Customization::    How to customize VIP.
  35. File: vip,  Node: Survey,  Next: Basic Concepts,  Prev: Top,  Up: Top
  36. A Survey of VIP
  37. ***************
  38.    In this chapter we describe basics of VIP with emphasis on the
  39. features not found in Vi and on how to use VIP under GNU Emacs.
  40. * Menu:
  41. * Basic Concepts::    Basic concepts in Emacs.
  42. * Loading VIP::        How to load VIP automatically.
  43. * Modes in VIP::    VIP has three modes, which are orthogonal to modes
  44.             in Emacs.
  45. * Differences from Vi:: Differences of VIP from Vi is explained.
  46. File: vip,  Node: Basic Concepts,  Next: Loading VIP,  Prev: Survey,  Up: Survey
  47. Basic Concepts
  48. ==============
  49.    We begin by explaining some basic concepts of Emacs.  These concepts
  50. are explained in more detail in the GNU Emacs Manual.
  51.    Conceptually, a "buffer" is just a string of ASCII characters and two
  52. special characters PNT ("point") and MRK ("mark") such that the
  53. character PNT occurs exactly once and MRK occurs at most once.  The
  54. "text" of a buffer is obtained by deleting the occurrences of PNT and
  55. MRK.  If, in a buffer, there is a character following PNT then we say
  56. that point is "looking at" the character; otherwise we say that point
  57. is "at the end of buffer". PNT and MRK are used to indicate positions
  58. in a buffer and they are not part of the text of the buffer.  If a
  59. buffer contains a MRK then the text between MRK and PNT is called the
  60. "region" of the buffer.
  61.    Emacs provides (multiple) "windows" on the screen, and you can see
  62. the content of a buffer through the window associated with the buffer. 
  63. The cursor of the screen is always positioned on the character after
  64.    A "keymap" is a table that records the bindings between characters
  65. and command functions.  There is the "global keymap" common to all the
  66. buffers.  Each buffer has its "local keymap" that determines the "mode"
  67. of the buffer.  Local keymap overrides global keymap, so that if a
  68. function is bound to some key in the local keymap then that function
  69. will be executed when you type the key.  If no function is bound to a
  70. key in the local map, however, the function bound to the key in the
  71. global map becomes in effect.
  72. File: vip,  Node: Loading VIP,  Next: Modes in VIP,  Prev: Basic Concepts,  Up: Survey
  73. Loading VIP
  74. ===========
  75.    The recommended way to load VIP automatically is to include the line:
  76.      (load "vip")
  77. in your `.emacs' file.  The `.emacs' file is placed in your home
  78. directory and it will be executed every time you invoke Emacs.  If you
  79. wish to be in vi mode whenver Emacs starts up, you can include the
  80. following line in your `.emacs' file instead of the above line:
  81.      (setq term-setup-hook 'vip-mode)
  82. (*Note Vi Mode::, for the explanation of vi mode.)
  83.    Even if your `.emacs' file does not contain any of the above lines,
  84. you can load VIP and enter vi mode by typing the following from within
  85. Emacs.
  86.      M-x vip-mode
  87. File: vip,  Node: Modes in VIP,  Next: Emacs Mode,  Prev: Loading VIP,  Up: Survey
  88. Modes in VIP
  89. ============
  90. Loading VIP has the effect of globally binding `C-z' (`Control-z') to
  91. the function `vip-change-mode-to-vi'. The default binding of `C-z' in
  92. GNU Emacs is `suspend-emacs', but, you can also call `suspend-emacs' by
  93. typing `C-x C-z'.  Other than this, all the key bindings of Emacs
  94. remain the same after loading VIP.
  95.    Now, if you hit `C-z', the function `vip-change-mode-to-vi' will be
  96. called and you will be in "vi mode".  (Some major modes may locally bind
  97. `C-z' to some special functions.  In such cases, you can call
  98. `vip-change-mode-to-vi' by `execute-extended-command' which is invoked
  99. by `M-x'.  Here `M-x' means `Meta-x', and if your terminal does not
  100. have a META key you can enter it by typing `ESC x'.  The same effect
  101. can also be achieve by typing `M-x vip-mode'.)
  102.    You can observe the change of mode by looking at the "mode line". 
  103. For instance, if the mode line is:
  104.      -----Emacs: *scratch*              (Lisp Interaction)----All------------
  105. then it will change to:
  106.      -----Vi:    *scratch*              (Lisp Interaction)----All------------
  107. Thus the word `Emacs' in the mode line will change to `Vi'.
  108.    You can go back to the original "emacs mode" by typing `C-z' in vi
  109. mode.  Thus `C-z' toggles between these two modes.
  110.    Note that modes in VIP exist orthogonally to modes in Emacs.  This
  111. means that you can be in vi mode and at the same time, say, shell mode.
  112.    Vi mode corresponds to Vi's command mode.  From vi mode you can enter
  113. "insert mode" (which corresponds to Vi's insert mode) by usual Vi
  114. command keys like `i', `a', `o' ... etc.
  115.    In insert mode, the mode line will look like this:
  116.      -----Insert *scratch*              (Lisp Interaction)----All------------
  117. You can exit from insert mode by hitting ESC key as you do in Vi.
  118.    That VIP has three modes may seem very complicated, but in fact it
  119. is not so.  VIP is implemented so that you can do most editing
  120. remaining only in the two modes for Vi (that is vi mode and insert
  121. mode).
  122.    The figure below shows the transition of three modes in VIP.
  123.                 === C-z ==>          == i,o ... ==>
  124.      emacs mode             vi mode                 insert mode
  125.                 <== X-z ===          <=== ESC ====
  126. * Menu:
  127. * Emacs Mode::        This is the mode you should know better.
  128. * Vi Mode::        Vi commands are executed in this mode.
  129. * Insert Mode::        You can enter text, and also can do editing if you
  130.             know enough Emacs commands.
  131. File: vip,  Node: Emacs Mode,  Next: Vi Mode,  Prev: Modes in VIP,  Up: Modes in VIP
  132. Emacs Mode
  133. ----------
  134.    You will be in this mode just after you loaded VIP.  You can do all
  135. normal Emacs editing in this mode.  Note that the key `C-z' is globally
  136. bound to `vip-change-mode-to-vi'.  So, if you type `C-z' in this mode
  137. then you will be in vi mode.
  138. File: vip,  Node: Vi Mode,  Next: Insert Mode,  Prev: Emacs Mode,  Up: Modes in VIP
  139. Vi Mode
  140. -------
  141.    This mode corresponds to Vi's command mode.  Most Vi commands work
  142. as they do in Vi.  You can go back to emacs mode by typing `C-z'.  You
  143. can enter insert mode, just as in Vi, by typing `i', `a' etc.
  144. File: vip,  Node: Insert Mode,  Next: Differences from Vi,  Prev: Vi Mode,  Up: Modes in VIP
  145. Insert Mode
  146. -----------
  147.    The key bindings in this mode is the same as in the emacs mode
  148. except for the following 4 keys.  So, you can move around in the buffer
  149. and change its content while you are in insert mode.
  150. `ESC'
  151.      This key will take you back to vi mode.
  152. `C-h'
  153.      Delete previous character.
  154. `C-w'
  155.      Delete previous word.
  156. `C-z'
  157.      Typing this key has the same effect as typing ESC in emacs mode.
  158.      Thus typing `C-z x' in insert mode will have the same effect as
  159.      typing `ESC x' in emacs mode.
  160. File: vip,  Node: Differences from Vi,  Next: Undoing,  Prev: Insert Mode,  Up: Survey
  161. Differences from Vi
  162. ===================
  163.    The major differences from Vi are explained below.
  164. * Menu:
  165. * Undoing::        You can undo more in VIP.
  166. * Changing::        Commands for changing the text.
  167. * Searching::        Search commands.
  168. * z Command::        You can now use zH, zM and zL as well as z- etc.
  169. * Counts::        Some Vi commands which do not accept a count now
  170.             accept one.
  171. * Marking::        You can now mark the current point, beginning of
  172.             the buffer etc.
  173. * Region Commands::    You can now give a region as an argument for delete
  174.             commands etc.
  175. * New Commands::    Some new commands not available in Vi are added.
  176. * New Bindings::    Bindings of some keys are changed for the
  177.             convenience of editing under Emacs.
  178. * Window Commands::    Commands for moving among windows etc.
  179. * Buffer Commands::    Commands for selecting buffers etc.
  180. * File Commands::    Commands for visiting files etc.
  181. * Misc Commands::    Other useful commands.
  182. File: vip,  Node: Undoing,  Next: Changing,  Prev: Differences from Vi,  Up: Differences from Vi
  183. Undoing
  184. -------
  185.    You can repeat undoing by the `.' key.  So, `u' will undo a single
  186. change, while `u . . .', for instance, will undo 4 previous changes. 
  187. Undo is undoable as in Vi.  So the content of the buffer will be the
  188. same before and after `u u'.
  189. File: vip,  Node: Changing,  Next: Searching,  Prev: Undoing,  Up: Differences from Vi
  190. Changing
  191. --------
  192.    Some commands which change a small number of characters are executed
  193. slightly differently.  Thus, if point is at the beginning of a word
  194. `foo' and you wished to change it to `bar' by typing `c w', then VIP
  195. will prompt you for a new word in the minibuffer by the prompt `foo =>
  196. '.  You can then enter `bar' followed by RET or ESC to complete the
  197. command.  Before you enter RET or ESC you can abort the command by
  198. typing `C-g'.  In general, you can abort a partially formed command by
  199. typing `C-g'.
  200. File: vip,  Node: Searching,  Next: z Command,  Prev: Changing,  Up: Differences from Vi
  201. Searching
  202. ---------
  203.    As in Vi, searching is done by `/' and `?'.  The string will be
  204. searched literally by default.  To invoke a regular expression search,
  205. first execute the search command `/' (or `?') with empty search string.
  206.  (I.e, type `/' followed by RET.) A search for empty string will toggle
  207. the search mode between vanilla search and regular expression search. 
  208. You cannot give an offset to the search string.  (It is a limitation.) 
  209. By default, search will wrap around the buffer as in Vi.  You can
  210. change this by rebinding the variable `vip-search-wrap-around'.  *Note
  211. Customization::, for how to do this.
  212. File: vip,  Node: z Command,  Next: Counts,  Prev: Searching,  Up: Differences from Vi
  213. z Command
  214. ---------
  215.    For those of you who cannot remember which of `z' followed by RET,
  216. `.' and `-' do what.  You can also use `z' followed by `H', `M' and `L'
  217. to place the current line in the Home (Middle, and Last) line of the
  218. window.
  219. File: vip,  Node: Counts,  Next: Marking,  Prev: z Command,  Up: Differences from Vi
  220. Counts
  221. ------
  222.    Some Vi commands which do not accept a count now accept one
  223.      Given counts, text will be yanked (in Vi's sense) that many times.
  224.       Thus `3 p' is the same as `p p p'.
  225.      Given counts, that many copies of text will be inserted. Thus `o a
  226.      b c ESC' will insert 3 lines of `abc' below the current line.
  227.      Given a count N, N-th occurrence will be searched.
  228. File: vip,  Node: Marking,  Next: Region Commands,  Prev: Counts,  Up: Differences from Vi
  229. Marking
  230. -------
  231.    Typing an `m' followed by a lower case character CH marks the point
  232. to the register named CH as in Vi.  In addition to these, we have
  233. following key bindings for marking.
  234. `m <'
  235.      Set mark at the beginning of buffer.
  236. `m >'
  237.      Set mark at the end of buffer.
  238. `m .'
  239.      Set mark at point (and push old mark on mark ring).
  240. `m ,'
  241.      Jump to mark (and pop mark off the mark ring).
  242. File: vip,  Node: Region Commands,  Next: New Commands,  Prev: Marking,  Up: Differences from Vi
  243. Region Commands
  244. ---------------
  245.    Vi operators like `d', `c' etc. are usually used in combination with
  246. motion commands.  It is now possible to use current region as the
  247. argument to these operators.  (A "region" is a part of buffer delimited
  248. by point and mark.)  The key `r' is used for this purpose. Thus `d r'
  249. will delete the current region.  If `R' is used instead of `r' the
  250. region will first be enlarged so that it will become the smallest
  251. region containing the original region and consisting of whole lines. 
  252. Thus `m . d R' will have the same effect as `d d'.
  253. File: vip,  Node: New Commands,  Next: New Bindings,  Prev: Region Commands,  Up: Differences from Vi
  254. Some New Commands
  255. -----------------
  256.    Note that the keys below (except for `R') are not used in Vi.
  257. `C-a'
  258.      Move point to the beginning of line.
  259. `C-n'
  260.      If you have two or more windows in the screen, this key will move
  261.      point to the next window.
  262. `C-o'
  263.      Insert a newline and leave point before it, and then enter insert
  264.      mode.
  265. `C-r'
  266.      Backward incremental search.
  267. `C-s'
  268.      Forward incremental search.
  269. `C-c'
  270. `C-x'
  271. `ESC'
  272.      These keys will exit from vi mode and return to emacs mode
  273.      temporarily.  If you hit one of these keys, Emacs will be in emacs
  274.      mode and will believe that you hit that key in emacs mode. For
  275.      example, if you hit `C-x' followed by `2', then the current window
  276.      will be split into 2 and you will be in vi mode again.
  277.      Escape to emacs mode.  Hitting `\' will take you to emacs mode,
  278.      and you can execute a single Emacs command.  After executing the
  279.      Emacs command you will be in vi mode again.  You can give a count
  280.      before typing `\'. Thus `5 \ *', as well as `\ C-u 5 *', will
  281.      insert `*****' before point.  Similarly `1 0 \ C-p' will move the
  282.      point 10 lines above the current line.
  283.      Kill current buffer if it is not modified.  Useful when you
  284.      selected a buffer which you did not want.
  285.      `Q' is for query replace and `R' is for replace.  By default,
  286.      string to be replaced are treated literally.  If you wish to do a
  287.      regular expression replace, first do replace with empty string as
  288.      the string to be replaced.  In this way, you can toggle between
  289.      vanilla and regular expression replacement.
  290.      These keys are used to Visit files.  `v' will switch to a buffer
  291.      visiting file whose name can be entered in the minibuffer. `V' is
  292.      similar, but will use window different from the current window.
  293.      If followed by a certain character CH, it becomes an operator whose
  294.      argument is the region determined by the motion command that
  295.      follows. Currently, CH can be one of `c', `C', `g', `q' and `s'.
  296. `# c'
  297.      Change upper case characters in the region to lower case
  298.      (`downcase-region').
  299. `# C'
  300.      Change lower case characters in the region to upper case. For
  301.      instance, `# C 3 w' will capitalize 3 words from the current point
  302.      (`upcase-region').
  303. `# g'
  304.      Execute last keyboard macro for each line in the region
  305.      (`vip-global-execute').
  306. `# q'
  307.      Insert specified string at the beginning of each line in the region
  308.      (`vip-quote-region').
  309. `# s'
  310.      Check spelling of words in the region (`spell-region').
  311.      Call last keyboard macro.
  312. File: vip,  Node: New Bindings,  Next: Window Commands,  Prev: New Commands,  Up: Differences from Vi
  313. New Key Bindings
  314. ----------------
  315.    In VIP the meanings of some keys are entirely different from Vi. 
  316. These key bindings are done deliberately in the hope that editing under
  317. Emacs will become easier.  It is however possible to rebind these keys
  318. to functions which behave similarly as in Vi.  *Note Customizing Key
  319. Bindings::, for details.
  320. `C-g'
  321.      In Vi, `C-g' is used to get information about the file associated
  322.      to the current buffer.  Here, `g' will do that, and `C-g' is used
  323.      to abort a command (this is for compatibility with emacs mode.)
  324. `SPC'
  325. `RET'
  326.      Now these keys will scroll up and down the text of current window.
  327.      Convenient for viewing the text.
  328.      They are used to switch to a specified buffer.  Useful for
  329.      switching to already existing buffer since buffer name completion
  330.      is provided.  Also a default buffer will be given as part of the
  331.      prompt, to which you can switch by just typing RET key.  `s' is
  332.      used to select buffer in the current window, while `S' selects
  333.      buffer in another window.
  334.      These keys will exit from vi mode and return to emacs mode
  335.      temporarily. If you type `C' (`X'), Emacs will be in emacs mode
  336.      and will believe that you have typed `C-c' (`C-x', resp.) in emacs
  337.      mode. Moreover, if the following character you type is an upper
  338.      case letter, then Emacs will believe that you have typed the
  339.      corresponding control character. You will be in vi mode again
  340.      after the command is executed.  For example, typing `X S' in vi
  341.      mode is the same as typing `C-x C-s' in emacs mode.  You get the
  342.      same effect by typing `C-x C-s' in vi mode, but the idea here is
  343.      that you can execute useful Emacs commands without typing control
  344.      characters. For example, if you hit `X' (or `C-x') followed by
  345.      `2', then the current window will be split into 2 and you will be
  346.      in vi mode again.
  347.    In addition to these, `ctl-x-map' is slightly modified:
  348. `X 3'
  349. `C-x 3'
  350.      This is equivalent to `C-x 1 C-x 2' (1 + 2 = 3).
  351. File: vip,  Node: Window Commands,  Next: Buffer Commands,  Prev: New Bindings,  Up: Differences from Vi
  352. Window Commands
  353. ---------------
  354.    In this and following subsections, we give a summary of key bindings
  355. for basic functions related to windows, buffers and files.
  356. `C-n'
  357.      Switch to next window.
  358. `X 1'
  359. `C-x 1'
  360.      Delete other windows.
  361. `X 2'
  362. `C-x 2'
  363.      Split current window into two windows.
  364. `X 3'
  365. `C-x 3'
  366.      Show current buffer in two windows.
  367. File: vip,  Node: Buffer Commands,  Next: File Commands,  Prev: Window Commands,  Up: Differences from Vi
  368. Buffer Commands
  369. ---------------
  370.      Switch to the specified buffer in the current window
  371.      (`vip-switch-to-buffer').
  372.      Switch to the specified buffer in another window
  373.      (`vip-switch-to-buffer-other-window').
  374.      Kill the current buffer if it is not modified.
  375. `X S'
  376. `C-x C-s'
  377.      Save the current buffer in the file associated to the buffer.
  378. File: vip,  Node: File Commands,  Next: Misc Commands,  Prev: Buffer Commands,  Up: Differences from Vi
  379. File Commands
  380. -------------
  381.      Visit specified file in the current window.
  382.      Visit specified file in another window.
  383. `X W'
  384. `C-x C-w'
  385.      Write current buffer into the specified file.
  386. `X I'
  387. `C-x C-i'
  388.      Insert specified file at point.
  389. File: vip,  Node: Misc Commands,  Next: Vi Commands,  Prev: File Commands,  Up: Differences from Vi
  390. Miscellaneous Commands
  391. ----------------------
  392. `X ('
  393. `C-x ('
  394.      Start remembering keyboard macro.
  395. `X )'
  396. `C-x )'
  397.      Finish remembering keyboard macro.
  398.      Call last remembered keyboard macro.
  399. `X Z'
  400. `C-x C-z'
  401.      Suspend Emacs.
  402. `Z Z'
  403.      Exit Emacs.
  404.      Query replace.
  405.      Replace.
  406. File: vip,  Node: Vi Commands,  Next: Numeric Arguments,  Prev: Misc Commands,  Up: Top
  407. Vi Commands
  408. ***********
  409.    This chapter describes Vi commands other than Ex commands
  410. implemented in VIP.  Except for the last section which discusses insert
  411. mode, all the commands described in this chapter are to be used in vi
  412. mode.
  413. * Menu:
  414. * Numeric Arguments::    Many commands accept numeric arguments
  415. * Important Keys::    Some very important keys.
  416. * Buffers and Windows::    Commands for handling buffers and windows.
  417. * Files::        Commands for handling files.
  418. * Viewing the Buffer::    How you can view the current buffer.
  419. * Mark Commands::    Marking positions in a buffer.
  420. * Motion Commands::    Commands for moving point.
  421. * Modifying Commands::    Commands for modifying the buffer.
  422. File: vip,  Node: Numeric Arguments,  Next: Important Keys,  Prev: Vi Commands,  Up: Vi Commands
  423. Numeric Arguments
  424. =================
  425.    Most Vi commands accept a "numeric argument" which can be supplied as
  426. a prefix to the commands.  A numeric argument is also called a "count".
  427. In many cases, if a count is given, the command is executed that many
  428. times. For instance, `5 d d' deletes 5 lines while simple `d d' deletes
  429. a line.  In this manual the metavariable N will denote a count.
  430. File: vip,  Node: Important Keys,  Next: Buffers and Windows,  Prev: Numeric Arguments,  Up: Vi Commands
  431. Important Keys
  432. ==============
  433.    The keys `C-g' and `C-l' are unique in that their associated
  434. functions are the same in any of emacs, vi and insert mode.
  435. `C-g'
  436.      Quit.  Cancel running or partially typed command (`keyboard-quit').
  437. `C-l'
  438.      Clear the screen and reprint everything (`recenter').
  439.    In Emacs many commands are bound to the key strokes that start with
  440. `C-x', `C-c' and ESC.  These commands can be accessed from vi mode as
  441. easily as from emacs mode.
  442. `C-x'
  443. `C-c'
  444. `ESC'
  445.      Typing one of these keys have the same effect as typing it in
  446.      emacs mode. Appropriate command will be executed according as the
  447.      keys you type after it.  You will be in vi mode again after the
  448.      execution of the command. For instance, if you type `ESC <' (in vi
  449.      mode) then the cursor will move to the beginning of the buffer and
  450.      you will still be in vi mode.
  451.      Typing one of these keys have the effect of typing the
  452.      corresponding control character in emacs mode.  Moreover, if you
  453.      type an upper case character following it, that character will
  454.      also be translated to the corresponding control character.  Thus
  455.      typing `X W' in vi mode is the same as typing `C-x C-w' in emacs
  456.      mode.  You will be in vi mode again after the execution of a
  457.      command.
  458.      Escape to emacs mode.  Hitting the `\' key will take you to emacs
  459.      mode, and you can execute a single Emacs command.  After executing
  460.      the Emacs command you will be in vi mode again.  You can give a
  461.      count before typing `\'.  Thus `5 \ +', as well as `\ C-u 5 +',
  462.      will insert `+++++' before point.
  463. File: vip,  Node: Buffers and Windows,  Next: Files,  Prev: Important Keys,  Up: Vi Commands
  464. Buffers and Windows
  465. ===================
  466.    In Emacs the text you edit is stored in a "buffer". See GNU Emacs
  467. Manual, for details.  There is always one "selected" buffer which is
  468. called the "current buffer".
  469.    You can see the contents of buffers through "windows" created by
  470. Emacs. When you have multiple windows on the screen only one of them is
  471. selected. Each buffer has a unique name, and each window has a mode
  472. line which shows the name of the buffer associated with the window and
  473. other information about the status of the buffer.  You can change the
  474. format of the mode line, but normally if you see `**' at the beginning
  475. of a mode line it means that the buffer is "modified".  If you write
  476. out the content of the buffer to a file, then the buffer will become
  477. not modified.  Also if you see `%%' at the beginning of the mode line,
  478. it means that the file associated with the buffer is write protected.
  479.    We have the following commands related to windows and buffers.
  480. `C-n'
  481.      Move cursor to the next-window (`vip-next-window').
  482. `X 1'
  483.      Delete other windows and make the selected window fill the screen
  484.      (`delete-other-windows').
  485. `X 2'
  486.      Split current window into two windows (`split-window-vertically').
  487. `X 3'
  488.      Show current buffer in two windows.
  489. `s BUFFER RET'
  490.      Select or create a buffer named BUFFER (`vip-switch-to-buffer').
  491. `S BUFFER RET'
  492.      Similar but select a buffer named BUFFER in another window
  493.      (`vip-switch-to-buffer-other-window').
  494.      Kill the current buffer if it is not modified or if it is not
  495.      associated with a file
  496.      (`vip-kill-buffer').
  497. `X B'
  498.      List the existing buffers (`list-buffers').
  499.    As "buffer name completion" is provided, you have only to type in
  500. initial substring of the buffer name which is sufficient to identify it
  501. among names of existing buffers.  After that, if you hit TAB the rest
  502. of the buffer name will be supplied by the system, and you can confirm
  503. it by RET.  The default buffer name to switch to will also be prompted,
  504. and you can select it by giving a simple RET.  See GNU Emacs Manual for
  505. details of completion.
  506. File: vip,  Node: Files,  Next: Viewing the Buffer,  Prev: Buffers and Windows,  Up: Vi Commands
  507. Files
  508. =====
  509.    We have the following commands related to files.  They are used to
  510. visit, save and insert files.
  511. `v FILE RET'
  512.      Visit specified file in the current window (`vip-find-file').
  513. `V FILE RET'
  514.      Visit specified file in another window
  515.      (`vip-find-file-other-window').
  516. `X S'
  517.      Save current buffer to the file associated with the buffer.  If no
  518.      file is associated with the buffer, the name of the file to write
  519.      out the content of the buffer will be asked in the minibuffer.
  520. `X W FILE RET'
  521.      Write current buffer into a specified file.
  522. `X I FILE RET'
  523.      Insert a specified file at point.
  524.      Give information on the file associated with the current buffer. 
  525.      Tell you the name of the file associated with the buffer, the line
  526.      number of the current point and total line numbers in the buffer. 
  527.      If no file is associated with the buffer, this fact will be
  528.      indicated by the null file name `""'.
  529.    In Emacs, you can edit a file by "visiting" it.  If you wish to
  530. visit a file in the current window, you can just type `v'.  Emacs
  531. maintains the "default directory" which is specific to each buffer. 
  532. Suppose, for instance, that the default directory of the current buffer
  533. is `/usr/masahiko/lisp/'.  Then you will get the following prompt in the
  534. minibuffer.
  535.      visit file: /usr/masahiko/lisp/
  536. If you wish to visit, say, `vip.el' in this directory, then you can
  537. just type `vip.el' followed by RET.  If the file `vip.el' already
  538. exists in the directory, Emacs will visit that file, and if not, the
  539. file will be created.  Emacs will use the file name (`vip.el', in this
  540. case) as the name of the buffer visiting the file.  In order to make
  541. the buffer name unique, Emacs may append `<2>', `<3>' etc., to the
  542. buffer name.  As the "file name completion" is provided here, you can
  543. sometime save typing.  For instance, suppose there is only one file in
  544. the default directory whose name starts with `v', that is `vip.el'.
  545. Then if you just type `v TAB' then it will be completed to `vip.el'. 
  546. Thus, in this case, you just have to type `v v TAB RET' to visit
  547. `/usr/masahiko/lisp/vip.el'.  Continuing the example, let us now
  548. suppose that you wished to visit the file
  549. `/usr/masahiko/man/vip.texinfo'.  Then to the same prompt which you get
  550. after you typed `v', you can enter `/usr/masahiko/man/vip.texinfo' or
  551. `../man/vip.texinfo' followed by RET.
  552.    Use `V' instead of `v', if you wish to visit a file in another
  553. window.
  554.    You can verify which file you are editing by typing `g'.  (You can
  555. also type `X B' to get nformation on other buffers too.)  If you type
  556. `g' you will get an information like below in the echo area:
  557.      "/usr/masahiko/man/vip.texinfo" line 921 of 1949
  558.    After you edited the buffer (`vip.texinfo', in our example) for a
  559. while, you may wish to save it in a file.  If you wish to save it in
  560. the file associated with the buffer (`/usr/masahiko/man/vip.texinfo',
  561. in this case), you can just say `X S'.  If you wish to save it in
  562. another file, you can type `X W'.  You will then get a similar prompt
  563. as you get for `v', to which you can enter the file name.
  564. File: vip,  Node: Viewing the Buffer,  Next: Mark Commands,  Prev: Files,  Up: Vi Commands
  565. Viewing the Buffer
  566. ==================
  567.    In this and next section we discuss commands for moving around in the
  568. buffer.  These command do not change the content of the buffer.  The
  569. following commands are useful for viewing the content of the current
  570. buffer.
  571. `SPC'
  572. `C-f'
  573.      Scroll text of current window upward almost full screen.  You can
  574.      go forward in the buffer by this command (`vip-scroll').
  575. `RET'
  576. `C-b'
  577.      Scroll text of current window downward almost full screen.  You
  578.      can go backward in the buffer by this command (`vip-scroll-back').
  579. `C-d'
  580.      Scroll text of current window upward half screen.  You can go down
  581.      in the buffer by this command (`vip-scroll-down').
  582. `C-u'
  583.      Scroll text of current window downward half screen.  You can go up
  584.      in the buffer by this command (`vip-scroll-up').
  585. `C-y'
  586.      Scroll text of current window upward by one line
  587.      (`vip-scroll-down-one').
  588. `C-e'
  589.      Scroll text of current window downward by one line
  590.      (`vip-scroll-up-one').
  591. You can repeat these commands by giving a count.  Thus, `2 SPC' has the
  592. same effect as `SPC SPC'.
  593.    The following commands reposition point in the window.
  594. `z H'
  595. `z RET'
  596.      Put point on the top (home) line in the window.  So the current
  597.      line becomes the top line in the window.  Given a count N, point
  598.      will be placed in the N-th line from top (`vip-line-to-top').
  599. `z M'
  600. `z .'
  601.      Put point on the middle line in the window.  Given a count N,
  602.      point will be placed in the N-th line from the middle line
  603.      (`vip-line-to-middle').
  604. `z L'
  605. `z -'
  606.      Put point on the bottom line in the window.  Given a count N,
  607.      point will be placed in the N-th line from bottom
  608.      (`vip-line-to-bottom').
  609. `C-l'
  610.      Center point in window and redisplay screen (`recenter').
  611. File: vip,  Node: Mark Commands,  Next: Motion Commands,  Prev: Viewing the Buffer,  Up: Vi Commands
  612. Mark Commands
  613. =============
  614.    The following commands are used to mark positions in the buffer.
  615. `m CH'
  616.      Store current point in the register CH.  CH must be a lower case
  617.      character between `a' and `z'.
  618. `m <'
  619.      Set mark at the beginning of current buffer.
  620. `m >'
  621.      Set mark at the end of current buffer.
  622. `m .'
  623.      Set mark at point.
  624. `m ,'
  625.      Jump to mark (and pop mark off the mark ring).
  626.    Emacs uses the "mark ring" to store marked positions.  The commands
  627. `m <', `m >' and `m .' not only set mark but also add it as the latest
  628. element of the mark ring (replacing the oldest one).  By repeating the
  629. command ``m ,'' you can visit older and older marked positions.  You
  630. will eventually be in a loop as the mark ring is a ring.
  631. File: vip,  Node: Motion Commands,  Next: Searching and Replacing,  Prev: Mark Commands,  Up: Vi Commands
  632. Motion Commands
  633. ===============
  634.    Commands for moving around in the current buffer are collected here.
  635.  These commands are used as an `argument' for the delete, change and
  636. yank commands to be described in the next section.
  637.      Move point backward by one character.  Signal error if point is at
  638.      the beginning of buffer, but (unlike Vi) do not complain otherwise
  639.      (`vip-backward-char').
  640.      Move point backward by one character.  Signal error if point is at
  641.      the end of buffer, but (unlike Vi) do not complain otherwise
  642.      (`vip-forward-char').
  643.      Move point to the next line keeping the current column.  If point
  644.      is on the last line of the buffer, a new line will be created and
  645.      point will move to that line (`vip-next-line').
  646.      Move point to the previous line keeping the current column
  647.      (`vip-next-line').
  648.      Move point to the next line at the first non-white character.  If
  649.      point is on the last line of the buffer, a new line will be
  650.      created and point will move to the beginning of that line
  651.      (`vip-next-line-at-bol').
  652.      Move point to the previous line at the first non-white character
  653.      (`vip-previous-line-at-bol').
  654. If a count is given to these commands, the commands will be repeated
  655. that many times.
  656.      Move point to the beginning of line (`vip-beginning-of-line').
  657.      Move point to the first non-white character on the line
  658.      (`vip-bol-and-skip-white').
  659.      Move point to the end of line (`vip-goto-eol').
  660. `N |'
  661.      Move point to the N-th column on the line (`vip-goto-col').
  662. Except for the `|' command, these commands neglect a count.
  663.      Move point forward to the beginning of the next word
  664.      (`vip-forward-word').
  665.      Move point forward to the beginning of the next word, where a
  666.      "word" is considered as a sequence of non-white characters
  667.      (`vip-forward-Word').
  668.      Move point backward to the beginning of a word
  669.      (`vip-backward-word').
  670.      Move point backward to the beginning of a word, where a word is
  671.      considered as a sequence of non-white characters
  672.      (`vip-forward-Word').
  673.      Move point forward to the end of a word (`vip-end-of-word').
  674.      Move point forward to the end of a word, where a word is
  675.      considered as a sequence of non-white characters
  676.      (`vip-end-of-Word').
  677. Here the meaning of the word `word' for the `w', `b' and `e' commands
  678. is determined by the "syntax table" effective in the current buffer. 
  679. Each major mode has its syntax mode, and therefore the meaning of a
  680. word also changes as the major mode changes.  See GNU Emacs Manual for
  681. details of syntax table.
  682.      Move point to the beginning of the home (top) line of the window.
  683.      Given a count N, go to the N-th line from top (`vip-window-top').
  684.      Move point to the beginning of the middle line of the window. 
  685.      Given a count N, go to the N-th line from the middle line
  686.      (`vip-window-middle').
  687.      Move point to the beginning of the lowest (bottom) line of the
  688.      window.  Given count, go to the N-th line from bottom
  689.      (`vip-window-bottom').
  690. These commands can be used to go to the desired line visible on the
  691. screen.
  692.      Move point backward to the beginning of the sentence
  693.      (`vip-backward-sentence').
  694.      Move point forward to the end of the sentence
  695.      (`vip-forward-sentence').
  696.      Move point backward to the beginning of the paragraph
  697.      (`vip-backward-paragraph').
  698.      Move point forward to the end of the paragraph
  699.      (`vip-forward-paragraph').
  700. A count repeats the effect for these commands.
  701.      Given a count N, move point to the N-th line in the buffer on the
  702.      first non-white character.  Without a count, go to the end of the
  703.      buffer (`vip-goto-line').
  704. `` `'
  705.      Exchange point and mark (`vip-goto-mark').
  706. `` CH'
  707.      Move point to the position stored in the register CH.  CH must be
  708.      a lower case letter.
  709. `' ''
  710.      Exchange point and mark, and then move point to the first non-white
  711.      character on the line (`vip-goto-mark-and-skip-white').
  712. `' CH'
  713.      Move point to the position stored in the register CH and skip to
  714.      the first non-white character on the line.  CH must be a lower
  715.      case letter.
  716.      Move point to the matching parenthesis if point is looking at `(',
  717.      `)', `{', `}', `[' or `]'
  718.      (`vip-paren-match').
  719. The command `G' mark point before move, so that you can return to the
  720. original point by `` `'.  The original point will also be stored in the
  721. mark ring.
  722.    The following commands are useful for moving points on the line.  A
  723. count will repeat the effect.
  724. `f CH'
  725.      Move point forward to the character CH on the line.  Signal error
  726.      if CH could not be found (`vip-find-char-forward').
  727. `F CH'
  728.      Move point backward to the character CH on the line.  Signal error
  729.      if CH could not be found (`vip-find-char-backward').
  730. `t CH'
  731.      Move point forward upto the character CH on the line.  Signal
  732.      error if CH could not be found (`vip-goto-char-forward').
  733. `T CH'
  734.      Move point backward upto the character CH on the line.  Signal
  735.      error if CH could not be found (`vip-goto-char-backward').
  736.      Repeat previous `f', `t', `F' or `T' command (`vip-repeat-find').
  737.      Repeat previous `f', `t', `F' or `T' command, in the opposite
  738.      direction (`vip-repeat-find-opposite').
  739. File: vip,  Node: Searching and Replacing,  Next: Modifying Commands,  Prev: Motion Commands,  Up: Vi Commands
  740. Searching and Replacing
  741. =======================
  742.    Following commands are available for searching and replacing.
  743. `/ STRING RET'
  744.      Search the first occurrence of the string STRING forward starting
  745.      from point.  Given a count N, the N-th occurrence of STRING will
  746.      be searched.  If the variable `vip-re-search' has value `t' then
  747.      "regular expression" search is done and the string matching the
  748.      regular expression STRING is found.  If you give an empty string
  749.      as STRING then the search mode will change from vanilla search to
  750.      regular expression search and vice versa (`vip-search-forward').
  751. `? STRING RET'
  752.      Same as `/', except that search is done backward
  753.      (`vip-search-backward').
  754.      Search the previous search pattern in the same direction as before
  755.      (`vip-search-next').
  756.      Search the previous search pattern in the opposite direction
  757.      (`vip-search-Next').
  758. `C-s'
  759.      Search forward incrementally.  See GNU Emacs Manual for details
  760.      (`isearch-forward').
  761. `C-r'
  762.      Search backward incrementally (`isearch-backward').
  763. `R STRING RET NEWSTRING'
  764.      There are two modes of replacement, "vanilla" and "regular
  765.      expression". If the mode is vanilla you will get a prompt `Replace
  766.      string:', and if the mode is regular expression you will ge a
  767.      prompt `Replace regexp:'.  The mode is initially vanilla, but you
  768.      can toggle these modes by giving a null string as STRING.  If the
  769.      mode is vanilla, this command replaces every occurrence of STRING
  770.      with NEWSTRING.  If the mode is regular expression, STRING is
  771.      treated as a regular expression and every string matching the
  772.      regular expression is replaced with NEWSTRING
  773.      (`vip-replace-string').
  774. `Q    STRING RET NEWSTRING'
  775.      Same as `R' except that you will be asked form confirmation before
  776.      each replacement
  777.      (`vip-query-replace').
  778. `r CH'
  779.      Replace the character point is looking at by the character CH. 
  780.      Give count, replace that many characters by CH
  781.      (`vip-replace-char').
  782. The commands `/' and `?' mark point before move, so that you can return
  783. to the original point by `` `'.
  784. File: vip,  Node: Modifying Commands,  Next: Delete Commands,  Prev: Searching and Replacing,  Up: Vi Commands
  785. Modifying Commands
  786. ==================
  787.    In this section, commands for modifying the content of a buffer are
  788. described.  These commands affect the region determined by a motion
  789. command which is given to the commands as their argument.
  790.    We classify motion commands into "point commands" and "line
  791. commands".  The point commands are as follows:
  792.      `h', `l', `0', `^', `$', `w', `W', `b', `B', `e', `E', `(', `)', `/', `?', ``', `f', `F', `t', `T', `%', `;', `,'
  793. The line commands are as follows:
  794.      `j', `k', `+', `-', `H', `M', `L', `{', `}', `G', `''
  795. If a point command is given as an argument to a modifying command, the
  796. region determined by the point command will be affected by the modifying
  797. command. On the other hand, if a line command is given as an argument
  798. to a modifying command, the region determined by the line command will
  799. be enlarged so that it will become the smallest region properly
  800. containing the region and consisting of whole lines (we call this
  801. process "expanding the region"), and then the enlarged region will be
  802. affected by the modifying command.
  803. * Menu:
  804. * Delete Commands::    Commands for deleting text.
  805. * Yank Commands::    Commands for yanking text in Vi's sense.
  806. * Put Back Commands::    Commands for putting bake deleted/yanked text.
  807. * Change Commands::    Commands for changing text.
  808. File: vip,  Node: Delete Commands,  Next: Yank Commands,  Prev: Modifying Commands,  Up: Modifying Commands
  809. Delete Commands
  810. ---------------
  811. `d MOTION-COMMAND'
  812.      Delete the region determined by the motion command MOTION-COMMAND.
  813. For example, `d $' will delete the region between point and end of
  814. current line since `$' is a point command that moves point to end of
  815. line. `d G' will delete the region between the beginning of current
  816. line and end of the buffer, since `G' is a line command.  A count given
  817. to the command above will become the count for the associated motion
  818. command. Thus, `3 d w' will delete three words.
  819.    It is also possible to save the deleted text into a register you
  820. specify. For example, you can say `" t 3 d w' to delete three words and
  821. save it to register `t'.  The name of a register is a lower case letter
  822. between `a' and `z'.  If you give an upper case letter as an argument to
  823. a delete command, then the deleted text will be appended to the content
  824. of the register having the corresponding lower case letter as its name.
  825.  So, `" T d w' will delete a word and append it to register `t'.  Other
  826. modifying commands also accept a register name as their argument, and we
  827. will not repeat similar explanations.
  828.    We have more delete commands as below.
  829. `d d'
  830.      Delete a line.  Given a count N, delete N lines.
  831. `d r'
  832.      Delete current region.
  833. `d R'
  834.      Expand current region and delete it.
  835.      Delete to the end of a line (`vip-kill-line').
  836.      Delete a character after point.  Given N, delete N characters
  837.      (`vip-delete-char').
  838. `DEL'
  839.      Delete a character before point.  Given N, delete N characters
  840.      (`vip-delete-backward-char').
  841. File: vip,  Node: Yank Commands,  Next: Put Back Commands,  Prev: Delete Commands,  Up: Modifying Commands
  842. Yank Commands
  843. -------------
  844.    Yank commands "yank" a text of buffer into a (usually anonymous)
  845. register. Here the word `yank' is used in Vi's sense.  Thus yank
  846. commands do not alter the content of the buffer, and useful only in
  847. combination with commands that put back the yanked text into the buffer.
  848. `y MOTION-COMMAND'
  849.      Yank the region determined by the motion command MOTION-COMMAND.
  850. For example, `y $' will yank the text between point and the end of line
  851. into an anonymous register, while `"c y $' will yank the same text into
  852. register `c'.
  853.    Use the following command to yank consecutive lines of text.
  854. `y y'
  855.      Yank a line.  Given N, yank N lines (`vip-yank-line').
  856. `y r'
  857.      Yank current region.
  858. `y R'
  859.      Expand current region and yank it.
  860. File: vip,  Node: Put Back Commands,  Next: Change Commands,  Prev: Yank Commands,  Up: Modifying Commands
  861. Put Back Commands
  862. -----------------
  863.    Deleted or yanked texts can be put back into the buffer by the
  864. command below.
  865.      Insert, after the character point is looking at, most recently
  866.      deleted/yanked text from anonymous register. Given a register name
  867.      argument, the content of the named register will be put back. 
  868.      Given a count, the command will be repeated that many times. This
  869.      command also checks if the text to put back ends with a new line
  870.      character, and if so the text will be put below the current line
  871.      (`vip-put-back').
  872.      Insert at point most recently deleted/yanked text from anonymous
  873.      register. Given a register name argument, the content of the named
  874.      register will be put back.  Given a count, the command will be
  875.      repeated that many times. This command also checks if the text to
  876.      put back ends with a new line character, and if so the text will
  877.      be put above the current line rather than at point
  878.      (`vip-Put-back').
  879. Thus, `" c p' will put back the content of the register `c' into the
  880. buffer.  It is also possible to specify "number register" which is a
  881. numeral between `1' and `9'.  If the number register N is specified,
  882. N-th previously deleted/yanked text will be put back.  It is an error
  883. to specify a number register for the delete/yank commands.
  884. File: vip,  Node: Change Commands,  Next: Repeating and Undoing Modifications,  Prev: Put Back Commands,  Up: Modifying Commands
  885. Change Commands
  886. ---------------
  887.    Most commonly used change command takes the following form.
  888. `c MOTION-COMMAND'
  889.      Replace the content of the region determined by the motion command
  890.      MOTION-COMMAND by the text you type.  If the motion command is a
  891.      point command then you will type the text into minibuffer, and if
  892.      the motion command is a line command then the region will be
  893.      deleted first and you can insert the text in INSERT MODE.
  894. For example, if point is at the beginning of a word `foo' and you wish
  895. to change it to `bar', you can type `c w'.  Then, as `w' is a point
  896. command, you will get the prompt `foo =>' in the minibuffer, for which
  897. you can type `b a r RET' to complete the change command.
  898. `c c'
  899.      Change a line.  Given a count, that many lines are changed.
  900. `c r'
  901.      Change current region.
  902. `c R'
  903.      Expand current region and change it.
  904. File: vip,  Node: Repeating and Undoing Modifications,  Next: Other Vi Commands,  Prev: Change Commands,  Up: Modifying Commands
  905. Repeating and Undoing Modifications
  906. -----------------------------------
  907.    VIP records the previous modifying command, so that it is easy to
  908. repeat it.  It is also very easy to undo changes made by modifying
  909. commands.
  910.      Undo the last change.  You can undo more by repeating undo by the
  911.      repeat command `.'.  For example, you can undo 5 previous changes
  912.      by typing `u....'.  If you type `uu', then the second `u' undoes
  913.      the first undo command (`vip-undo').
  914.      Repeat the last modifying command.  Given count N it becomes the
  915.      new count for the repeated command.  Otherwise, the count for the
  916.      last modifying command is used again (`vip-repeat').
  917. File: vip,  Node: Other Vi Commands,  Next: Commands in Insert Mode,  Prev: Repeating and Undoing Modifications,  Up: Vi Commands
  918. Other Vi Commands
  919. =================
  920.    Miscellaneous Vi commands are collected here.
  921. `Z Z'
  922.      Exit Emacs.  If modified buffers exist, you will be asked whether
  923.      you wish to save them or not (`save-buffers-kill-emacs').
  924. `! MOTION-COMMAND FORMAT-COMMAND'
  925. `N ! ! FORMAT-COMMAND'
  926.      The region determined by the motion command MOTION-COMMAND will be
  927.      given to the shell command FORMAT-COMMAND and the region will be
  928.      replaced by its output.  If a count is given, it will be passed to
  929.      MOTION-COMMAND.  For example, `3!Gsort' will sort the region
  930.      between point and the 3rd line.  If `!' is used instead of
  931.      MOTION-COMMAND then N lines will be processed by FORMAT-COMMAND
  932.      (`vip-command-argument').
  933.      Join two lines.  Given count, join that many lines.  A space will
  934.      be inserted at each junction (`vip-join-lines').
  935. `< MOTION-COMMAND'
  936. `N < <'
  937.      Shift region determined by the motion command MOTION-COMMAND to
  938.      left by SHIFT-WIDTH (default is 8).  If `<' is used instead of
  939.      MOTION-COMMAND then shift N lines
  940.      (`vip-command-argument').
  941. `> MOTION-COMMAND'
  942. `N > >'
  943.      Shift region determined by the motion command MOTION-COMMAND to
  944.      right by SHIFT-WIDTH (default is 8).  If `<' is used instead of
  945.      MOTION-COMMAND then shift N lines
  946.      (`vip-command-argument').
  947. `= MOTION-COMMAND'
  948.      Indent region determined by the motion command MOTION-COMMAND.  If
  949.      `=' is used instead of MOTION-COMMAND then indent N lines
  950.      (`vip-command-argument').
  951.      Call last remembered keyboard macro.
  952.      A new vi operator. *Note New Commands::, for more details.
  953.    The following keys are reserved for future extensions, and currently
  954. assigned to a function that just beeps (`vip-nil').
  955.      &, @, U, [, ], _, q, ~
  956.    VIP uses a special local keymap to interpret key strokes you enter
  957. in vi mode.  The following keys are bound to NIL in the keymap. 
  958. Therefore, these keys are interpreted by the global keymap of Emacs. 
  959. We give below a short description of the functions bound to these keys
  960. in the global keymap.  See GNU Emacs Manual for details.
  961. `C-@'
  962.      Set mark and push previous mark on mark ring (`set-mark-command').
  963. `TAB'
  964.      Indent line for current major mode (`indent-for-tab-command').
  965. `LFD'
  966.      Insert a newline, then indent according to mode
  967.      (`newline-and-indent').
  968. `C-k'
  969.      Kill the rest of the current line; before a newline, kill the
  970.      newline. With prefix argument, kill that many lines from point. 
  971.      Negative arguments kill lines backward (`kill-line').
  972. `C-l'
  973.      Clear the screen and reprint everything (`recenter').
  974. `N C-p'
  975.      Move cursor vertically up N lines (`previous-line').
  976. `C-q'
  977.      Read next input character and insert it.  Useful for inserting
  978.      control characters
  979.      (`quoted-insert').
  980. `C-r'
  981.      Search backward incrementally (`isearch-backward').
  982. `C-s'
  983.      Search forward incrementally (`isearch-forward').
  984. `N C-t'
  985.      Interchange charcters around point, moving forward one character. 
  986.      With count N, take character before point and drag it forward past
  987.      N other characters.  If no argument and at end of line, the
  988.      previous two characters are exchanged (`transpose-chars').
  989. `N C-v'
  990.      Scroll text upward N lines.  If N is not given, scroll near full
  991.      screen (`scroll-up').
  992. `C-w'
  993.      Kill between point and mark.  The text is save in the kill ring. 
  994.      The command `P' or `p' can retrieve it from kill ring
  995.      (`kill-region').
  996.