home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / vip.i01 < prev    next >
Encoding:
GNU Info File  |  1993-06-14  |  49.8 KB  |  1,457 lines

  1. This is Info file ../info/vip, produced by Makeinfo-1.47 from the input
  2. file vip.texinfo.
  3.  
  4. Distribution
  5. ************
  6.  
  7.    Copyright (C) 1987 Masahiko Sato.
  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: vip,  Node: Top,  Next: Survey,  Up: (DIR)
  24.  
  25.    VIP ***
  26.  
  27.    VIP is a Vi emulating package written in Emacs Lisp.  VIP implements
  28. most Vi commands including Ex commands.  It is therefore hoped that
  29. this package will enable you to do Vi style editing under the powerful
  30. GNU Emacs environment.  This info file describes the usage of VIP
  31. assuming that you are fairly accustomed to Vi but not so much with
  32. Emacs.  Also we will concentrate mainly on differences from Vi,
  33. especially features unique to VIP.
  34.  
  35.    It is recommended that you read nodes on survey and on customization
  36. before you start using VIP.  Other nodes may be visited as needed.
  37.  
  38.    Comments and bug reports are welcome.  Please send messages to
  39. `ms@Sail.Stanford.Edu' if you are outside of Japan and to
  40. `masahiko@sato.riec.tohoku.junet' if you are in Japan.
  41.  
  42. * Menu:
  43.  
  44. * Survey::        A survey of VIP.
  45. * Vi Commands::        Details of Vi commands.
  46. * Ex Commands::        Details of Ex commands.
  47. * Customization::    How to customize VIP.
  48.  
  49. 
  50. File: vip,  Node: Survey,  Next: Basic Concepts,  Prev: Top,  Up: Top
  51.  
  52. A Survey of VIP
  53. ***************
  54.  
  55.    In this chapter we describe basics of VIP with emphasis on the
  56. features not found in Vi and on how to use VIP under GNU Emacs.
  57.  
  58. * Menu:
  59.  
  60. * Basic Concepts::    Basic concepts in Emacs.
  61. * Loading VIP::        How to load VIP automatically.
  62. * Modes in VIP::    VIP has three modes, which are orthogonal to modes
  63.             in Emacs.
  64. * Differences from Vi:: Differences of VIP from Vi is explained.
  65.  
  66. 
  67. File: vip,  Node: Basic Concepts,  Next: Loading VIP,  Prev: Survey,  Up: Survey
  68.  
  69. Basic Concepts
  70. ==============
  71.  
  72.    We begin by explaining some basic concepts of Emacs.  These concepts
  73. are explained in more detail in the GNU Emacs Manual.
  74.  
  75.    Conceptually, a "buffer" is just a string of ASCII characters and two
  76. special characters PNT ("point") and MRK ("mark") such that the
  77. character PNT occurs exactly once and MRK occurs at most once.  The
  78. "text" of a buffer is obtained by deleting the occurrences of PNT and
  79. MRK.  If, in a buffer, there is a character following PNT then we say
  80. that point is "looking at" the character; otherwise we say that point
  81. is "at the end of buffer". PNT and MRK are used to indicate positions
  82. in a buffer and they are not part of the text of the buffer.  If a
  83. buffer contains a MRK then the text between MRK and PNT is called the
  84. "region" of the buffer.
  85.  
  86.    Emacs provides (multiple) "windows" on the screen, and you can see
  87. the content of a buffer through the window associated with the buffer. 
  88. The cursor of the screen is always positioned on the character after
  89. PNT.
  90.  
  91.    A "keymap" is a table that records the bindings between characters
  92. and command functions.  There is the "global keymap" common to all the
  93. buffers.  Each buffer has its "local keymap" that determines the "mode"
  94. of the buffer.  Local keymap overrides global keymap, so that if a
  95. function is bound to some key in the local keymap then that function
  96. will be executed when you type the key.  If no function is bound to a
  97. key in the local map, however, the function bound to the key in the
  98. global map becomes in effect.
  99.  
  100. 
  101. File: vip,  Node: Loading VIP,  Next: Modes in VIP,  Prev: Basic Concepts,  Up: Survey
  102.  
  103. Loading VIP
  104. ===========
  105.  
  106.    The recommended way to load VIP automatically is to include the line:
  107.      (load "vip")
  108.  
  109. in your `.emacs' file.  The `.emacs' file is placed in your home
  110. directory and it will be executed every time you invoke Emacs.  If you
  111. wish to be in vi mode whenver Emacs starts up, you can include the
  112. following line in your `.emacs' file instead of the above line:
  113.      (setq term-setup-hook 'vip-mode)
  114.  
  115. (*Note Vi Mode::, for the explanation of vi mode.)
  116.  
  117.    Even if your `.emacs' file does not contain any of the above lines,
  118. you can load VIP and enter vi mode by typing the following from within
  119. Emacs.
  120.      M-x vip-mode
  121.  
  122. 
  123. File: vip,  Node: Modes in VIP,  Next: Emacs Mode,  Prev: Loading VIP,  Up: Survey
  124.  
  125. Modes in VIP
  126. ============
  127.  
  128. Loading VIP has the effect of globally binding `C-z' (`Control-z') to
  129. the function `vip-change-mode-to-vi'. The default binding of `C-z' in
  130. GNU Emacs is `suspend-emacs', but, you can also call `suspend-emacs' by
  131. typing `C-x C-z'.  Other than this, all the key bindings of Emacs
  132. remain the same after loading VIP.
  133.  
  134.    Now, if you hit `C-z', the function `vip-change-mode-to-vi' will be
  135. called and you will be in "vi mode".  (Some major modes may locally bind
  136. `C-z' to some special functions.  In such cases, you can call
  137. `vip-change-mode-to-vi' by `execute-extended-command' which is invoked
  138. by `M-x'.  Here `M-x' means `Meta-x', and if your terminal does not
  139. have a META key you can enter it by typing `ESC x'.  The same effect
  140. can also be achieve by typing `M-x vip-mode'.)
  141.  
  142.    You can observe the change of mode by looking at the "mode line". 
  143. For instance, if the mode line is:
  144.      -----Emacs: *scratch*              (Lisp Interaction)----All------------
  145.  
  146. then it will change to:
  147.      -----Vi:    *scratch*              (Lisp Interaction)----All------------
  148.  
  149. Thus the word `Emacs' in the mode line will change to `Vi'.
  150.  
  151.    You can go back to the original "emacs mode" by typing `C-z' in vi
  152. mode.  Thus `C-z' toggles between these two modes.
  153.  
  154.    Note that modes in VIP exist orthogonally to modes in Emacs.  This
  155. means that you can be in vi mode and at the same time, say, shell mode.
  156.  
  157.    Vi mode corresponds to Vi's command mode.  From vi mode you can enter
  158. "insert mode" (which corresponds to Vi's insert mode) by usual Vi
  159. command keys like `i', `a', `o' ... etc.
  160.  
  161.    In insert mode, the mode line will look like this:
  162.      -----Insert *scratch*              (Lisp Interaction)----All------------
  163.  
  164. You can exit from insert mode by hitting ESC key as you do in Vi.
  165.  
  166.    That VIP has three modes may seem very complicated, but in fact it
  167. is not so.  VIP is implemented so that you can do most editing
  168. remaining only in the two modes for Vi (that is vi mode and insert
  169. mode).
  170.  
  171.    The figure below shows the transition of three modes in VIP.
  172.  
  173.  
  174.                 === C-z ==>          == i,o ... ==>
  175.      emacs mode             vi mode                 insert mode
  176.                 <== X-z ===          <=== ESC ====
  177.  
  178. * Menu:
  179.  
  180. * Emacs Mode::        This is the mode you should know better.
  181. * Vi Mode::        Vi commands are executed in this mode.
  182. * Insert Mode::        You can enter text, and also can do editing if you
  183.             know enough Emacs commands.
  184.  
  185. 
  186. File: vip,  Node: Emacs Mode,  Next: Vi Mode,  Prev: Modes in VIP,  Up: Modes in VIP
  187.  
  188. Emacs Mode
  189. ----------
  190.  
  191.    You will be in this mode just after you loaded VIP.  You can do all
  192. normal Emacs editing in this mode.  Note that the key `C-z' is globally
  193. bound to `vip-change-mode-to-vi'.  So, if you type `C-z' in this mode
  194. then you will be in vi mode.
  195.  
  196. 
  197. File: vip,  Node: Vi Mode,  Next: Insert Mode,  Prev: Emacs Mode,  Up: Modes in VIP
  198.  
  199. Vi Mode
  200. -------
  201.  
  202.    This mode corresponds to Vi's command mode.  Most Vi commands work
  203. as they do in Vi.  You can go back to emacs mode by typing `C-z'.  You
  204. can enter insert mode, just as in Vi, by typing `i', `a' etc.
  205.  
  206. 
  207. File: vip,  Node: Insert Mode,  Next: Differences from Vi,  Prev: Vi Mode,  Up: Modes in VIP
  208.  
  209. Insert Mode
  210. -----------
  211.  
  212.    The key bindings in this mode is the same as in the emacs mode
  213. except for the following 4 keys.  So, you can move around in the buffer
  214. and change its content while you are in insert mode.
  215.  
  216. `ESC'
  217.      This key will take you back to vi mode.
  218.  
  219. `C-h'
  220.      Delete previous character.
  221.  
  222. `C-w'
  223.      Delete previous word.
  224.  
  225. `C-z'
  226.      Typing this key has the same effect as typing ESC in emacs mode.
  227.      Thus typing `C-z x' in insert mode will have the same effect as
  228.      typing `ESC x' in emacs mode.
  229.  
  230. 
  231. File: vip,  Node: Differences from Vi,  Next: Undoing,  Prev: Insert Mode,  Up: Survey
  232.  
  233. Differences from Vi
  234. ===================
  235.  
  236.    The major differences from Vi are explained below.
  237.  
  238. * Menu:
  239.  
  240. * Undoing::        You can undo more in VIP.
  241. * Changing::        Commands for changing the text.
  242. * Searching::        Search commands.
  243. * z Command::        You can now use zH, zM and zL as well as z- etc.
  244. * Counts::        Some Vi commands which do not accept a count now
  245.             accept one.
  246. * Marking::        You can now mark the current point, beginning of
  247.             the buffer etc.
  248. * Region Commands::    You can now give a region as an argument for delete
  249.             commands etc.
  250. * New Commands::    Some new commands not available in Vi are added.
  251. * New Bindings::    Bindings of some keys are changed for the
  252.             convenience of editing under Emacs.
  253. * Window Commands::    Commands for moving among windows etc.
  254. * Buffer Commands::    Commands for selecting buffers etc.
  255. * File Commands::    Commands for visiting files etc.
  256. * Misc Commands::    Other useful commands.
  257.  
  258. 
  259. File: vip,  Node: Undoing,  Next: Changing,  Prev: Differences from Vi,  Up: Differences from Vi
  260.  
  261. Undoing
  262. -------
  263.  
  264.    You can repeat undoing by the `.' key.  So, `u' will undo a single
  265. change, while `u . . .', for instance, will undo 4 previous changes. 
  266. Undo is undoable as in Vi.  So the content of the buffer will be the
  267. same before and after `u u'.
  268.  
  269. 
  270. File: vip,  Node: Changing,  Next: Searching,  Prev: Undoing,  Up: Differences from Vi
  271.  
  272. Changing
  273. --------
  274.  
  275.    Some commands which change a small number of characters are executed
  276. slightly differently.  Thus, if point is at the beginning of a word
  277. `foo' and you wished to change it to `bar' by typing `c w', then VIP
  278. will prompt you for a new word in the minibuffer by the prompt `foo =>
  279. '.  You can then enter `bar' followed by RET or ESC to complete the
  280. command.  Before you enter RET or ESC you can abort the command by
  281. typing `C-g'.  In general, you can abort a partially formed command by
  282. typing `C-g'.
  283.  
  284. 
  285. File: vip,  Node: Searching,  Next: z Command,  Prev: Changing,  Up: Differences from Vi
  286.  
  287. Searching
  288. ---------
  289.  
  290.    As in Vi, searching is done by `/' and `?'.  The string will be
  291. searched literally by default.  To invoke a regular expression search,
  292. first execute the search command `/' (or `?') with empty search string.
  293.  (I.e, type `/' followed by RET.) A search for empty string will toggle
  294. the search mode between vanilla search and regular expression search. 
  295. You cannot give an offset to the search string.  (It is a limitation.) 
  296. By default, search will wrap around the buffer as in Vi.  You can
  297. change this by rebinding the variable `vip-search-wrap-around'.  *Note
  298. Customization::, for how to do this.
  299.  
  300. 
  301. File: vip,  Node: z Command,  Next: Counts,  Prev: Searching,  Up: Differences from Vi
  302.  
  303. z Command
  304. ---------
  305.  
  306.    For those of you who cannot remember which of `z' followed by RET,
  307. `.' and `-' do what.  You can also use `z' followed by `H', `M' and `L'
  308. to place the current line in the Home (Middle, and Last) line of the
  309. window.
  310.  
  311. 
  312. File: vip,  Node: Counts,  Next: Marking,  Prev: z Command,  Up: Differences from Vi
  313.  
  314. Counts
  315. ------
  316.  
  317.    Some Vi commands which do not accept a count now accept one
  318.  
  319. `p'
  320. `P'
  321.      Given counts, text will be yanked (in Vi's sense) that many times.
  322.       Thus `3 p' is the same as `p p p'.
  323.  
  324. `o'
  325. `O'
  326.      Given counts, that many copies of text will be inserted. Thus `o a
  327.      b c ESC' will insert 3 lines of `abc' below the current line.
  328.  
  329. `/'
  330. `?'
  331.      Given a count N, N-th occurrence will be searched.
  332.  
  333. 
  334. File: vip,  Node: Marking,  Next: Region Commands,  Prev: Counts,  Up: Differences from Vi
  335.  
  336. Marking
  337. -------
  338.  
  339.    Typing an `m' followed by a lower case character CH marks the point
  340. to the register named CH as in Vi.  In addition to these, we have
  341. following key bindings for marking.
  342.  
  343. `m <'
  344.      Set mark at the beginning of buffer.
  345.  
  346. `m >'
  347.      Set mark at the end of buffer.
  348.  
  349. `m .'
  350.      Set mark at point (and push old mark on mark ring).
  351.  
  352. `m ,'
  353.      Jump to mark (and pop mark off the mark ring).
  354.  
  355. 
  356. File: vip,  Node: Region Commands,  Next: New Commands,  Prev: Marking,  Up: Differences from Vi
  357.  
  358. Region Commands
  359. ---------------
  360.  
  361.    Vi operators like `d', `c' etc. are usually used in combination with
  362. motion commands.  It is now possible to use current region as the
  363. argument to these operators.  (A "region" is a part of buffer delimited
  364. by point and mark.)  The key `r' is used for this purpose. Thus `d r'
  365. will delete the current region.  If `R' is used instead of `r' the
  366. region will first be enlarged so that it will become the smallest
  367. region containing the original region and consisting of whole lines. 
  368. Thus `m . d R' will have the same effect as `d d'.
  369.  
  370. 
  371. File: vip,  Node: New Commands,  Next: New Bindings,  Prev: Region Commands,  Up: Differences from Vi
  372.  
  373. Some New Commands
  374. -----------------
  375.  
  376.    Note that the keys below (except for `R') are not used in Vi.
  377.  
  378. `C-a'
  379.      Move point to the beginning of line.
  380.  
  381. `C-n'
  382.      If you have two or more windows in the screen, this key will move
  383.      point to the next window.
  384.  
  385. `C-o'
  386.      Insert a newline and leave point before it, and then enter insert
  387.      mode.
  388.  
  389. `C-r'
  390.      Backward incremental search.
  391.  
  392. `C-s'
  393.      Forward incremental search.
  394.  
  395. `C-c'
  396. `C-x'
  397. `ESC'
  398.      These keys will exit from vi mode and return to emacs mode
  399.      temporarily.  If you hit one of these keys, Emacs will be in emacs
  400.      mode and will believe that you hit that key in emacs mode. For
  401.      example, if you hit `C-x' followed by `2', then the current window
  402.      will be split into 2 and you will be in vi mode again.
  403.  
  404. `\'
  405.      Escape to emacs mode.  Hitting `\' will take you to emacs mode,
  406.      and you can execute a single Emacs command.  After executing the
  407.      Emacs command you will be in vi mode again.  You can give a count
  408.      before typing `\'. Thus `5 \ *', as well as `\ C-u 5 *', will
  409.      insert `*****' before point.  Similarly `1 0 \ C-p' will move the
  410.      point 10 lines above the current line.
  411.  
  412. `K'
  413.      Kill current buffer if it is not modified.  Useful when you
  414.      selected a buffer which you did not want.
  415.  
  416. `Q'
  417. `R'
  418.      `Q' is for query replace and `R' is for replace.  By default,
  419.      string to be replaced are treated literally.  If you wish to do a
  420.      regular expression replace, first do replace with empty string as
  421.      the string to be replaced.  In this way, you can toggle between
  422.      vanilla and regular expression replacement.
  423.  
  424. `v'
  425. `V'
  426.      These keys are used to Visit files.  `v' will switch to a buffer
  427.      visiting file whose name can be entered in the minibuffer. `V' is
  428.      similar, but will use window different from the current window.
  429.  
  430. `#'
  431.      If followed by a certain character CH, it becomes an operator whose
  432.      argument is the region determined by the motion command that
  433.      follows. Currently, CH can be one of `c', `C', `g', `q' and `s'.
  434.  
  435. `# c'
  436.      Change upper case characters in the region to lower case
  437.      (`downcase-region').
  438.  
  439. `# C'
  440.      Change lower case characters in the region to upper case. For
  441.      instance, `# C 3 w' will capitalize 3 words from the current point
  442.      (`upcase-region').
  443.  
  444. `# g'
  445.      Execute last keyboard macro for each line in the region
  446.      (`vip-global-execute').
  447.  
  448. `# q'
  449.      Insert specified string at the beginning of each line in the region
  450.      (`vip-quote-region').
  451.  
  452. `# s'
  453.      Check spelling of words in the region (`spell-region').
  454.  
  455. `*'
  456.      Call last keyboard macro.
  457.  
  458. 
  459. File: vip,  Node: New Bindings,  Next: Window Commands,  Prev: New Commands,  Up: Differences from Vi
  460.  
  461. New Key Bindings
  462. ----------------
  463.  
  464.    In VIP the meanings of some keys are entirely different from Vi. 
  465. These key bindings are done deliberately in the hope that editing under
  466. Emacs will become easier.  It is however possible to rebind these keys
  467. to functions which behave similarly as in Vi.  *Note Customizing Key
  468. Bindings::, for details.
  469.  
  470. `C-g'
  471. `g'
  472.      In Vi, `C-g' is used to get information about the file associated
  473.      to the current buffer.  Here, `g' will do that, and `C-g' is used
  474.      to abort a command (this is for compatibility with emacs mode.)
  475.  
  476. `SPC'
  477. `RET'
  478.      Now these keys will scroll up and down the text of current window.
  479.      Convenient for viewing the text.
  480.  
  481. `s'
  482. `S'
  483.      They are used to switch to a specified buffer.  Useful for
  484.      switching to already existing buffer since buffer name completion
  485.      is provided.  Also a default buffer will be given as part of the
  486.      prompt, to which you can switch by just typing RET key.  `s' is
  487.      used to select buffer in the current window, while `S' selects
  488.      buffer in another window.
  489.  
  490. `C'
  491. `X'
  492.      These keys will exit from vi mode and return to emacs mode
  493.      temporarily. If you type `C' (`X'), Emacs will be in emacs mode
  494.      and will believe that you have typed `C-c' (`C-x', resp.) in emacs
  495.      mode. Moreover, if the following character you type is an upper
  496.      case letter, then Emacs will believe that you have typed the
  497.      corresponding control character. You will be in vi mode again
  498.      after the command is executed.  For example, typing `X S' in vi
  499.      mode is the same as typing `C-x C-s' in emacs mode.  You get the
  500.      same effect by typing `C-x C-s' in vi mode, but the idea here is
  501.      that you can execute useful Emacs commands without typing control
  502.      characters. For example, if you hit `X' (or `C-x') followed by
  503.      `2', then the current window will be split into 2 and you will be
  504.      in vi mode again.
  505.  
  506.    In addition to these, `ctl-x-map' is slightly modified:
  507.  
  508. `X 3'
  509. `C-x 3'
  510.      This is equivalent to `C-x 1 C-x 2' (1 + 2 = 3).
  511.  
  512. 
  513. File: vip,  Node: Window Commands,  Next: Buffer Commands,  Prev: New Bindings,  Up: Differences from Vi
  514.  
  515. Window Commands
  516. ---------------
  517.  
  518.    In this and following subsections, we give a summary of key bindings
  519. for basic functions related to windows, buffers and files.
  520.  
  521. `C-n'
  522.      Switch to next window.
  523.  
  524. `X 1'
  525. `C-x 1'
  526.      Delete other windows.
  527.  
  528. `X 2'
  529. `C-x 2'
  530.      Split current window into two windows.
  531.  
  532. `X 3'
  533. `C-x 3'
  534.      Show current buffer in two windows.
  535.  
  536. 
  537. File: vip,  Node: Buffer Commands,  Next: File Commands,  Prev: Window Commands,  Up: Differences from Vi
  538.  
  539. Buffer Commands
  540. ---------------
  541.  
  542. `s'
  543.      Switch to the specified buffer in the current window
  544.      (`vip-switch-to-buffer').
  545.  
  546. `S'
  547.      Switch to the specified buffer in another window
  548.      (`vip-switch-to-buffer-other-window').
  549.  
  550. `K'
  551.      Kill the current buffer if it is not modified.
  552.  
  553. `X S'
  554. `C-x C-s'
  555.      Save the current buffer in the file associated to the buffer.
  556.  
  557. 
  558. File: vip,  Node: File Commands,  Next: Misc Commands,  Prev: Buffer Commands,  Up: Differences from Vi
  559.  
  560. File Commands
  561. -------------
  562.  
  563. `v'
  564.      Visit specified file in the current window.
  565.  
  566. `V'
  567.      Visit specified file in another window.
  568.  
  569. `X W'
  570. `C-x C-w'
  571.      Write current buffer into the specified file.
  572.  
  573. `X I'
  574. `C-x C-i'
  575.      Insert specified file at point.
  576.  
  577. 
  578. File: vip,  Node: Misc Commands,  Next: Vi Commands,  Prev: File Commands,  Up: Differences from Vi
  579.  
  580. Miscellaneous Commands
  581. ----------------------
  582.  
  583. `X ('
  584. `C-x ('
  585.      Start remembering keyboard macro.
  586.  
  587. `X )'
  588. `C-x )'
  589.      Finish remembering keyboard macro.
  590.  
  591. `*'
  592.      Call last remembered keyboard macro.
  593.  
  594. `X Z'
  595. `C-x C-z'
  596.      Suspend Emacs.
  597.  
  598. `Z Z'
  599.      Exit Emacs.
  600.  
  601. `Q'
  602.      Query replace.
  603.  
  604. `R'
  605.      Replace.
  606.  
  607. 
  608. File: vip,  Node: Vi Commands,  Next: Numeric Arguments,  Prev: Misc Commands,  Up: Top
  609.  
  610. Vi Commands
  611. ***********
  612.  
  613.    This chapter describes Vi commands other than Ex commands
  614. implemented in VIP.  Except for the last section which discusses insert
  615. mode, all the commands described in this chapter are to be used in vi
  616. mode.
  617.  
  618. * Menu:
  619.  
  620. * Numeric Arguments::    Many commands accept numeric arguments
  621. * Important Keys::    Some very important keys.
  622. * Buffers and Windows::    Commands for handling buffers and windows.
  623. * Files::        Commands for handling files.
  624. * Viewing the Buffer::    How you can view the current buffer.
  625. * Mark Commands::    Marking positions in a buffer.
  626. * Motion Commands::    Commands for moving point.
  627. * Modifying Commands::    Commands for modifying the buffer.
  628.  
  629. 
  630. File: vip,  Node: Numeric Arguments,  Next: Important Keys,  Prev: Vi Commands,  Up: Vi Commands
  631.  
  632. Numeric Arguments
  633. =================
  634.  
  635.    Most Vi commands accept a "numeric argument" which can be supplied as
  636. a prefix to the commands.  A numeric argument is also called a "count".
  637. In many cases, if a count is given, the command is executed that many
  638. times. For instance, `5 d d' deletes 5 lines while simple `d d' deletes
  639. a line.  In this manual the metavariable N will denote a count.
  640.  
  641. 
  642. File: vip,  Node: Important Keys,  Next: Buffers and Windows,  Prev: Numeric Arguments,  Up: Vi Commands
  643.  
  644. Important Keys
  645. ==============
  646.  
  647.    The keys `C-g' and `C-l' are unique in that their associated
  648. functions are the same in any of emacs, vi and insert mode.
  649.  
  650. `C-g'
  651.      Quit.  Cancel running or partially typed command (`keyboard-quit').
  652.  
  653. `C-l'
  654.      Clear the screen and reprint everything (`recenter').
  655.  
  656.    In Emacs many commands are bound to the key strokes that start with
  657. `C-x', `C-c' and ESC.  These commands can be accessed from vi mode as
  658. easily as from emacs mode.
  659.  
  660. `C-x'
  661. `C-c'
  662. `ESC'
  663.      Typing one of these keys have the same effect as typing it in
  664.      emacs mode. Appropriate command will be executed according as the
  665.      keys you type after it.  You will be in vi mode again after the
  666.      execution of the command. For instance, if you type `ESC <' (in vi
  667.      mode) then the cursor will move to the beginning of the buffer and
  668.      you will still be in vi mode.
  669.  
  670. `C'
  671. `X'
  672.      Typing one of these keys have the effect of typing the
  673.      corresponding control character in emacs mode.  Moreover, if you
  674.      type an upper case character following it, that character will
  675.      also be translated to the corresponding control character.  Thus
  676.      typing `X W' in vi mode is the same as typing `C-x C-w' in emacs
  677.      mode.  You will be in vi mode again after the execution of a
  678.      command.
  679.  
  680. `\'
  681.      Escape to emacs mode.  Hitting the `\' key will take you to emacs
  682.      mode, and you can execute a single Emacs command.  After executing
  683.      the Emacs command you will be in vi mode again.  You can give a
  684.      count before typing `\'.  Thus `5 \ +', as well as `\ C-u 5 +',
  685.      will insert `+++++' before point.
  686.  
  687. 
  688. File: vip,  Node: Buffers and Windows,  Next: Files,  Prev: Important Keys,  Up: Vi Commands
  689.  
  690. Buffers and Windows
  691. ===================
  692.  
  693.    In Emacs the text you edit is stored in a "buffer". See GNU Emacs
  694. Manual, for details.  There is always one "selected" buffer which is
  695. called the "current buffer".
  696.  
  697.    You can see the contents of buffers through "windows" created by
  698. Emacs. When you have multiple windows on the screen only one of them is
  699. selected. Each buffer has a unique name, and each window has a mode
  700. line which shows the name of the buffer associated with the window and
  701. other information about the status of the buffer.  You can change the
  702. format of the mode line, but normally if you see `**' at the beginning
  703. of a mode line it means that the buffer is "modified".  If you write
  704. out the content of the buffer to a file, then the buffer will become
  705. not modified.  Also if you see `%%' at the beginning of the mode line,
  706. it means that the file associated with the buffer is write protected.
  707.  
  708.    We have the following commands related to windows and buffers.
  709.  
  710. `C-n'
  711.      Move cursor to the next-window (`vip-next-window').
  712.  
  713. `X 1'
  714.      Delete other windows and make the selected window fill the screen
  715.      (`delete-other-windows').
  716.  
  717. `X 2'
  718.      Split current window into two windows (`split-window-vertically').
  719.  
  720. `X 3'
  721.      Show current buffer in two windows.
  722.  
  723. `s BUFFER RET'
  724.      Select or create a buffer named BUFFER (`vip-switch-to-buffer').
  725.  
  726. `S BUFFER RET'
  727.      Similar but select a buffer named BUFFER in another window
  728.      (`vip-switch-to-buffer-other-window').
  729.  
  730. `K'
  731.      Kill the current buffer if it is not modified or if it is not
  732.      associated with a file
  733.      (`vip-kill-buffer').
  734.  
  735. `X B'
  736.      List the existing buffers (`list-buffers').
  737.  
  738.    As "buffer name completion" is provided, you have only to type in
  739. initial substring of the buffer name which is sufficient to identify it
  740. among names of existing buffers.  After that, if you hit TAB the rest
  741. of the buffer name will be supplied by the system, and you can confirm
  742. it by RET.  The default buffer name to switch to will also be prompted,
  743. and you can select it by giving a simple RET.  See GNU Emacs Manual for
  744. details of completion.
  745.  
  746. 
  747. File: vip,  Node: Files,  Next: Viewing the Buffer,  Prev: Buffers and Windows,  Up: Vi Commands
  748.  
  749. Files
  750. =====
  751.  
  752.    We have the following commands related to files.  They are used to
  753. visit, save and insert files.
  754.  
  755. `v FILE RET'
  756.      Visit specified file in the current window (`vip-find-file').
  757.  
  758. `V FILE RET'
  759.      Visit specified file in another window
  760.      (`vip-find-file-other-window').
  761.  
  762. `X S'
  763.      Save current buffer to the file associated with the buffer.  If no
  764.      file is associated with the buffer, the name of the file to write
  765.      out the content of the buffer will be asked in the minibuffer.
  766.  
  767. `X W FILE RET'
  768.      Write current buffer into a specified file.
  769.  
  770. `X I FILE RET'
  771.      Insert a specified file at point.
  772.  
  773. `g'
  774.      Give information on the file associated with the current buffer. 
  775.      Tell you the name of the file associated with the buffer, the line
  776.      number of the current point and total line numbers in the buffer. 
  777.      If no file is associated with the buffer, this fact will be
  778.      indicated by the null file name `""'.
  779.  
  780.    In Emacs, you can edit a file by "visiting" it.  If you wish to
  781. visit a file in the current window, you can just type `v'.  Emacs
  782. maintains the "default directory" which is specific to each buffer. 
  783. Suppose, for instance, that the default directory of the current buffer
  784. is `/usr/masahiko/lisp/'.  Then you will get the following prompt in the
  785. minibuffer.
  786.      visit file: /usr/masahiko/lisp/
  787.  
  788. If you wish to visit, say, `vip.el' in this directory, then you can
  789. just type `vip.el' followed by RET.  If the file `vip.el' already
  790. exists in the directory, Emacs will visit that file, and if not, the
  791. file will be created.  Emacs will use the file name (`vip.el', in this
  792. case) as the name of the buffer visiting the file.  In order to make
  793. the buffer name unique, Emacs may append `<2>', `<3>' etc., to the
  794. buffer name.  As the "file name completion" is provided here, you can
  795. sometime save typing.  For instance, suppose there is only one file in
  796. the default directory whose name starts with `v', that is `vip.el'.
  797. Then if you just type `v TAB' then it will be completed to `vip.el'. 
  798. Thus, in this case, you just have to type `v v TAB RET' to visit
  799. `/usr/masahiko/lisp/vip.el'.  Continuing the example, let us now
  800. suppose that you wished to visit the file
  801. `/usr/masahiko/man/vip.texinfo'.  Then to the same prompt which you get
  802. after you typed `v', you can enter `/usr/masahiko/man/vip.texinfo' or
  803. `../man/vip.texinfo' followed by RET.
  804.  
  805.    Use `V' instead of `v', if you wish to visit a file in another
  806. window.
  807.  
  808.    You can verify which file you are editing by typing `g'.  (You can
  809. also type `X B' to get nformation on other buffers too.)  If you type
  810. `g' you will get an information like below in the echo area:
  811.      "/usr/masahiko/man/vip.texinfo" line 921 of 1949
  812.  
  813.    After you edited the buffer (`vip.texinfo', in our example) for a
  814. while, you may wish to save it in a file.  If you wish to save it in
  815. the file associated with the buffer (`/usr/masahiko/man/vip.texinfo',
  816. in this case), you can just say `X S'.  If you wish to save it in
  817. another file, you can type `X W'.  You will then get a similar prompt
  818. as you get for `v', to which you can enter the file name.
  819.  
  820. 
  821. File: vip,  Node: Viewing the Buffer,  Next: Mark Commands,  Prev: Files,  Up: Vi Commands
  822.  
  823. Viewing the Buffer
  824. ==================
  825.  
  826.    In this and next section we discuss commands for moving around in the
  827. buffer.  These command do not change the content of the buffer.  The
  828. following commands are useful for viewing the content of the current
  829. buffer.
  830.  
  831. `SPC'
  832. `C-f'
  833.      Scroll text of current window upward almost full screen.  You can
  834.      go forward in the buffer by this command (`vip-scroll').
  835.  
  836. `RET'
  837. `C-b'
  838.      Scroll text of current window downward almost full screen.  You
  839.      can go backward in the buffer by this command (`vip-scroll-back').
  840.  
  841. `C-d'
  842.      Scroll text of current window upward half screen.  You can go down
  843.      in the buffer by this command (`vip-scroll-down').
  844.  
  845. `C-u'
  846.      Scroll text of current window downward half screen.  You can go up
  847.      in the buffer by this command (`vip-scroll-up').
  848.  
  849. `C-y'
  850.      Scroll text of current window upward by one line
  851.      (`vip-scroll-down-one').
  852.  
  853. `C-e'
  854.      Scroll text of current window downward by one line
  855.      (`vip-scroll-up-one').
  856.  
  857. You can repeat these commands by giving a count.  Thus, `2 SPC' has the
  858. same effect as `SPC SPC'.
  859.  
  860.    The following commands reposition point in the window.
  861.  
  862. `z H'
  863. `z RET'
  864.      Put point on the top (home) line in the window.  So the current
  865.      line becomes the top line in the window.  Given a count N, point
  866.      will be placed in the N-th line from top (`vip-line-to-top').
  867.  
  868. `z M'
  869. `z .'
  870.      Put point on the middle line in the window.  Given a count N,
  871.      point will be placed in the N-th line from the middle line
  872.      (`vip-line-to-middle').
  873.  
  874. `z L'
  875. `z -'
  876.      Put point on the bottom line in the window.  Given a count N,
  877.      point will be placed in the N-th line from bottom
  878.      (`vip-line-to-bottom').
  879.  
  880. `C-l'
  881.      Center point in window and redisplay screen (`recenter').
  882.  
  883. 
  884. File: vip,  Node: Mark Commands,  Next: Motion Commands,  Prev: Viewing the Buffer,  Up: Vi Commands
  885.  
  886. Mark Commands
  887. =============
  888.  
  889.    The following commands are used to mark positions in the buffer.
  890.  
  891. `m CH'
  892.      Store current point in the register CH.  CH must be a lower case
  893.      character between `a' and `z'.
  894.  
  895. `m <'
  896.      Set mark at the beginning of current buffer.
  897.  
  898. `m >'
  899.      Set mark at the end of current buffer.
  900.  
  901. `m .'
  902.      Set mark at point.
  903.  
  904. `m ,'
  905.      Jump to mark (and pop mark off the mark ring).
  906.  
  907.    Emacs uses the "mark ring" to store marked positions.  The commands
  908. `m <', `m >' and `m .' not only set mark but also add it as the latest
  909. element of the mark ring (replacing the oldest one).  By repeating the
  910. command ``m ,'' you can visit older and older marked positions.  You
  911. will eventually be in a loop as the mark ring is a ring.
  912.  
  913. 
  914. File: vip,  Node: Motion Commands,  Next: Searching and Replacing,  Prev: Mark Commands,  Up: Vi Commands
  915.  
  916. Motion Commands
  917. ===============
  918.  
  919.    Commands for moving around in the current buffer are collected here.
  920.  These commands are used as an `argument' for the delete, change and
  921. yank commands to be described in the next section.
  922.  
  923. `h'
  924.      Move point backward by one character.  Signal error if point is at
  925.      the beginning of buffer, but (unlike Vi) do not complain otherwise
  926.      (`vip-backward-char').
  927.  
  928. `l'
  929.      Move point backward by one character.  Signal error if point is at
  930.      the end of buffer, but (unlike Vi) do not complain otherwise
  931.      (`vip-forward-char').
  932.  
  933. `j'
  934.      Move point to the next line keeping the current column.  If point
  935.      is on the last line of the buffer, a new line will be created and
  936.      point will move to that line (`vip-next-line').
  937.  
  938. `k'
  939.      Move point to the previous line keeping the current column
  940.      (`vip-next-line').
  941.  
  942. `+'
  943.      Move point to the next line at the first non-white character.  If
  944.      point is on the last line of the buffer, a new line will be
  945.      created and point will move to the beginning of that line
  946.      (`vip-next-line-at-bol').
  947.  
  948. `-'
  949.      Move point to the previous line at the first non-white character
  950.      (`vip-previous-line-at-bol').
  951.  
  952. If a count is given to these commands, the commands will be repeated
  953. that many times.
  954.  
  955. `0'
  956.      Move point to the beginning of line (`vip-beginning-of-line').
  957.  
  958. `^'
  959.      Move point to the first non-white character on the line
  960.      (`vip-bol-and-skip-white').
  961.  
  962. `$'
  963.      Move point to the end of line (`vip-goto-eol').
  964.  
  965. `N |'
  966.      Move point to the N-th column on the line (`vip-goto-col').
  967.  
  968. Except for the `|' command, these commands neglect a count.
  969.  
  970. `w'
  971.      Move point forward to the beginning of the next word
  972.      (`vip-forward-word').
  973.  
  974. `W'
  975.      Move point forward to the beginning of the next word, where a
  976.      "word" is considered as a sequence of non-white characters
  977.      (`vip-forward-Word').
  978.  
  979. `b'
  980.      Move point backward to the beginning of a word
  981.      (`vip-backward-word').
  982.  
  983. `B'
  984.      Move point backward to the beginning of a word, where a word is
  985.      considered as a sequence of non-white characters
  986.      (`vip-forward-Word').
  987.  
  988. `e'
  989.      Move point forward to the end of a word (`vip-end-of-word').
  990.  
  991. `E'
  992.      Move point forward to the end of a word, where a word is
  993.      considered as a sequence of non-white characters
  994.      (`vip-end-of-Word').
  995.  
  996. Here the meaning of the word `word' for the `w', `b' and `e' commands
  997. is determined by the "syntax table" effective in the current buffer. 
  998. Each major mode has its syntax mode, and therefore the meaning of a
  999. word also changes as the major mode changes.  See GNU Emacs Manual for
  1000. details of syntax table.
  1001.  
  1002. `H'
  1003.      Move point to the beginning of the home (top) line of the window.
  1004.      Given a count N, go to the N-th line from top (`vip-window-top').
  1005.  
  1006. `M'
  1007.      Move point to the beginning of the middle line of the window. 
  1008.      Given a count N, go to the N-th line from the middle line
  1009.      (`vip-window-middle').
  1010.  
  1011. `L'
  1012.      Move point to the beginning of the lowest (bottom) line of the
  1013.      window.  Given count, go to the N-th line from bottom
  1014.      (`vip-window-bottom').
  1015.  
  1016. These commands can be used to go to the desired line visible on the
  1017. screen.
  1018.  
  1019. `('
  1020.      Move point backward to the beginning of the sentence
  1021.      (`vip-backward-sentence').
  1022.  
  1023. `)'
  1024.      Move point forward to the end of the sentence
  1025.      (`vip-forward-sentence').
  1026.  
  1027. `{'
  1028.      Move point backward to the beginning of the paragraph
  1029.      (`vip-backward-paragraph').
  1030.  
  1031. `}'
  1032.      Move point forward to the end of the paragraph
  1033.      (`vip-forward-paragraph').
  1034.  
  1035. A count repeats the effect for these commands.
  1036.  
  1037. `G'
  1038.      Given a count N, move point to the N-th line in the buffer on the
  1039.      first non-white character.  Without a count, go to the end of the
  1040.      buffer (`vip-goto-line').
  1041.  
  1042. `` `'
  1043.      Exchange point and mark (`vip-goto-mark').
  1044.  
  1045. `` CH'
  1046.      Move point to the position stored in the register CH.  CH must be
  1047.      a lower case letter.
  1048.  
  1049. `' ''
  1050.      Exchange point and mark, and then move point to the first non-white
  1051.      character on the line (`vip-goto-mark-and-skip-white').
  1052.  
  1053. `' CH'
  1054.      Move point to the position stored in the register CH and skip to
  1055.      the first non-white character on the line.  CH must be a lower
  1056.      case letter.
  1057.  
  1058. `%'
  1059.      Move point to the matching parenthesis if point is looking at `(',
  1060.      `)', `{', `}', `[' or `]'
  1061.      (`vip-paren-match').
  1062.  
  1063. The command `G' mark point before move, so that you can return to the
  1064. original point by `` `'.  The original point will also be stored in the
  1065. mark ring.
  1066.  
  1067.    The following commands are useful for moving points on the line.  A
  1068. count will repeat the effect.
  1069.  
  1070. `f CH'
  1071.      Move point forward to the character CH on the line.  Signal error
  1072.      if CH could not be found (`vip-find-char-forward').
  1073.  
  1074. `F CH'
  1075.      Move point backward to the character CH on the line.  Signal error
  1076.      if CH could not be found (`vip-find-char-backward').
  1077.  
  1078. `t CH'
  1079.      Move point forward upto the character CH on the line.  Signal
  1080.      error if CH could not be found (`vip-goto-char-forward').
  1081.  
  1082. `T CH'
  1083.      Move point backward upto the character CH on the line.  Signal
  1084.      error if CH could not be found (`vip-goto-char-backward').
  1085.  
  1086. `;'
  1087.      Repeat previous `f', `t', `F' or `T' command (`vip-repeat-find').
  1088.  
  1089. `,'
  1090.      Repeat previous `f', `t', `F' or `T' command, in the opposite
  1091.      direction (`vip-repeat-find-opposite').
  1092.  
  1093. 
  1094. File: vip,  Node: Searching and Replacing,  Next: Modifying Commands,  Prev: Motion Commands,  Up: Vi Commands
  1095.  
  1096. Searching and Replacing
  1097. =======================
  1098.  
  1099.    Following commands are available for searching and replacing.
  1100.  
  1101. `/ STRING RET'
  1102.      Search the first occurrence of the string STRING forward starting
  1103.      from point.  Given a count N, the N-th occurrence of STRING will
  1104.      be searched.  If the variable `vip-re-search' has value `t' then
  1105.      "regular expression" search is done and the string matching the
  1106.      regular expression STRING is found.  If you give an empty string
  1107.      as STRING then the search mode will change from vanilla search to
  1108.      regular expression search and vice versa (`vip-search-forward').
  1109.  
  1110. `? STRING RET'
  1111.      Same as `/', except that search is done backward
  1112.      (`vip-search-backward').
  1113.  
  1114. `n'
  1115.      Search the previous search pattern in the same direction as before
  1116.      (`vip-search-next').
  1117.  
  1118. `N'
  1119.      Search the previous search pattern in the opposite direction
  1120.      (`vip-search-Next').
  1121.  
  1122. `C-s'
  1123.      Search forward incrementally.  See GNU Emacs Manual for details
  1124.      (`isearch-forward').
  1125.  
  1126. `C-r'
  1127.      Search backward incrementally (`isearch-backward').
  1128.  
  1129. `R STRING RET NEWSTRING'
  1130.      There are two modes of replacement, "vanilla" and "regular
  1131.      expression". If the mode is vanilla you will get a prompt `Replace
  1132.      string:', and if the mode is regular expression you will ge a
  1133.      prompt `Replace regexp:'.  The mode is initially vanilla, but you
  1134.      can toggle these modes by giving a null string as STRING.  If the
  1135.      mode is vanilla, this command replaces every occurrence of STRING
  1136.      with NEWSTRING.  If the mode is regular expression, STRING is
  1137.      treated as a regular expression and every string matching the
  1138.      regular expression is replaced with NEWSTRING
  1139.      (`vip-replace-string').
  1140.  
  1141. `Q    STRING RET NEWSTRING'
  1142.      Same as `R' except that you will be asked form confirmation before
  1143.      each replacement
  1144.      (`vip-query-replace').
  1145.  
  1146. `r CH'
  1147.      Replace the character point is looking at by the character CH. 
  1148.      Give count, replace that many characters by CH
  1149.      (`vip-replace-char').
  1150.  
  1151. The commands `/' and `?' mark point before move, so that you can return
  1152. to the original point by `` `'.
  1153.  
  1154. 
  1155. File: vip,  Node: Modifying Commands,  Next: Delete Commands,  Prev: Searching and Replacing,  Up: Vi Commands
  1156.  
  1157. Modifying Commands
  1158. ==================
  1159.  
  1160.    In this section, commands for modifying the content of a buffer are
  1161. described.  These commands affect the region determined by a motion
  1162. command which is given to the commands as their argument.
  1163.  
  1164.    We classify motion commands into "point commands" and "line
  1165. commands".  The point commands are as follows:
  1166.      `h', `l', `0', `^', `$', `w', `W', `b', `B', `e', `E', `(', `)', `/', `?', ``', `f', `F', `t', `T', `%', `;', `,'
  1167.  
  1168. The line commands are as follows:
  1169.      `j', `k', `+', `-', `H', `M', `L', `{', `}', `G', `''
  1170.  
  1171. If a point command is given as an argument to a modifying command, the
  1172. region determined by the point command will be affected by the modifying
  1173. command. On the other hand, if a line command is given as an argument
  1174. to a modifying command, the region determined by the line command will
  1175. be enlarged so that it will become the smallest region properly
  1176. containing the region and consisting of whole lines (we call this
  1177. process "expanding the region"), and then the enlarged region will be
  1178. affected by the modifying command.
  1179.  
  1180. * Menu:
  1181.  
  1182. * Delete Commands::    Commands for deleting text.
  1183. * Yank Commands::    Commands for yanking text in Vi's sense.
  1184. * Put Back Commands::    Commands for putting bake deleted/yanked text.
  1185. * Change Commands::    Commands for changing text.
  1186.  
  1187. 
  1188. File: vip,  Node: Delete Commands,  Next: Yank Commands,  Prev: Modifying Commands,  Up: Modifying Commands
  1189.  
  1190. Delete Commands
  1191. ---------------
  1192.  
  1193. `d MOTION-COMMAND'
  1194.      Delete the region determined by the motion command MOTION-COMMAND.
  1195.  
  1196. For example, `d $' will delete the region between point and end of
  1197. current line since `$' is a point command that moves point to end of
  1198. line. `d G' will delete the region between the beginning of current
  1199. line and end of the buffer, since `G' is a line command.  A count given
  1200. to the command above will become the count for the associated motion
  1201. command. Thus, `3 d w' will delete three words.
  1202.  
  1203.    It is also possible to save the deleted text into a register you
  1204. specify. For example, you can say `" t 3 d w' to delete three words and
  1205. save it to register `t'.  The name of a register is a lower case letter
  1206. between `a' and `z'.  If you give an upper case letter as an argument to
  1207. a delete command, then the deleted text will be appended to the content
  1208. of the register having the corresponding lower case letter as its name.
  1209.  So, `" T d w' will delete a word and append it to register `t'.  Other
  1210. modifying commands also accept a register name as their argument, and we
  1211. will not repeat similar explanations.
  1212.  
  1213.    We have more delete commands as below.
  1214.  
  1215. `d d'
  1216.      Delete a line.  Given a count N, delete N lines.
  1217.  
  1218. `d r'
  1219.      Delete current region.
  1220.  
  1221. `d R'
  1222.      Expand current region and delete it.
  1223.  
  1224. `D'
  1225.      Delete to the end of a line (`vip-kill-line').
  1226.  
  1227. `x'
  1228.      Delete a character after point.  Given N, delete N characters
  1229.      (`vip-delete-char').
  1230.  
  1231. `DEL'
  1232.      Delete a character before point.  Given N, delete N characters
  1233.      (`vip-delete-backward-char').
  1234.  
  1235. 
  1236. File: vip,  Node: Yank Commands,  Next: Put Back Commands,  Prev: Delete Commands,  Up: Modifying Commands
  1237.  
  1238. Yank Commands
  1239. -------------
  1240.  
  1241.    Yank commands "yank" a text of buffer into a (usually anonymous)
  1242. register. Here the word `yank' is used in Vi's sense.  Thus yank
  1243. commands do not alter the content of the buffer, and useful only in
  1244. combination with commands that put back the yanked text into the buffer.
  1245.  
  1246. `y MOTION-COMMAND'
  1247.      Yank the region determined by the motion command MOTION-COMMAND.
  1248.  
  1249. For example, `y $' will yank the text between point and the end of line
  1250. into an anonymous register, while `"c y $' will yank the same text into
  1251. register `c'.
  1252.  
  1253.    Use the following command to yank consecutive lines of text.
  1254.  
  1255. `y y'
  1256. `Y'
  1257.      Yank a line.  Given N, yank N lines (`vip-yank-line').
  1258.  
  1259. `y r'
  1260.      Yank current region.
  1261.  
  1262. `y R'
  1263.      Expand current region and yank it.
  1264.  
  1265. 
  1266. File: vip,  Node: Put Back Commands,  Next: Change Commands,  Prev: Yank Commands,  Up: Modifying Commands
  1267.  
  1268. Put Back Commands
  1269. -----------------
  1270.  
  1271.    Deleted or yanked texts can be put back into the buffer by the
  1272. command below.
  1273.  
  1274. `p'
  1275.      Insert, after the character point is looking at, most recently
  1276.      deleted/yanked text from anonymous register. Given a register name
  1277.      argument, the content of the named register will be put back. 
  1278.      Given a count, the command will be repeated that many times. This
  1279.      command also checks if the text to put back ends with a new line
  1280.      character, and if so the text will be put below the current line
  1281.      (`vip-put-back').
  1282.  
  1283. `P'
  1284.      Insert at point most recently deleted/yanked text from anonymous
  1285.      register. Given a register name argument, the content of the named
  1286.      register will be put back.  Given a count, the command will be
  1287.      repeated that many times. This command also checks if the text to
  1288.      put back ends with a new line character, and if so the text will
  1289.      be put above the current line rather than at point
  1290.      (`vip-Put-back').
  1291.  
  1292. Thus, `" c p' will put back the content of the register `c' into the
  1293. buffer.  It is also possible to specify "number register" which is a
  1294. numeral between `1' and `9'.  If the number register N is specified,
  1295. N-th previously deleted/yanked text will be put back.  It is an error
  1296. to specify a number register for the delete/yank commands.
  1297.  
  1298. 
  1299. File: vip,  Node: Change Commands,  Next: Repeating and Undoing Modifications,  Prev: Put Back Commands,  Up: Modifying Commands
  1300.  
  1301. Change Commands
  1302. ---------------
  1303.  
  1304.    Most commonly used change command takes the following form.
  1305.  
  1306. `c MOTION-COMMAND'
  1307.      Replace the content of the region determined by the motion command
  1308.      MOTION-COMMAND by the text you type.  If the motion command is a
  1309.      point command then you will type the text into minibuffer, and if
  1310.      the motion command is a line command then the region will be
  1311.      deleted first and you can insert the text in INSERT MODE.
  1312.  
  1313. For example, if point is at the beginning of a word `foo' and you wish
  1314. to change it to `bar', you can type `c w'.  Then, as `w' is a point
  1315. command, you will get the prompt `foo =>' in the minibuffer, for which
  1316. you can type `b a r RET' to complete the change command.
  1317.  
  1318. `c c'
  1319.      Change a line.  Given a count, that many lines are changed.
  1320.  
  1321. `c r'
  1322.      Change current region.
  1323.  
  1324. `c R'
  1325.      Expand current region and change it.
  1326.  
  1327. 
  1328. File: vip,  Node: Repeating and Undoing Modifications,  Next: Other Vi Commands,  Prev: Change Commands,  Up: Modifying Commands
  1329.  
  1330. Repeating and Undoing Modifications
  1331. -----------------------------------
  1332.  
  1333.    VIP records the previous modifying command, so that it is easy to
  1334. repeat it.  It is also very easy to undo changes made by modifying
  1335. commands.
  1336.  
  1337. `u'
  1338.      Undo the last change.  You can undo more by repeating undo by the
  1339.      repeat command `.'.  For example, you can undo 5 previous changes
  1340.      by typing `u....'.  If you type `uu', then the second `u' undoes
  1341.      the first undo command (`vip-undo').
  1342.  
  1343. `.'
  1344.      Repeat the last modifying command.  Given count N it becomes the
  1345.      new count for the repeated command.  Otherwise, the count for the
  1346.      last modifying command is used again (`vip-repeat').
  1347.  
  1348. 
  1349. File: vip,  Node: Other Vi Commands,  Next: Commands in Insert Mode,  Prev: Repeating and Undoing Modifications,  Up: Vi Commands
  1350.  
  1351. Other Vi Commands
  1352. =================
  1353.  
  1354.    Miscellaneous Vi commands are collected here.
  1355.  
  1356. `Z Z'
  1357.      Exit Emacs.  If modified buffers exist, you will be asked whether
  1358.      you wish to save them or not (`save-buffers-kill-emacs').
  1359.  
  1360. `! MOTION-COMMAND FORMAT-COMMAND'
  1361. `N ! ! FORMAT-COMMAND'
  1362.      The region determined by the motion command MOTION-COMMAND will be
  1363.      given to the shell command FORMAT-COMMAND and the region will be
  1364.      replaced by its output.  If a count is given, it will be passed to
  1365.      MOTION-COMMAND.  For example, `3!Gsort' will sort the region
  1366.      between point and the 3rd line.  If `!' is used instead of
  1367.      MOTION-COMMAND then N lines will be processed by FORMAT-COMMAND
  1368.      (`vip-command-argument').
  1369.  
  1370. `J'
  1371.      Join two lines.  Given count, join that many lines.  A space will
  1372.      be inserted at each junction (`vip-join-lines').
  1373.  
  1374. `< MOTION-COMMAND'
  1375. `N < <'
  1376.      Shift region determined by the motion command MOTION-COMMAND to
  1377.      left by SHIFT-WIDTH (default is 8).  If `<' is used instead of
  1378.      MOTION-COMMAND then shift N lines
  1379.      (`vip-command-argument').
  1380.  
  1381. `> MOTION-COMMAND'
  1382. `N > >'
  1383.      Shift region determined by the motion command MOTION-COMMAND to
  1384.      right by SHIFT-WIDTH (default is 8).  If `<' is used instead of
  1385.      MOTION-COMMAND then shift N lines
  1386.      (`vip-command-argument').
  1387.  
  1388. `= MOTION-COMMAND'
  1389.      Indent region determined by the motion command MOTION-COMMAND.  If
  1390.      `=' is used instead of MOTION-COMMAND then indent N lines
  1391.      (`vip-command-argument').
  1392.  
  1393. `*'
  1394.      Call last remembered keyboard macro.
  1395.  
  1396. `#'
  1397.      A new vi operator. *Note New Commands::, for more details.
  1398.  
  1399.    The following keys are reserved for future extensions, and currently
  1400. assigned to a function that just beeps (`vip-nil').
  1401.  
  1402.      &, @, U, [, ], _, q, ~
  1403.  
  1404.    VIP uses a special local keymap to interpret key strokes you enter
  1405. in vi mode.  The following keys are bound to NIL in the keymap. 
  1406. Therefore, these keys are interpreted by the global keymap of Emacs. 
  1407. We give below a short description of the functions bound to these keys
  1408. in the global keymap.  See GNU Emacs Manual for details.
  1409.  
  1410. `C-@'
  1411.      Set mark and push previous mark on mark ring (`set-mark-command').
  1412.  
  1413. `TAB'
  1414.      Indent line for current major mode (`indent-for-tab-command').
  1415.  
  1416. `LFD'
  1417.      Insert a newline, then indent according to mode
  1418.      (`newline-and-indent').
  1419.  
  1420. `C-k'
  1421.      Kill the rest of the current line; before a newline, kill the
  1422.      newline. With prefix argument, kill that many lines from point. 
  1423.      Negative arguments kill lines backward (`kill-line').
  1424.  
  1425. `C-l'
  1426.      Clear the screen and reprint everything (`recenter').
  1427.  
  1428. `N C-p'
  1429.      Move cursor vertically up N lines (`previous-line').
  1430.  
  1431. `C-q'
  1432.      Read next input character and insert it.  Useful for inserting
  1433.      control characters
  1434.      (`quoted-insert').
  1435.  
  1436. `C-r'
  1437.      Search backward incrementally (`isearch-backward').
  1438.  
  1439. `C-s'
  1440.      Search forward incrementally (`isearch-forward').
  1441.  
  1442. `N C-t'
  1443.      Interchange charcters around point, moving forward one character. 
  1444.      With count N, take character before point and drag it forward past
  1445.      N other characters.  If no argument and at end of line, the
  1446.      previous two characters are exchanged (`transpose-chars').
  1447.  
  1448. `N C-v'
  1449.      Scroll text upward N lines.  If N is not given, scroll near full
  1450.      screen (`scroll-up').
  1451.  
  1452. `C-w'
  1453.      Kill between point and mark.  The text is save in the kill ring. 
  1454.      The command `P' or `p' can retrieve it from kill ring
  1455.      (`kill-region').
  1456.  
  1457.