home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vim53os2.zip / vim-5.3 / doc / intro.txt < prev    next >
Text File  |  1998-08-30  |  28KB  |  638 lines

  1. *intro.txt*     For Vim version 5.3.  Last modification: 1998 Aug 18
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Bram Moolenaar
  5.  
  6.  
  7. Introduction to Vim                    *ref* *reference*
  8.  
  9. 1. Introduction            |intro|
  10. 2. Vim on the internet        |internet|
  11. 3. Credits            |credits|
  12. 4. Notation            |notation|
  13. 5. Modes, introduction        |vim-modes-intro|
  14. 6. Switching from mode to mode    |mode-switching|
  15. 7. The window contents        |window-contents|
  16.  
  17. ==============================================================================
  18. 1. Introduction                        *intro*
  19.  
  20. Vim stands for Vi IMproved.  It used to be Vi IMitation, but there are so many
  21. improvements that a name change was appropriate.  Vim is a text editor which
  22. includes almost all the commands from the Unix program "Vi" and a lot of new
  23. ones.  It is very useful for editing programs and other 8-bit ASCII text.  All
  24. commands are given with the keyboard.  This has the advantage that you can
  25. keep your fingers on the keyboard and your eyes on the screen.  For those who
  26. want it, there is mouse support and a GUI version with scrollbars and menus
  27. (see |gui.txt|).
  28.  
  29. Throughout this manual the differences between Vi and Vim are mentioned in
  30. curly braces.  See |vi_diff.txt| for a summary of the differences.
  31.  
  32. This manual refers to Vim on various machines.  There may be small differences
  33. between different computers and terminals.  Besides the remarks given in this
  34. document, there is a separate document for each supported system, see
  35. |sys-file-list|.
  36.  
  37. This manual is a reference for all the Vim commands and options.  This is not
  38. an introduction to the use of Vim.  There are many books on Vi that contain a
  39. section for beginners.  I can recommend "Learning the Vi editor", by Linda
  40. Lamb, published by O'Reilly.  But, that book is for Vi, not for Vim.
  41.  
  42. A summary of this manual can be found in the file "help.txt",
  43. |help.txt|.  It can be accessed from within Vim with the <Help> or <F1>
  44. key and with the command ":help", |:help|.  The 'helpfile' option can be set
  45. to the name of the help file, so you can put it in any place you like.
  46.  
  47. ==============================================================================
  48. 2. Vim on the internet                    *internet*
  49.  
  50.             *www* *faq* *FAQ* *ftp* *distribution* *download*
  51. The Vim pages contain the most recent information about Vim.  They also
  52. contain links to the most recent version of Vim.  The FAQ is a list of
  53. Frequently Asked Questions.  Read this if you have problems.
  54.  
  55.     VIM home page:    <URL:http://www.vim.org/>
  56.     VIM FAQ:    <URL:http://www.vim.org/faq/>
  57.  
  58.  
  59. Usenet News group where Vim is discussed:        *news* *usenet*
  60.     comp.editors
  61. See <URL:http://www.vim.org/news.html>.
  62.  
  63.                             *vimdev* *mail-list*
  64. There are three mailing lists for Vim:
  65. <vim@vim.org>
  66.     For discussions about using existing versions of Vim: Useful mappings,
  67.     questions, answers, where to get a specific version, etc.
  68. <vim-dev@vim.org>
  69.     For discussions about changing Vim: New features, porting, beta-test
  70.     versions, etc.
  71. <vim-announce@vim.org>
  72.     Announcements about new versions of Vim; also beta-test versions and
  73.     ports to different systems.
  74.  
  75. See <URL:http://www.vim.org/mail.html>.
  76.  
  77. NOTE:
  78. - You can only send messages to these lists if you have subscribed!
  79. - You need to send the messages from the same location as where you subscribed
  80.   from (to avoid spam mails).
  81. - Maximum message size is 40000 characters.
  82.  
  83. If you want to join, send a message to
  84.     <vim-help@vim.org>
  85. Make sure that your "From:" address is correct.  Then the list server will
  86. give you help on how to subscribe.
  87.  
  88. You can retrieve old messages from the maillist software, and an index of
  89. messages.  Ask vim-help for instructions.
  90.  
  91. An archive is kept at:
  92. <URL:ftp://ftp.ii.uib.no/pub/vim/mail-archive/vim/maillist.html>
  93. <URL:ftp://ftp.ii.uib.no/pub/vim/mail-archive/vimdev/maillist.html>
  94. <URL:ftp://ftp.ii.uib.no/pub/vim/mail-archive/vimannounce/maillist.html>
  95. [Note: it doesn't work anymore]
  96.  
  97. This was announced, but I don't think it works:
  98. <URL:http://www.findmail.com/listsaver/vimannounce.html>
  99.  
  100.  
  101. Bug reports:                *bugs* *bug-reports* *bugreport.vim*
  102.     Bram Moolenaar <Bram@vim.org>
  103. Please be brief; all the time that is spend on answering mail is subtracted
  104. from the time that is spent on improving Vim!  Always give a reproduceable
  105. example and try to find out which settings or other things influence the
  106. appearance of the bug.  Try different machines, if possible.  Send me patches
  107. if you can!
  108.  
  109. In case of doubt, use:
  110. >  :so $VIM/bugreport.vim
  111. This will create a file "bugreport.txt" in the current directory, with a lot
  112. of information of your environment.  Before sending this out, check if it
  113. doesn't contain any confidential information!
  114.  
  115. When Vim crashes in one of the test files, and you are using gcc for
  116. compilation, here is what you can do to find out exactly where Vim crashes:
  117.  
  118. 1. Compile Vim with the "-g" option (there is a line in the Makefile for this,
  119.    which you can uncomment).
  120.  
  121. 2. Execute these commands (replace "11" with the test that fails):
  122. >    cd testdir
  123. >    gdb ../vim
  124. >    run -u NONE -s dotest.in test11.in
  125.  
  126. 3. Check where Vim crashes, gdb should give a message for this.
  127.  
  128. 4. Get a stack trace from gdb with this command:
  129. >    where
  130.  
  131.                             *year-2000*
  132. Since Vim internally doesn't use dates, there is no year 2000 problem.
  133. There might be a year 2038 problem, when the seconds since January 1st 1970
  134. don't fit in a 32 bit int anymore.  This depends on the compiler, libraries
  135. and operating system.  Specifically, time_t and the ctime() function are used.
  136. And the time_t is stored in four bytes in the swap file.  But that's only used
  137. for printing a file date/time for recovery.
  138.  
  139. The Vim strftime() function directly uses the strftime() system function.  If
  140. your system libraries are year 2000 compliant, Vim is too.
  141.  
  142. ==============================================================================
  143. 3. Credits                        *credits* *author*
  144.  
  145. Most of Vim was written by Bram Moolenaar <Bram@vim.org>.
  146.  
  147. Parts of the documentation come from several Vi manuals, written by:
  148.     W.N. Joy
  149.     Alan P.W. Hewett
  150.     Mark Horton
  151.  
  152. The Vim editor is based on Stevie and includes (ideas from) other software,
  153. worked on by the people mentioned here.  Other people helped by sending me
  154. patches, suggestions and giving feedback about what is good and bad in Vim.
  155.  
  156. Vim would never have become what it is now, without the help of these people!
  157.  
  158.     Ron Aaron        Win32 GUI changes
  159.     Dany St-Amant        Macintosh port
  160.     Tony Andrews        Stevie
  161.     Gert van Antwerpen    changes for DJGPP on MS-DOS
  162.     Berkeley DB(3)        ideas for swap file implementation
  163.     Keith Bostic        Nvi
  164.     Ralf Brown        SPAWNO library for MS-DOS
  165.     Robert Colon        many useful remarks
  166.     Kayhan Demirel        sent me news in Uganda
  167.     Chris & John Downey    xvi (ideas for multi-windows version)
  168.     Henk Elbers        first VMS port
  169.     Eric Fischer        Mac port, 'cindent', and other improvements
  170.     Bill Foster        Athena GUI port
  171.     Loic Grenie        xvim (ideas for multi windows version)
  172.     Sven Guckes        Vim WWW page maintainer
  173.     Darren Hiebert        Exuberant ctags
  174.     Bruce Hunsaker        improvements for VMS port
  175.     Andy Kahn        Cscope support
  176.     Steve Kirkendall    Elvis
  177.     Sergey Laskavy        Vim's help from Moscow
  178.     Felix von Leitner    Maintainer of Vim Mailing Lists
  179.     David Leonard        Port of Python extensions to Unix
  180.     Avner Lottem        Edit in right-to-left windows
  181.     Paul Moore        Python interface extensions
  182.     Vince Negri        Many Win32 GUI enhancements
  183.     George V. Reilly    Win32 port, Win32 GUI start-off
  184.     Stephen Riehm        bug collector
  185.     Olaf Seibert        DICE and BeBox version, regexp improvements
  186.     Mortaza Shiran        Farsi patches
  187.     Peter da Silva        termlib
  188.     Paul Slootman        OS/2 port
  189.     Henry Spencer        regular expressions
  190.     Tim Thompson        Stevie
  191.     G. R. (Fred) Walter    Stevie
  192.     Sven Verdoolaege    Perl interface
  193.     Robert Webb        Command-line completion, GUI versions, and
  194.                 lots of patches
  195.     Ingo Wilken        Tcl interface
  196.     Juergen Weigert        Lattice version, AUX improvements, UNIX and
  197.                 MS-DOS ports, autoconf
  198.     Stefan 'Sec' Zehl    Maintainer of vim.org
  199.  
  200. I wish to thank all the people that sent me bug reports and suggestions.  The
  201. list is too long to mention them all here.  Vim would not be the same without
  202. the ideas from all these people: They keep Vim alive!
  203.  
  204. ==============================================================================
  205. 4. Notation                        *notation*
  206.  
  207. []        Characters in square brackets are optional.
  208.  
  209.                             *count* *[count]*
  210. [count]        An optional number that may precede the command to multiply
  211.         or iterate the command.  If no number is given, a count of one
  212.         is used, unless otherwise noted.  Note that in this manual the
  213.         [count] is not mentioned in the description of the command,
  214.         but only in the explanation.  This was done to make the
  215.         commands easier to look up.  If the 'showcmd' option is on,
  216.         the (partially) entered count is shown at the bottom of the
  217.         window.  You can use <Del> to erase the last digit (|N<Del>|).
  218.  
  219.                             *[quotex]*
  220. ["x]        An optional register designation where text can be stored.
  221.         See |registers|.  The x is a single character between 'a' and
  222.         'z' or 'A' and 'Z' or '"', and in some cases (with the put
  223.         command) between '0' and '9', '%', '#', ':' or '.'. The
  224.         uppercase and lower case letter designate the same register,
  225.         but the lower case letter is used to overwrite the previous
  226.         register contents, while the uppercase letter is used to
  227.         append to the previous register contents. Without the ""x" or
  228.         with """" the stored text is put into the unnamed register.
  229.  
  230.                             *{}*
  231. {}        Curly braces denote parts of the command which must appear,
  232.         but which can take a number of different values.  The
  233.         differences between Vim and Vi are also given in curly braces
  234.         (this will be clear from the context).
  235.  
  236.                             *{motion}*
  237. {motion}    A command that moves the cursor.  See the list at
  238.         |motion.txt|.  This is used after an operator command
  239.         |operator| to move over the text that is to be operated upon.
  240.         If the motion includes a count and the operator also had a
  241.         count, the two counts are multiplied.  For example: "2d3w"
  242.         deletes six words.  The motion can also be a mouse click.  The
  243.         mouse is currently only supported for MS-DOS, Win32 and xterm
  244.         under Unix.  The ":omap" command can be used to map characters
  245.         while an operator is pending.
  246.  
  247.                             *{Visual}*
  248. {Visual}    A piece of text that is started with the "v", "V", or CTRL-V
  249.         command and ended by the cursor position.  This is used
  250.         before an operator command |operator| to highlight the text
  251.         that is to be operated upon.  See |Visual-mode|.
  252.  
  253.                             *<character>*
  254. <character>    A special character from the table below or a single ASCII
  255.         character.
  256.  
  257.                             *'character'*
  258. 'character'    A single ASCII character.
  259.  
  260.                             *<char1-char2>*
  261. <char1-char2>    A single character from the range <char1> to <char2>.  For
  262.         example: <a-z> is a lowercase letter.  Multiple ranges may be
  263.         concatenated.  For example, <a-zA-Z0-9> is any alphanumeric
  264.         character.
  265.  
  266.                             *CTRL-{char}*
  267. CTRL-{char}    {char} typed as a control character; that is, typing {char}
  268.         while holding the CTRL key down.  The case of {char} does not
  269.         matter; thus CTRL-A and CTRL-a are equivalent.  But on some
  270.         terminals, using the SHIFT key will produce another code,
  271.         don't use it then.
  272.  
  273.                             *'option'*
  274. 'option'    An option, or parameter, that can be set to a value, is
  275.         enclosed in single quotes.  See |options|.
  276.  
  277.                             *quotecommandquote*
  278. "command"    In examples, the commands you can type are enclosed in double
  279.         quotes.
  280.  
  281.                     *key-notation* *key-codes* *keycodes*
  282. These names for keys are used in the documentation.  They can also be used
  283. with the ":map" command.
  284.  
  285. notation    meaning            equivalent    decimal value(s)    ~
  286. -----------------------------------------------------------------------
  287. <Nul>        zero            CTRL-@      0 (stored as 10) *<Nul>*
  288. <BS>        backspace        CTRL-H      8    *backspace*
  289. <Tab>        tab            CTRL-I      9    *tab*
  290.                             *linefeed*
  291. <NL>        linefeed        CTRL-J     10 (used for <Nul>)
  292. <FF>        formfeed        CTRL-L     12    *formfeed*
  293. <CR>        carriage return        CTRL-M     13    *carriage-return*
  294. <Enter>        same as <CR>                *<Enter>*
  295. <Esc>        escape            CTRL-[     27    *escape* *<Esc>*
  296. <Space>        space                 32    *space*
  297. <lt>        less-then        <     60    *<lt>*
  298. <Bslash>    backslash        \     92    *backslash* *<Bslash>*
  299. <Bar>        vertical bar        |    124    *<Bar>*
  300. <Del>        delete                127
  301.  
  302. <EOL>        end-of-line (can be <CR>, <LF> or <CR><LF>,
  303.         depends on system and 'fileformat')    *<EOL>*
  304.  
  305. <Up>        cursor-up            *cursor-up* *cursor_up*
  306. <Down>        cursor-down            *cursor-down* *cursor_down*
  307. <Left>        cursor-left            *cursor-left* *cursor_left*
  308. <Right>        cursor-right            *cursor-right* *cursor_right*
  309. <S-Up>        shift-cursor-up
  310. <S-Down>    shift-cursor-down
  311. <S-Left>    shift-cursor-left
  312. <S-Right>    shift-cursor-right
  313. <C-Left>    control-cursor-left
  314. <C-Right>    control-cursor-right
  315. <F1> - <F12>    function keys 1 to 12        *function_key* *function-key*
  316. <S-F1> - <S-F12> shift-function keys 1 to 12    *<S-F1>*
  317. <Help>        help key
  318. <Undo>        undo key
  319. <Insert>    insert key
  320. <Home>        home                *home*
  321. <End>        end                *end*
  322. <PageUp>    page-up                *page_up* *page-up*
  323. <PageDown>    page-down            *page_down* *page-down*
  324. <kHome>        keypad home (upper left)    *keypad-home*
  325. <kEnd>        keypad end (lower left)        *keypad-end*
  326. <kPageUp>    keypad page-up (upper right)    *keypad-page-up*
  327. <kPageDown>    keypad page-down (lower right)    *keypad-page-down*
  328. <kPlus>        keypad +            *keypad-plus*
  329. <kMinus>    keypad -            *keypad-minus*
  330. <kMultiply>    keypad *            *keypad-multiply*
  331. <kDivide>    keypad /            *keypad-divide*
  332. <kEnter>    keypad Enter            *keypad-enter*
  333. <S-...>        shift-key            *shift*
  334. <C-...>        control-key            *control* *ctrl*
  335. <M-...>        alt-key or meta-key        *meta* *alt*
  336. <t_xx>        key with "xx" entry in termcap
  337. -----------------------------------------------------------------------
  338.  
  339. Note: The shifted cursor keys, the help key, and the undo key are only
  340. available on a few terminals.  On the Amiga, shifted function key 10 produces
  341. a code (CSI) that is also used by key sequences.  It will be recognized only
  342. after typing another key.
  343.  
  344. Note: There are two codes for the delete key.  127 is the decimal ASCII value
  345. for the delete key, which is always recognized.  Some delete keys send another
  346. value, in which case this value is obtained from the termcap entry "kD".  Both
  347. values have the same effect.  Also see |:fixdel|.
  348.  
  349. Note: The keypad keys are used in the same way as the corresponding "normal"
  350. keys.  For example, <kHome> has the same effect as <Home>.  If a keypad key
  351. sends the same raw key code as it non-keypad equivalent, it will be recognized
  352. as the non-keypad code.  For example, when <kHome> sends the same code as
  353. <Home>, when pressing <kHome> Vim will think <Home> was pressed.  Mapping
  354. <kHome> will not work then.
  355.  
  356.                                 *<>*
  357. Examples are often given in the <> notation.  Sometimes this is just to make
  358. clear what you need to type, but often it can be typed literally, e.g., with
  359. the ":map" command.  The rules are:
  360.  1.  Any printable characters are typed directly, except backslash and '<'
  361.  2.  A backslash is represented with "\\", double backslash.
  362.  3.  A real '<' is represented with "\<" or "<lt>".
  363.  4.  "<key>" means the special key typed.  This is the notation explained in
  364.      the table above.  A few examples:
  365.        <Esc>        Escape key
  366.        <C-G>        CTRL-G
  367.        <Up>            cursor up key
  368.        <C-LeftMouse>    Control- left mouse click
  369.        <S-F11>        Shifted function key 11
  370.        <M-a>        Meta- a  ('a' with bit 8 set)
  371.        <M-A>        Meta- A  ('A' with bit 8 set)
  372.        <t_kd>        "kd" termcap entry (cursor down key)
  373.  
  374. If you want to use the full <> notation in Vim, you have to make sure the '<'
  375. flag is excluded from 'cpoptions' (when 'compatible' is not set, it already is
  376. by default).
  377. >    :set cpo-=<
  378. The <> notation uses <lt> to escape the special meaning of key names.  Using a
  379. backslash also work, but only when 'cpoptions' does not include the 'B' flag.
  380.  
  381. Examples for using a literal "<Home>" in a mapping:
  382. >    :imap <C-H> \<Home>
  383. >    :imap <C-H> <lt>Home>
  384. The first one only works when the 'B' flag is not in 'cpoptions'.  The second
  385. one always works.
  386. To get a literal "<lt>" in a mapping:
  387. >    :map <C-L> <lt>lt>
  388.  
  389. For mapping, abbreviation and menu commands you can then copy-paste the
  390. examples and use them directly.  Or type them literally, including the '<' and
  391. '>' characters.  This does NOT work for other commands, like ":set" and
  392. ":autocmd"!
  393.  
  394.  
  395. There are several references to other versions of Vi:
  396.                                 *Vi*
  397.     Vi    "the original".  Without further remarks this is the version
  398.         of Vi that appeared in Sun OS 4.x.  ":version" returns
  399.         "Version 3.7, 6/7/85".  Sometimes other versions are referred
  400.         to.  Only runs under Unix.  Source code only available with a
  401.         license.  More information on Vi can be found through:
  402.             <URL:http://www.vim.org>
  403.  
  404.                                 *Posix*
  405.     Posix    From the IEEE standard 1003.2, Part 2: Shell and utilities.
  406.         Generally known as "Posix".  This is a textual description of
  407.         how Vi is supposed to work.  The version used is a draft from
  408.         beginning 1996, so all remarks are "expected to comply to"
  409.         this.  Anything can change though...
  410.                                 *Nvi*
  411.     Nvi    The "New" Vi.  The version of Vi that comes with BSD 4.4 and
  412.         many free Unix versions.  The version used is 1.79.
  413.         ":version" returns "Version 1.79 (10/23/96)".  Source code is
  414.         freely available.
  415.                                 *Elvis*
  416.     Elvis    Another Vi clone, made by Steve Kirkendall.  The version used
  417.         is 2.1b, which is a beta-test version.  Version 2.0 is the
  418.         last official release.  Source code is freely available.
  419.  
  420. ==============================================================================
  421. 5. Modes, introduction                *vim-modes-intro* *vim-modes*
  422.  
  423. Vim has six BASIC modes:
  424.  
  425. Normal mode        In Normal mode you can enter all the editor
  426.             commands.  If you start the editor you are in this
  427.             mode (unless you have set the 'insertmode' option,
  428.             see below).  This is also known as command mode.
  429.  
  430. Visual mode        This is like Normal mode, but the movement commands
  431.             extend a highlighted area.  When a non-movement
  432.             command is used, it is executed for the highlighted
  433.             area.  If the 'showmode' option is on "-- VISUAL --"
  434.             is shown at the bottom of the window.  See
  435.             |Visual-mode|.
  436.  
  437. Select mode        This looks most like the MS-Windows selection mode.
  438.             Typing a printable character deletes the selection
  439.             and starts Insert mode.  If the 'showmode' option is
  440.             on "-- SELECT --" is shown at the bottom of the
  441.             window.  See |Select-mode|.
  442.  
  443. Insert mode        In Insert mode the text you type is inserted into the
  444.             buffer.  If the 'showmode' option is on "-- INSERT --"
  445.             is shown at the bottom of the window.  |Insert-mode|
  446.  
  447. Command-line mode    In Command-line mode (also called Cmdline mode) you
  448. Cmdline mode        can enter one line of text at the bottom of the
  449.             window.  This is for the Ex commands, ":", the pattern
  450.             search commands, "?" and "/", and the filter command,
  451.             "!".  |Cmdline-mode|
  452.  
  453. Ex mode            Like Command-line mode, but after entering a command
  454.             you remain in Ex mode.  Very limited editing of the
  455.             command.  |Ex-mode|
  456.  
  457. There are four ADDITIONAL modes:
  458.  
  459. Replace mode        Replace mode is a special case of Insert mode.  You
  460.             can do the same things as in Insert mode, but for
  461.             each character you enter, one character of the existing
  462.             text is deleted.  If the 'showmode' option is on,
  463.             (which is the default), the string "-- REPLACE --" is
  464.             shown at the bottom of the window.  |Replace-mode|
  465.  
  466. Insert command mode    Entered when CTRL-O given in Insert mode.  This is
  467.             like Normal mode, but after executing one command Vim
  468.             returns to Insert mode.  The string "-- (insert) --"
  469.             is shown at the bottom of the window.
  470.  
  471. Insert Visual mode    Entered when starting a Visual selection from Insert
  472.             mode.  When the Visual selection ends, Vim returns to
  473.             Insert mode.
  474.  
  475. Insert Select mode    Entered when starting Select mode from Insert mode.
  476.             When the Select mode ends, Vim returns to Insert mode.
  477.  
  478. ==============================================================================
  479. 6. Switching from mode to mode                *mode-switching*
  480.  
  481. If for any reason you do not know which mode you are in, you can always get
  482. back to Normal mode by typing <Esc> twice.  You will know you are back in
  483. Normal mode when you see the screen flash or hear the bell after you type
  484. <Esc>.  This doesn't work for Ex mode, use ":visual".
  485.  
  486.                             *i_esc*
  487.         TO mode                            ~
  488.         Normal    Visual    Select    Insert      Replace   Cmd-line  Ex ~
  489. FROM mode                                 ~
  490. Normal          -    v V ^V      *4     *1        R        : / ? !   Q
  491. Visual         *2      -      ^G     c C        --          :       --
  492. Select         *5    ^O ^G      -     *6        --          :       --
  493. Insert         <Esc>      --      --     -      <Insert>    --      --
  494. Replace         <Esc>      --      --    <Insert>    -          --      --
  495. Command-line     *3      --      --     --        --          -       --
  496. Ex         :vi      --      --     --        --          --      -
  497.  
  498. -  NA
  499. -- not possible
  500.  
  501. *1 Go from Normal mode to Insert mode by giving the command "i", "I", "a",
  502.    "A", "o", "O", "c", "C", "s" or S".
  503. *2 Go from Visual mode to Normal mode by giving a non-movement command, which
  504.    causes the command to be executed, or by hitting <Esc> "v", "V" or "CTRL-V"
  505.    (see |v_v|), which just stops Visual mode without side effects.
  506. *3 Go from Command-line mode to Normal mode by:
  507.    - Hitting <CR> or <NL>, which causes the entered command to be executed.
  508.    - Deleting the complete line (e.g., with CTRL-U) and giving a final <BS>.
  509.    - Hitting CTRL-C or <Esc>, which quits the command-line without executing
  510.      the command.
  511.    In the last case <Esc> may be the character defined with the 'wildchar'
  512.    option, in which case it will start command-line completion.  You can
  513.    ignore that and type <Esc> again.  {Vi: when hitting <Esc> the command-line
  514.    is executed.  This is unexpected for most people; therefore it was changed
  515.    in Vim.  But when the <Esc> is part of a mapping, the command-line is
  516.    executed.  If you want the Vi behaviour also when typing <Esc>, use ":cmap
  517.    ^V<Esc> ^V^M"}
  518. *4 Go from Normal to Select mode by:
  519.    - use the mouse to select text while 'mousemodel' is "ms"
  520.    - use a non-printable command to move the cursur while keeping the Shift
  521.      key pressed, and the 'select' option is set
  522. *5 Go from Select mode to Normal mode by using a non-printable command to move
  523.    the cursor, without keeping the Shift key pressed.
  524. *6 Go from Select mode to Insert mode by typing a printable character.  The
  525.    selection is deleted and the character is inserted.
  526.  
  527. If the 'insertmode' option is on, editing a file will start in Insert mode.
  528.  
  529.                         *Q* *mode-Ex* *Ex-mode*
  530. Q            Switch to "Ex" mode.  This is a bit like typing ":"
  531.             commands one after another, except:
  532.             - You don't have to keep pressing ":".
  533.             - The screen doesn't get updated after each command.
  534.             - There is no normal command-line editing.
  535.             - Mappings and abbreviations are not used.
  536.             In fact, you are editing the lines with the "standard"
  537.             line-input editing commands (<Del> or <BS> to erase,
  538.             CTRL-U to kill the whole line).
  539.             Vim will enter this mode by default if it's invoked as
  540.             "ex" on the command-line.
  541.             Use the ":vi" command |:visual| to exit "Ex" mode.
  542.  
  543. ==============================================================================
  544. 7. The window contents                    *window-contents*
  545.  
  546. In command and Insert/Replace mode the screen window will show the current
  547. contents of the buffer: What You See Is What You Get.  There are two
  548. exceptions:
  549. - When the 'cpoptions' option contains '$', and the change is within one line,
  550.   the text is not directly deleted, but a '$' is put at the last deleted
  551.   character.
  552. - When inserting text in one window, other windows on the same text are not
  553.   updated until the insert is finished.
  554. {Vi: The screen is not always updated on slow terminals}
  555.  
  556. Lines longer than the window width will wrap, unless the 'wrap' option is off
  557. (see below).  The 'linebreak' option can be set to wrap at a blank character.
  558.  
  559. The bottom lines in the window may start with one of these two characters:
  560.  
  561. '@'    The next line is too long to fit in the window.
  562. '~'    Below the last line in the buffer.
  563.  
  564. If the bottom line is completely filled with '@', the line that is at the
  565. top of the window is too long to fit in the window.  If the cursor is on this
  566. line you can't see what you are doing, because this part of the line is not
  567. shown.  However, the part of the line before the '@'s can be edited normally.
  568. {Vi: gives an "internal error" on lines that do not fit in the window}
  569.  
  570. The '@' occasion in the 'highlight' option can be used to set special
  571. highlighting for the '@' and '~' characters.
  572.  
  573. The 'showbreak' option contains the string to put in front of wrapped lines.
  574.  
  575.                             *wrap-off*
  576. If the 'wrap' option is off, long lines will not wrap.  Only the part that
  577. fits on the screen is shown.  If the cursor is moved to a part of the line
  578. that is not shown, the screen is scrolled horizontally.  The advantage of
  579. this method is that columns are shown as they are and lines that cannot fit
  580. on the screen can be edited.  The disadvantage is that you cannot see all the
  581. characters of a line at once.  The 'sidescroll' option can be set to the
  582. minimal number of columns to scroll.  {Vi: has no 'wrap' option}
  583.  
  584. All normal ASCII characters are displayed directly on the screen.  The <Tab>
  585. is replaced with the number of spaces that it represents.  Other non-printing
  586. characters are replaced with "^{char}", where {char} is the non-printing
  587. character with 64 added.  Thus character 7 (bell) will be shown as "^G".
  588. Characters between 127 and 160 are replaced with "~{char}", where {char} is
  589. the character with 64 subtracted.  These characters occupy more than one
  590. position on the screen.  The cursor can only be positioned on the first one.
  591.  
  592. If you set the 'number' option, all lines will be preceded with their
  593. number.  Tip: If you don't like wrapping lines to mix with the line numbers,
  594. set the 'showbreak' option to eight spaces:
  595.     ":set showbreak=\ \ \ \ \ \ \ \ "
  596.  
  597. If you set the 'list' option, <Tab> characters will not be shown as several
  598. spaces, but as "^I".  A '$' will be placed at the end of the line, so you can
  599. find trailing blanks.
  600.  
  601. In Command-line mode only the command-line itself is shown correctly.  The
  602. display of the buffer contents is updated as soon as you go back to Command
  603. mode.
  604.  
  605. The last line of the window is used for status and other messages.  The
  606. status messages will only be used if an option is on:
  607.  
  608. status message            option         default    Unix default    ~
  609. current mode            'showmode'    on        on
  610. command characters        'showcmd'    on        off
  611. cursor position            'ruler'        off        off
  612.  
  613. The current mode is "-- INSERT --" or "-- REPLACE --", see |'showmode'|.  The
  614. command characters are those that you typed but were not used yet.  {Vi: does
  615. not show the characters you typed or the cursor position}
  616.  
  617. If you have a slow terminal you can switch off the status messages to speed
  618. up editing:
  619.     :set nosc noru nosm
  620.  
  621. If there is an error, an error message will be shown for at least one second
  622. (in reverse video).  {Vi: error messages may be overwritten with other
  623. messages before you have a chance to read them}
  624.  
  625. Some commands show how many lines were affected.  Above which threshold this
  626. happens can be controlled with the 'report' option (default 2).
  627.  
  628. On the Amiga Vim will run in a CLI window.  The name Vim and the full name of
  629. the current file name will be shown in the title bar.  When the window is
  630. resized, Vim will automatically redraw the window.  You may make the window as
  631. small as you like, but if it gets too small not a single line will fit in it.
  632. Make it at least 40 characters wide to be able to read most messages on the
  633. last line.
  634.  
  635. On most Unix systems window resize works ok.  {Vi: not ok}
  636.  
  637.  vim:ts=8:sw=8:tw=78:
  638.