home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / amiga / vim46bin.lha / vim-4.6 / doc / vim_help.txt < prev    next >
Encoding:
Text File  |  1997-03-12  |  53.2 KB  |  1,195 lines

  1. *vim_help.txt*    For Vim version 4.6.  Last modification: 1997 Feb 7
  2.  
  3.             VIM help file
  4.  
  5. VIM stands for Vi IMproved.  Most of VIM was made by Bram Moolenaar.
  6.                                        k
  7.       Move around:  Use the cursor keys, or "h" to go left,         h   l
  8.             "j" to go down, "k" to go up, "l" to go right.       j
  9. Close this window:  Use ":q".
  10. Jump to a subject:  Position the cursor on the tag between |bars| and hit
  11.             CTRL-].  Use CTRL-T to go back.
  12.    With the mouse:  ":set mouse=a" to enable the mouse (in xterm).
  13.             Hit "g" and click left mouse button on tag between |bars|.
  14.             Hit "g" and click right mouse button to go back.
  15. Getting help on a
  16.  specific subject:  It is possible to go directly to whatever you want help
  17.             on, by giving an argument to the ":help" command, |:help|.
  18.             It is possible to further specify the context:
  19.               what            prepend    example
  20.               Normal mode commands     (nothing)   :help x
  21.               Visual mode commands      v_       :help v_u
  22.               Insert mode commands      i_       :help i_<Esc>
  23.               command-line commands      :       :help :quit
  24.               command-line editing      c_       :help c_<Del>
  25.               Vim command options      -       :help -r
  26.               options              '       :help 'textwidth'
  27.  
  28.  tag      subject             tag      subject    *index*
  29.  
  30. |X_lr|     motion: Left-right        |X_re|     Repeating commands
  31. |X_ud|     motion: Up-down        |X_km|     Key mapping
  32. |X_tm|     motion: Text object        |X_ab|     Abbreviations
  33. |X_pa|     motion: Pattern searches    |X_op|     Options
  34. |X_ma|     motion: Marks            |X_ur|     Undo/Redo commands
  35. |X_vm|     motion: Various        |X_et|     External commands
  36. |X_ta|     motion: Using tags        |X_qf|     Quickfix commands
  37. |X_sc|     Scrolling            |X_vc|     Various commands
  38. |X_in|     insert: Inserting text        |X_ce|     Ex: Command-line editing
  39. |X_ai|     insert: Keys            |X_ra|     Ex: Ranges
  40. |X_ss|     insert: Special keys        |X_ex|     Ex: Special characters
  41. |X_di|     insert: Digraphs        |X_ed|     Editing a file
  42. |X_si|     insert: Special inserts    |X_fl|     Using the argument list
  43. |X_de|     change: Deleting text        |X_wq|     Writing and quitting
  44. |X_cm|     change: Copying and moving    |X_st|     Starting VIM
  45. |X_ch|     change: Changing text        |X_ac|     Automatic commands
  46. |X_co|     change: Complex        |X_wi|     Multi-window functions
  47. |X_vi|     Visual mode            |X_bu|     Buffer list functions
  48. |X_to|     Text objects
  49.  
  50. |howto|        how to do common things
  51. |copying|    About copying Vim and Uganda
  52. |credits|    People who contributed
  53. |www|        Vim on the World Wide Web
  54. |bugs|        Where to send bug reports
  55.  
  56. list of documentation files:              remarks about specific systems:
  57.  
  58. |vim_help.txt|    quick reference (this file)        |vim_ami.txt|   Amiga
  59. |vim_idx.txt|    alphabetical index            |vim_arch.txt|  Archimedes
  60. |vim_ref.txt|    reference manual            |vim_dos.txt|   MS-DOS
  61. |vim_win.txt|    reference for window commands        |vim_mac.txt|   Macintosh
  62. |vim_diff.txt|    differences between Vim and Vi        |vim_mint.txt|  MiNT
  63. |vim_digr.txt|    list of available digraphs        |vim_os2.txt|   OS/2
  64. |vim_tips.txt|    tips on using Vim            |vim_unix.txt|  Unix
  65. |vim_gui.txt|    about the Graphical User Interface  |vim_w32.txt|   Win-NT/95
  66. |vim_rlh.txt|    about right-to-left editing
  67. |vim_40.txt|    about this version
  68. |vim_tags|    all the tags you can jump to (index of tags)
  69.  
  70. ------------------------------------------------------------------------------
  71. How to ...                *howdoi* *how_do_i* *howto* *how_to*
  72.  
  73. exit? I'm trapped, help me!            |:quit|
  74. initialize Vim                    |initialization|
  75. suspend Vim                    |suspend|
  76. recover after a crash                |crash_recovery|
  77. keep a backup of my file            |backup|
  78.  
  79. edit files                    |edit_files|
  80. insert text                    |inserting|
  81. delete text                    |deleting|
  82. change text                    |changing|
  83. edit binary files                |edit_binary|
  84. copy and move text                |copy_move|
  85. repeat commands                    |repeating|
  86. undo and redo                    |undo_redo|
  87. format text                    |formatting|
  88. format comments                    |format_comments|
  89. indent C programs                |C_indenting|
  90. automatically set indent            |'autoindent'|
  91.  
  92. move around                    |cursor_motions|
  93. word motions                    |word_motions|
  94. left-right motions                |left_right_motions|
  95. up-down motions                    |up_down_motions|
  96. text-object motions                |object_motions|
  97. various motions                    |various_motions|
  98. text-object selection                |object_select|
  99. move freely beyond beginning/end of line    |'whichwrap'|
  100. specify pattern for searches            |pattern_searches|
  101. do tags and special searches            |tags_and_searches|
  102. search in include'd files used to find
  103.     variables, functions, or macros        |include_search|
  104. look up manual for the keyword under cursor    |K|
  105.  
  106. scroll                        |scrolling|
  107. scroll horizontally/sideways            |'sidescroll'|
  108. set scroll boundary                |'scrolloff'|
  109.  
  110. change modes                    |mode_switching|
  111. use visual mode                    |Visual_mode|
  112. start Vim in Insert mode            |'insertmode'|
  113.  
  114. map keys                    |key_mapping|
  115. create abbreviations                |abbreviations|
  116.  
  117. expand a tab to spaces in Insert mode        |ins_expandtab|
  118. insert contents of a register in Insert mode    |i_CTRL-R|
  119. complete words in Insert mode            |ins_completion|
  120. break a line before it gets too long        |ins_textwidth|
  121.  
  122. do command-line editing                |cmdline_editing|
  123. do command-line completion            |cmdline_completion|
  124. increase the height of command-line        |'cmdheight'|
  125. specify command-line ranges            |cmdline_ranges|
  126. specify commands to be executed automatically
  127.     before/after reading/writing
  128.     entering/leaving a buffer/window        |autocommand|
  129.  
  130. write automatically                |'autowrite'|
  131. speedup edit-compile-edit cycle    or compile
  132.     and fix errors within Vim        |quickfix|
  133.  
  134. set options                    |options|
  135. set options automatically            |auto_setting|
  136. set options depending on terminal name        |term_dependent_settings|
  137. save settings                    |save_settings|
  138. comment my exrc/vimrc/gvimrc files        |:quote|
  139. change the default help height            |'helpheight'|
  140. set various highlighting modes            |'highlight'|
  141. set the window title                |'title'|
  142. set window icon title                |'icon'|
  143. avoid seeing the change messages on every line    |'report'|
  144. avoid "Hit RETURN ..." messages            |'shortmess'|
  145.  
  146. use mouse with Vim                |mouse_using|
  147. manage multiple windows and buffers        |vim_win.txt|
  148. use the gui                    |vim_gui.txt|
  149. catch 40 (or more!) winks, or take a catnap!    |:sleep|
  150. do dishes using Vim                You can't!  (yet)
  151.  
  152. ------------------------------------------------------------------------------
  153. N is used to indicate an optional count that can be given before the command.
  154. ------------------------------------------------------------------------------
  155. *X_lr*        Left-right motions
  156.  
  157. |h|    N  h        left (also: CTRL-H, <BS>, or <Left> key)
  158. |l|    N  l        right (also: <Space> or <Right> key)
  159. |0|       0        to first character in the line (also: <Home> key)
  160. |^|       ^        to first non-blank character in the line
  161. |$|    N  $        to the last character in the line (N-1 lines lower)
  162.                (also: <End> key)
  163. |g0|    N  g0        to first character in screen line (differs from "0"
  164.                when lines wrap)
  165. |g^|    N  g^        to first non-blank character in screen line (differs
  166.                from "^" when lines wrap)
  167. |g$|    N  g$        to last character in screen line (differs from "$"
  168.                when lines wrap)
  169. |bar|    N  |        to column N (default: 1)
  170. |f|    N  f<char>    to the Nth occurrence of <char> to the right
  171. |F|    N  F<char>    to the Nth occurrence of <char> to the left
  172. |t|    N  t<char>    till before the Nth occurrence of <char> to the right
  173. |T|    N  T<char>    till before the Nth occurrence of <char> to the left
  174. |;|    N  ;        repeat the last "f", "F", "t", or "T" N times
  175. |,|    N  ,        repeat the last "f", "F", "t", or "T" N times in
  176.                opposite direction
  177. ------------------------------------------------------------------------------
  178. *X_ud*        Up-down motions
  179.  
  180. |k|    N  k        up N lines (also: CTRL-P and <Up>)
  181. |j|    N  j        down N lines (also: CTRL-J, CTRL-N, <NL>, and <Down>)
  182. |-|    N  -        up N lines, on the first non-blank character
  183. |+|    N  +        down N lines, on the first non-blank character (also:
  184.                CTRL-M and <CR>)
  185. |_|    N  _        down N-1 lines, on the first non-blank character
  186. |G|    N  G        goto line N (default: last line), on the first
  187.                non-blank character
  188. |gg|    N  gg        goto line N (default: first line), on the first
  189.                non-blank character
  190. |N%|    N  %        goto line N percentage down in the file.  N must be
  191.                given, otherwise it is the |%| command.
  192. |gk|    N  gk        up N screen lines (differs from "k" when line wraps)
  193. |gj|    N  gj        down N screen lines (differs from "j" when line wraps)
  194. ------------------------------------------------------------------------------
  195. *X_tm*        Text object motions
  196.  
  197. |w|    N  w        N words forward
  198. |W|    N  W        N blank-separated WORDS forward
  199. |e|    N  e        forward to the end of the Nth word
  200. |E|    N  E        forward to the end of the Nth blank-separated WORD
  201. |b|    N  b        N words backward
  202. |B|    N  B        N blank-separated WORDS backward
  203. |ge|    N  ge        backward to the end of the Nth word
  204. |gE|    N  gE        backward to the end of the Nth blank-separated WORD
  205.  
  206. |)|    N  )        N sentences forward
  207. |(|    N  (        N sentences backward
  208. |}|    N  }        N paragraphs forward
  209. |{|    N  {        N paragraphs backward
  210. |]]|    N  ]]        N sections forward, at start of section
  211. |[[|    N  [[        N sections backward, at start of section
  212. |][|    N  ][        N sections forward, at end of section
  213. |[]|    N  []        N sections backward, at end of section
  214. |[(|    N  [(        N times back to unclosed '('
  215. |[{|    N  [{        N times back to unclosed '{'
  216. |])|    N  ])        N times forward to unclosed ')'
  217. |]}|    N  ]}        N times forward to unclosed '}'
  218. |[#|    N  [#        N times back to unclosed "#if" or "#else"
  219. |]#|    N  ]#        N times forward to unclosed "#else" or "#endif"
  220. |[star|    N  [*        N times back to start of comment "/*"
  221. |]star|    N  ]*        N times forward to end of comment "*/"
  222. ------------------------------------------------------------------------------
  223. *X_pa*        Pattern searches
  224.  
  225. |/|    N  /{pattern}[/[offset]]<CR>
  226.             search forward for the Nth occurrence of {pattern}
  227. |?|    N  ?{pattern}[?[offset]]<CR>
  228.             search backward for the Nth occurrence of {pattern}
  229. |/<CR>|    N  /<CR>    repeat last search, in the forward direction
  230. |?<CR>|    N  ?<CR>    repeat last search, in the backward direction
  231. |n|    N  n        repeat last search
  232. |N|    N  N        repeat last search, in opposite direction
  233. |star|    N  *        search forward for the identifier under the cursor
  234. |#|    N  #        search backward for the identifier under the cursor
  235. |gstar|    N  g*        like "*", but also find partial matches
  236. |g#|    N  g#        like "#", but also find partial matches
  237. |gd|       gd        goto local declaration of identifier under the cursor
  238. |gD|       gD        goto global declaration of identifier under the cursor
  239.  
  240. |search_pattern|    Special characters in search patterns
  241.  
  242.             meaning           magic       nomagic
  243.        matches any single character      .          \.
  244.           matches start of line      ^          ^
  245.             matches end of line      $          $
  246.           matches start of word      \<          \<
  247.             matches end of word      \>          \>
  248.    matches a single char from the range      [a-z]      \[a-z]
  249.  matches a single char not in the range      [^a-z]      \[^a-z]
  250.          matches an identifier char      \i          \i
  251.           idem but excluding digits      \I          \I
  252.         matches a keyword character      \k          \k
  253.           idem but excluding digits      \K          \K
  254.        matches a filename character      \f          \f
  255.           idem but excluding digits      \F          \F
  256.       matches a printable character      \p          \p
  257.           idem but excluding digits      \P          \P
  258.  
  259.               matches <Esc>         \e          \e
  260.               matches <Tab>      \t          \t
  261.                matches <CR>         \r          \r
  262.                matches <BS>         \b          \b
  263.  
  264. matches 0 or more of the preceding atom      *          \*
  265. matches 1 or more of the preceding atom      \+          \+
  266.    matches 0 or 1 of the preceding atom      \=          \=
  267.          separates two branches      \|          \|
  268.        group a pattern into an atom      \(\)      \(\)
  269.  
  270. |search_offset|        Offsets allowed after search command
  271.  
  272.     [num]    [num] lines downwards, in column 1
  273.     +[num]    [num] lines downwards, in column 1
  274.     -[num]    [num] lines upwards, in column 1
  275.     e[+num]    [num] characters to the right of the end of the match
  276.     e[-num]    [num] characters to the left of the end of the match
  277.     s[+num]    [num] characters to the right of the start of the match
  278.     s[-num]    [num] characters to the left of the start of the match
  279.     b[+num]    [num] characters to the right of the start (begin) of the match
  280.     b[-num]    [num] characters to the left of the start (begin) of the match
  281.     ;{search command}    execute {search command} next
  282. ------------------------------------------------------------------------------
  283. *X_ma*        Marks and motions
  284.  
  285. |m|       m<a-zA-Z>    mark current position with mark <a-zA-Z>
  286. |`a|       `<a-z>    go to mark <a-z> within current file
  287. |`A|       `<A-Z>    go to mark <A-Z> in any file
  288. |`0|       `<0-9>    go to the position where Vim was last exited
  289. |``|       ``        go to the position before the last jump
  290. |`quote|   `"        go to the position when last editing this file
  291. |`[|       `[        go to the start of the previously operated or put text
  292. |`]|       `]        go to the end of the previously operated or put text
  293. |`<|       `<        go to the start of the (previous) Visual area
  294. |`>|       `>        go to the end of the (previous) Visual area
  295. |'|       '<a-zA-Z0-9[]'"<>>
  296.             same as `, but on the first non-blank in the line
  297. |:marks|  :marks    print the active marks
  298. |CTRL-O|  N  CTRL-O    go to Nth older position in jump list
  299. |CTRL-I|  N  CTRL-I    go to Nth newer position in jump list
  300. |:ju|      :ju[mps]    print the jump list
  301. ------------------------------------------------------------------------------
  302. *X_vm*        Various motions
  303.  
  304. |%|       %        find the next brace, bracket, comment, or "#if"/
  305.                "#else"/"#endif" in this line and go to its match
  306. |H|    N  H        go to the Nth line in the window, on the first
  307.                non-blank
  308. |M|       M        go to the middle line in the window, on the first
  309.                non-blank
  310. |L|    N  L        go to the Nth line from the bottom, on the first
  311.                non-blank
  312. ------------------------------------------------------------------------------
  313. *X_ta*        Using tags
  314.  
  315. |:ta|       :ta[g][!] {tag}    Jump to tag {tag}
  316. |:ta|       :[count]ta[g][!]    Jump to [count]'th newer tag in tag list
  317. |CTRL-]|      CTRL-]        Jump to the tag under cursor, unless changes
  318.                    have been made
  319. |CTRL-T|   N  CTRL-T        Jump back from Nth older tag in tag list
  320. |:po|       :[count]po[p][!]    Jump back from [count]'th older tag in tag list
  321. |:tags|       :tags        Print tag list
  322. ------------------------------------------------------------------------------
  323. *X_sc*        Scrolling
  324.  
  325. |CTRL-E|    N  CTRL-E    window N lines downwards (default: 1)
  326. |CTRL-D|    N  CTRL-D    window N lines Downwards (default: 1/2 window)
  327. |CTRL-F|    N  CTRL-F    window N pages Forwards (downwards)
  328. |CTRL-Y|    N  CTRL-Y    window N lines upwards (default: 1)
  329. |CTRL-U|    N  CTRL-U    window N lines Upwards (default: 1/2 window)
  330. |CTRL-B|    N  CTRL-B    window N pages Backwards (upwards)
  331. |z<CR>|           z<CR> or zt    redraw, current line at top of window
  332. |z.|           z.     or zz    redraw, current line at center of window
  333. |z-|           z-     or zb    redraw, current line at bottom of window
  334.  
  335. |zh|        N  zh        scroll screen N characters to the right
  336. |zl|        N  zl        scroll screen N characters to the left
  337. ------------------------------------------------------------------------------
  338. *X_in*        Inserting text
  339.  
  340. |a|    N  a    append text after the cursor (N times)
  341. |A|    N  A    append text at the end of the line (N times)
  342. |i|    N  i    insert text before the cursor (N times) (also: <Insert>)
  343. |I|    N  I    insert text before the first non-blank in the line (N times)
  344. |gI|    N  gI    insert text in column 1 (N times)
  345. |o|    N  o    open a new line below the current line, append text (N times)
  346. |O|    N  O    open a new line above the current line, append text (N times)
  347. ------------------------------------------------------------------------------
  348. *X_ai*        Keys in Insert mode
  349.  
  350.          char            action in Insert mode
  351. |i_<Esc>|    <Esc>          end Insert mode, back to Normal mode
  352. |i_CTRL-C|    CTRL-C          like <Esc>, but do not do an abbreviation
  353. |i_CTRL-A|    CTRL-A          insert previously inserted text
  354. |i_CTRL-@|    CTRL-@          insert previously inserted text and stop
  355.                      insert
  356. |i_CTRL-R|    CTRL-R <0-9a-z%:.-"> insert contents of register <0-9a-z%:.-">
  357. |i_<NL>|    <NL> or <CR> or CTRL-M or CTRL-J
  358.                   begin new line
  359. |i_CTRL-E|    CTRL-E          insert the character from below the cursor
  360. |i_CTRL-Y|    CTRL-Y          insert the character from above the cursor
  361. |i_CTRL-V|    CTRL-V <char>..      insert character literally, or enter decimal
  362.                      byte value
  363. |i_CTRL-N|    CTRL-N          insert next match of identifier before the
  364.                      cursor
  365. |i_CTRL-P|    CTRL-P          insert previous match of identifier before
  366.                      the cursor
  367. |i_CTRL-X|    CTRL-X ...      complete the word before the cursor in
  368.                      various ways
  369. |i_<BS>|    <BS> or CTRL-H      delete the character before the cursor
  370. |i_<Del>|    <Del>          delete the character under the cursor
  371. |i_CTRL-W|    CTRL-W          delete word before the cursor
  372. |i_CTRL-U|    CTRL-U          delete all entered characters in the current
  373.                      line
  374. |i_CTRL-T|    CTRL-T          insert one shiftwidth of indent in front of
  375.                        the current line
  376. |i_CTRL-D|    CTRL-D          delete one shiftwidth of indent in front of
  377.                      the current line
  378. |i_0_CTRL-D|    0 CTRL-D      delete all indent in the current line
  379. |i_^_CTRL-D|    ^ CTRL-D      delete all indent in the current line,
  380.                      restore indent in next line
  381. |i_CTRL-K|    CTRL-K {char1} {char2}
  382.                   enter digraph (See |X_di|)
  383. |i_digraph|    {char1} <BS> {char2}
  384.                   enter digraph if 'digraph' option set
  385. |i_CTRL-B|    CTRL-B          toggle 'revins' (reverse insert) option
  386. ------------------------------------------------------------------------------
  387. *X_ss*        Special keys in Insert mode
  388.  
  389. |i_<Up>|    cursor keys      move cursor left/right/up/down
  390. |i_<S-Left>|    shift-left/right  one word left/right
  391. |i_<S-Up>|    shift-up/down      one screenful backward/forward
  392. |i_CTRL-O|    CTRL-O {command}  execute {command}
  393. |i_<End>|    <End>          cursor after last character in the line
  394. |i_<Home>|    <Home>          cursor to first character in the line
  395. ------------------------------------------------------------------------------
  396. *X_di*        Digraphs
  397.  
  398. |:dig|       :dig[raphs]        show current list of digraphs
  399. |:dig|       :dig[raphs] {char1}{char2} {number} ...
  400.                 add digraph(s) to the list
  401. ------------------------------------------------------------------------------
  402. *X_si*        Special inserts
  403.  
  404. |:r|       :r [file]       insert the contents of [file] below the cursor
  405. |:r!|       :r! {command}   insert the standard output of {command} below the
  406.                   cursor
  407. ------------------------------------------------------------------------------
  408. *X_de*        Deleting text
  409.  
  410. |x|    N  x        delete N characters under and after the cursor
  411. |<Del>| N  <Del>    delete N characters under and after the cursor
  412. |X|    N  X        delete N characters before the cursor
  413. |d|    N  d{motion}    delete the text that is moved over with {motion}
  414. |v_d|    {visual}d    delete the highlighted text
  415. |dd|    N  dd        delete N lines
  416. |D|    N  D        delete to end-of-line (and N-1 more lines)
  417. |J|    N  J        join N-1 lines (delete newlines)
  418. |v_J|    {visual}J    join the highlighted lines
  419. |:d|    :[range]d [x]    delete [range] lines [into register x]
  420. ------------------------------------------------------------------------------
  421. *X_cm*        Copying and moving text
  422.  
  423. |quote|      "<char>    use register <char> for the next delete, yank, or put
  424. |:reg|      :reg        show the contents of all registers
  425. |:reg|      :reg {arg}    show the contents of registers mentioned in {arg}
  426. |y|      N  y{motion}    yank the text moved over with {motion} into a register
  427. |v_y|         {visual}y    yank the highlighted text into a register
  428. |yy|      N  yy        yank N lines into a register
  429. |Y|      N  Y        yank N lines into a register
  430. |p|      N  p        put a register after the cursor position (N times)
  431. |P|      N  P        put a register before the cursor position (N times)
  432. |]p|      N  ]p        like p, but adjust indent to current line
  433. |[p|      N  [p        like P, but adjust indent to current line
  434. ------------------------------------------------------------------------------
  435. *X_ch*        Changing text
  436.  
  437. |R|      N  R        enter Replace mode (repeat the entered text N times)
  438. |c|      N  c{motion}    change the text that is moved over with {motion}
  439. |v_c|         {visual}c    change the highlighted text
  440. |cc|      N  cc        change N lines
  441. |S|      N  S        change N lines
  442. |C|      N  C        change to end-of-line (and N-1 more lines)
  443. |s|      N  s        change N characters
  444. |r|      N  r<char>    replace N characters with <char>
  445.  
  446. |~|      N  ~        switch case for N characters and advance cursor
  447. |v_~|         {visual}~    switch case for highlighted text
  448. |v_u|         {visual}u    make highlighted text lowercase
  449. |v_U|         {visual}U    make highlighted text uppercase
  450. |g~|         g~{motion} switch case for the text that is moved over with
  451.                {motion}
  452. |gu|         gu{motion} make the text that is moved over with {motion}
  453.                lowercase
  454. |gU|         gU{motion} make the text that is moved over with {motion}
  455.                uppercase
  456.  
  457. |CTRL-A|  N  CTRL-A    add N to the number at or after the cursor
  458. |CTRL-X|  N  CTRL-X    subtract N from the number at or after the cursor
  459.  
  460. |<|      N  <{motion}    move the lines that are moved over with {motion} one
  461.                shiftwidth left
  462. |<<|      N  <<        move N lines one shiftwidth left
  463. |>|      N  >{motion}    move the lines that are moved over with {motion} one
  464.                shiftwidth right
  465. |>>|      N  >>        move N lines one shiftwidth right
  466. |gq|      N  gq{motion}    format the lines that are moved over with {motion} to
  467.                'textwidth' length
  468. |:ce|      :[range]ce[nter] [width]
  469.             center the lines in [range]
  470. |:le|      :[range]le[ft] [indent]
  471.             left-align the lines in [range] [with indent]
  472. |:ri|      :[range]ri[ght] [width]
  473.             right-align the lines in [range]
  474. ------------------------------------------------------------------------------
  475. *X_co*        Complex changes
  476.  
  477. |!|       N  !{motion}{command}<CR>
  478.             filter the lines that are moved over through {command}
  479. |!!|       N  !!{command}<CR>
  480.             filter N lines through {command}
  481. |v_!|          {visual}!{command}<CR>
  482.             filter the highlighted lines through {command}
  483. |:range!|  :[range]! {command}<CR>
  484.             filter [range] lines through {command}
  485. |=|       N  ={motion}
  486.             filter the lines that are moved over through "indent"
  487. |==|       N  ==    filter N lines through "indent"
  488. |v_=|          {visual}=
  489.             filter the highlighted lines through "indent"
  490. |:s|       :[range]s[ubstitute]/{pattern}/{string}/[g][c]
  491.             substitute {pattern} by {string} in [range] lines;
  492.                with [g], replace all occurrences of {pattern};
  493.                with [c], confirm each replacement
  494. |:s|       :[range]s[ubstitute] [g][c]
  495.             repeat previous ":s" with new range and options
  496. |&|          &        Repeat previous ":s" on current line without options
  497. |:ret|       :[range]ret[ab][!] [tabstop]
  498.             set 'tabstop' to new value and adjust white space
  499.                accordingly
  500. ------------------------------------------------------------------------------
  501. *X_vi*        Visual mode
  502.  
  503. |v|       v        start highlighting characters  }  move cursor and use
  504. |V|       V        start highlighting linewise    }  operator to affect
  505. |CTRL-V|   CTRL-V    start highlighting blockwise   }  highlighted text
  506. |v_o|       o        exchange cursor position with start of highlighting
  507. |gv|       gv        start highlighting on previous visual area
  508. |v_v|       v        highlight characters or stop highlighting
  509. |v_V|       V        highlight linewise or stop highlighting
  510. |v_CTRL-V| CTRL-V    highlight blockwise or stop highlighting
  511. ------------------------------------------------------------------------------
  512. *X_to*        Text objects (only in Visual mode or after an operator)
  513.  
  514. |v_a|    N  a        Select current word
  515. |v_A|    N  A        Select current WORD
  516. |v_s|    N  s        Select current sentence
  517. |v_p|    N  p        Select current paragraph
  518. |v_S|    N  S        Select current block (from "[(" to "])")
  519. |v_P|    N  P        Select current block (from "[{" to "]}")
  520. ------------------------------------------------------------------------------
  521. *X_re*        Repeating commands
  522.  
  523. |.|       N  .        repeat last change (with count replaced with N)
  524. |q|          q<a-z>    record typed characters into register <a-z>
  525. |q|          q<A-Z>    record typed characters, appended to register <a-z>
  526. |q|          q        stop recording
  527. |@|       N  @<a-z>    execute the contents of register <a-z> (N times)
  528. |@@|       N  @@       repeat previous @<a-z> (N times)
  529. |:@|       :@<a-z>    execute the contents of register <a-z> as an Ex
  530.                command
  531. |:@@|       :@@        repeat previous :@<a-z>
  532. |:g|       :[range]g[lobal]/{pattern}/[cmd]
  533.             Execute Ex command [cmd] (default: ":p") on the lines
  534.                within [range] where {pattern} matches.
  535. |:g|       :[range]g[lobal]!/{pattern}/[cmd]
  536.             Execute Ex command [cmd] (default: ":p") on the lines
  537.                within [range] where {pattern} does NOT match.
  538. |:so|       :so[urce] {file}
  539.             Read Ex commands from {file}.
  540. |:so|       :so[urce]! {file}
  541.             Read Vim commands from {file}.
  542. |:sl|       :sl[eep] [N]
  543.             don't do anything for N seconds
  544. |gs|       N  gs    Goto Sleep for N seconds
  545. ------------------------------------------------------------------------------
  546. *X_km*        Key mapping
  547.  
  548. |:map|         :ma[p] {lhs} {rhs}      Map {lhs} to {rhs} in Normal and Visual
  549.                      mode.
  550. |:map!|         :ma[p]! {lhs} {rhs}  Map {lhs} to {rhs} in Insert and Command-line
  551.                      mode.
  552. |:noremap|   :no[remap][!] {lhs} {rhs}
  553.                   Same as ":map", no remapping for this {rhs}
  554. |:unmap|     :unm[ap] {lhs}      Remove the mapping of {lhs} for Normal and
  555.                      Visual mode.
  556. |:unmap!|    :unm[ap]! {lhs}      Remove the mapping of {lhs} for Insert and
  557.                      Command-line mode.
  558. |:map_l|     :ma[p] [lhs]      List mappings (starting with [lhs]) for
  559.                      Normal and Visual mode.
  560. |:map_l!|    :ma[p]! [lhs]      List mappings (starting with [lhs]) for
  561.                      Insert and Command-line mode.
  562. |:cmap|         :cmap/:cunmap/:cnoremap
  563.                   like ":map!"/":unmap!"/":noremap!" but for
  564.                      Command-line mode only
  565. |:imap|         :imap/:iunmap/:inoremap
  566.                   like ":map!"/":unmap!"/":noremap!" but for
  567.                      Insert mode only
  568. |:nmap|         :nmap/:nunmap/:nnoremap
  569.                   like ":map"/":unmap"/":noremap" but for
  570.                      Normal mode only
  571. |:vmap|         :vmap/:vunmap/:vnoremap
  572.                   like ":map"/":unmap"/":noremap" but for
  573.                      Visual mode only
  574. |:mkexrc|    :mk[exrc][!] [file]  write current mappings, abbreviations, and
  575.                      settings to [file] (default: ".exrc";
  576.                      use ! to overwrite)
  577. |:mkvimrc|   :mkv[imrc][!] [file]
  578.                   same as ":mkexrc", but with default ".vimrc"
  579. |:mapc|      :mapc[lear]      remove mappings for Normal and Visual mode
  580. |:mapc|      :mapc[lear]!      remove mappings for Insert and Cmdline mode
  581. |:imapc|     :imapc[lear]      remove mappings for Insert mode
  582. |:vmapc|     :vmapc[lear]      remove mappings for Visual mode
  583. |:nmapc|     :nmapc[lear]      remove mappings for Normal mode
  584. |:cmapc|     :cmapc[lear]      remove mappings for Cmdline mode
  585. ------------------------------------------------------------------------------
  586. *X_ab*        Abbreviations
  587.  
  588. |:abbreviate|    :ab[breviate] {lhs} {rhs}  add abbreviation for {lhs} to {rhs}
  589. |:abbreviate|    :ab[breviate] {lhs}       show abbr's that start with {lhs}
  590. |:abbreviate|    :ab[breviate]           show all abbreviations
  591. |:unabbreviate|    :una[bbreviate] {lhs}       remove abbreviation for {lhs}
  592. |:noreabbrev|    :norea[bbrev] [lhs] [rhs]  like ":ab", but don't remap [rhs]
  593. |:iabbrev|    :iab/:iunab/:inoreab       like ":ab", but only for Insert mode
  594. |:cabbrev|    :cab/:cunab/:cnoreab       like ":ab", but only for
  595.                         Command-line mode
  596. |:abclear|    :abc[lear]           remove all abbreviations
  597. |:cabclear|    :cabc[lear]           remove all abbr's for Cmdline mode
  598. |:iabclear|    :iabc[lear]           remove all abbr's for Insert mode
  599. ------------------------------------------------------------------------------
  600. *X_op*        Options
  601.  
  602. |:set|    :se[t]            Show all modified options.
  603. |:set|    :se[t] all        Show all options.
  604. |:set|    :se[t] {option}        Set toggle option on, show string or number
  605.                    option.
  606. |:set|    :se[t] no{option}    Set toggle option off.
  607. |:set|    :se[t] inv{option}    invert toggle option.
  608. |:set|    :se[t] {option}={value} Set string or number option to {value}.
  609. |:set|    :se[t] {option}?    Show value of {option}.
  610. |:set|    :se[t] {option}&    Reset {option} to its default value.
  611.  
  612. |:fix|    :fix[del]        Set value of 't_kD' according to value of
  613.                    't_kb'.
  614.  
  615. Short explanation of each option:        *option_list*
  616. |'aleph'|       |'al'|    ASCII code of the letter Aleph (RIGHTLEFT)
  617. |'autoindent'|       |'ai'|    take indent for new line from previous line
  618. |'autowrite'|       |'aw'|    automatically write file if changed
  619. |'backspace'|       |'bs'|    how backspace works at start of line
  620. |'backup'|       |'bk'|    keep backup file after overwriting a file
  621. |'backupdir'|       |'bdir'|    list of directories for the backup file
  622. |'backupext'|       |'bex'|    extension used for the backup file
  623. |'binary'|       |'bin'|    edit binary file mode
  624. |'bioskey'|       |'biosk'|    MS-DOS: use bios calls for input characters
  625. |'breakat'|       |'brk'|    characters that may cause a line break
  626. |'cindent'|       |'cin'|    do C program indenting
  627. |'cinkeys'|       |'cink'|    keys that trigger indent when 'cindent' is set
  628. |'cinoptions'|       |'cino'|    how to do indenting when 'cindent' is set
  629. |'cinwords'|       |'cinw'|    words where 'si' and 'cin' add an indent
  630. |'cmdheight'|       |'ch'|    number of lines to use for the command-line
  631. |'columns'|       |'co'|    number of columns in the display
  632. |'comments'|       |'com'|    patterns that can start a comment line
  633. |'compatible'|       |'cp'|    behave Vi-compatibly as much as possible
  634. |'cpoptions'|       |'cpo'|    flags for Vi-compatible behaviour
  635. |'define'|       |'def'|    pattern to be used to find a macro definition
  636. |'dictionary'|       |'dict'|    list of filenames used for keyword completion
  637. |'digraph'|       |'dg'|    enable the entering of digraphs in Insert mode
  638. |'directory'|       |'dir'|    list of directory names for the swapfile
  639. |'edcompatible'|   |'ed'|    toggle flags of ":substitute" command
  640. |'endofline'|       |'eol'|    write end-of-line for last line in file
  641. |'equalalways'|    |'ea'|    windows are automatically made the same size
  642. |'equalprg'|       |'ep'|    external program to use for "=" command
  643. |'errorbells'|       |'eb'|    ring the bell for error messages
  644. |'errorfile'|       |'ef'|    name of the error file for the QuickFix mode
  645. |'errorformat'|    |'efm'|    description of the lines in the error file
  646. |'esckeys'|       |'ek'|    recognize function keys in Insert mode
  647. |'expandtab'|       |'et'|    use spaces when <Tab> is inserted
  648. |'exrc'|       |'ex'|    read .vimrc and .exrc in the current directory
  649. |'formatoptions'|  |'fo'|    how automatic formatting is to be done
  650. |'formatprg'|       |'fp'|    name of external program used with "gq" command
  651. |'gdefault'|       |'gd'|    the ":substitute" flag 'g' is default on
  652. |'guifont'|       |'gfn'|    GUI: Name(s) of font(s) to be used
  653. |'guioptions'|       |'go'|    GUI: Which components and options are used
  654. |'guipty'|            GUI: try to use a pseudo-tty for ":!" commands
  655. |'helpfile'|       |'hf'|    name of this help file
  656. |'helpheight'|       |'hh'|    minimum height of a new help window
  657. |'hidden'|       |'hid'|    don't unload buffer when it is abandoned
  658. |'highlight'|       |'hl'|    sets highlighting mode for various occasions
  659. |'history'|       |'hi'|    number of command-lines that are remembered
  660. |'hkmap'|       |'hk'|    Hebrew keyboard mapping (RIGHTLEFT)
  661. |'icon'|            set icon of the window to the name of the file
  662. |'ignorecase'|       |'ic'|    ignore case in search patterns
  663. |'include'|       |'inc'|    pattern to be used to find an include file
  664. |'incsearch'|       |'is'|    highlight match while typing search pattern
  665. |'infercase'|       |'inf'|    adjust case of match for keyword completion
  666. |'insertmode'|       |'im'|    start the edit of a file in Insert mode
  667. |'isfname'|       |'isf'|    characters included in filenames and pathnames
  668. |'isident'|       |'isi'|    characters included in identifiers
  669. |'isprint'|       |'isp'|    printable characters
  670. |'iskeyword'|       |'isk'|    characters included in keywords
  671. |'joinspaces'|       |'js'|    two spaces after a period with a join command
  672. |'keywordprg'|       |'kp'|    program to use for the "K" command
  673. |'langmap'|       |'lmap'|    alphabetic characters for other language mode
  674. |'laststatus'|       |'ls'|    tells when last window has status lines
  675. |'linebreak'|       |'lbr'|    wrap long lines at a blank
  676. |'lines'|            number of lines in the display
  677. |'lisp'|            automatic indenting for Lisp
  678. |'list'|            show <Tab> and end-of-line
  679. |'magic'|            changes special characters in search patterns
  680. |'makeprg'|       |'mp'|    program to use for the ":make" command
  681. |'maxmapdepth'|    |'mmd'|    maximum recursive depth for mapping
  682. |'maxmem'|       |'mm'|    maximum memory (in Kbyte) used for one buffer
  683. |'maxmemtot'|       |'mmt'|    maximum memory (in Kbyte) used for all buffers
  684. |'modeline'|       |'ml'|    recognize modelines at start or end of file
  685. |'modelines'|       |'mls'|    number of lines checked for modelines
  686. |'modified'|       |'mod'|    buffer has been modified
  687. |'more'|            pause listings when the whole screen is filled
  688. |'mouse'|            enable the use of mouse clicks
  689. |'mousetime'|       |'mouset'|    max time between mouse double-click
  690. |'number'|       |'nu'|    print the line number in front of each line
  691. |'paragraphs'|       |'para'|    nroff macros that separate paragraphs
  692. |'paste'|            allow pasting text
  693. |'patchmode'|       |'pm'|    keep the oldest version of a file
  694. |'path'|       |'pa'|    list of directories searched with "gf" et.al.
  695. |'readonly'|       |'ro'|    disallow writing the buffer
  696. |'remap'|            allow mappings to work recursively
  697. |'report'|            threshold for reporting nr. of lines changed
  698. |'restorescreen'|  |'rs'|    Win32: restore screen when exiting
  699. |'revins'|       |'ri'|    inserting characters will work backwards
  700. |'rightleft'|       |'rl'|    window is right-to-left oriented (RIGHTLEFT)
  701. |'ruler'|       |'ru'|    show cursor line and column in the status line
  702. |'scroll'|       |'scr'|    lines to scroll with CTRL-U and CTRL-D
  703. |'scrolljump'|       |'sj'|    minimum number of lines to scroll
  704. |'scrolloff'|       |'so'|    minimum nr. of lines above and below cursor
  705. |'sections'|       |'sect'|    nroff macros that separate sections
  706. |'secure'|            secure mode for reading .vimrc in current dir
  707. |'shell'|       |'sh'|    name of shell to use for external commands
  708. |'shellcmdflag'|   |'shcf'|    flag to shell to execute one command
  709. |'shellpipe'|       |'sp'|    string to put output of ":make" in error file
  710. |'shellquote'|       |'shq'|    quote character(s) for around shell command
  711. |'shellredir'|       |'srr'|    string to put output of filter in a temp file
  712. |'shelltype'|       |'st'|    Amiga: influences how to use a shell
  713. |'shiftround'|       |'sr'|    round indent to multiple of shiftwidth
  714. |'shiftwidth'|       |'sw'|    number of spaces to use for (auto)indent step
  715. |'shortmess'|       |'shm'|    list of flags, reduce length of messages
  716. |'shortname'|       |'sn'|    non-MS-DOS: File names assumed to be 8.3 chars
  717. |'showbreak'|       |'sbr'|    string to use at the start of wrapped lines
  718. |'showcmd'|       |'sc'|    show (partial) command in status line
  719. |'showmatch'|       |'sm'|    briefly jump to matching bracket if insert one
  720. |'showmode'|       |'smd'|    message on status line to show current mode
  721. |'sidescroll'|       |'ss'|    minimum number of columns to scroll horizontal
  722. |'smartcase'|       |'scs'|    no ignore case when pattern has uppercase
  723. |'smartindent'|    |'si'|    smart autoindenting for C programs
  724. |'smarttab'|       |'sta'|    use 'shiftwidth' when inserting <Tab>
  725. |'splitbelow'|       |'sb'|    new window from split is below the current one
  726. |'startofline'|    |'sol'|    commands move cursor to first blank in line
  727. |'suffixes'|       |'su'|    suffixes that are ignored with multiple match
  728. |'swapsync'|       |'sws'|    how to sync swapfile
  729. |'tabstop'|       |'ts'|    number of spaces that <Tab> in file uses
  730. |'taglength'|       |'tl'|    number of significant characters for a tag
  731. |'tagrelative'|    |'tr'|    filenames in tag file are relative
  732. |'tags'|       |'tag'|    list of filenames used by the tag command
  733. |'term'|            name of the terminal
  734. |'terse'|            shorten some messages
  735. |'textauto'|       |'ta'|    set 'textmode' automatically when reading file
  736. |'textmode'|       |'tx'|    lines are separated by <CR><NL>
  737. |'textwidth'|       |'tw'|    maximum width of text that is being inserted
  738. |'tildeop'|       |'top'|    tilde command "~" behaves like an operator
  739. |'timeout'|       |'to'|    time out on mappings and key codes
  740. |'ttimeout'|            time out on mappings
  741. |'timeoutlen'|       |'tm'|    time out time in milliseconds
  742. |'ttimeoutlen'|       |'ttm'|    time out time for key codes in milliseconds
  743. |'title'|            set title of window to the name of the file
  744. |'ttybuiltin'|       |'tbi'|    use built-in termcap before external termcap
  745. |'ttyfast'|       |'tf'|    indicates a fast terminal connection
  746. |'ttyscroll'|       |'tsl'|    maximum number of lines for a scroll
  747. |'ttytype'|       |'tty'|    alias for 'term'
  748. |'undolevels'|       |'ul'|    maximum number of changes that can be undone
  749. |'updatecount'|    |'uc'|    after this many characters flush swapfile
  750. |'updatetime'|       |'ut'|    after this many milliseconds flush swapfile
  751. |'viminfo'|       |'vi'|    use .viminfo file upon startup and exiting
  752. |'visualbell'|       |'vb'|    use visual bell instead of beeping
  753. |'warn'|            warn for shell command when buffer was changed
  754. |'weirdinvert'|    |'wi'|    for terminals that have weird inversion method
  755. |'whichwrap'|       |'ww'|    allow specified keys to cross line boundaries
  756. |'wildchar'|       |'wc'|    command-line character for wildcard expansion
  757. |'winheight'|       |'wh'|    minimum number of lines for the current window
  758. |'wrap'|            long lines wrap and continue on the next line
  759. |'wrapmargin'|       |'wm'|    chars from the right where wrapping starts
  760. |'wrapscan'|       |'ws'|    searches wrap around the end of the file
  761. |'writeany'|       |'wa'|    write to file with no need for "!" override
  762. |'writebackup'|    |'wb'|    make a backup before overwriting a file
  763. |'writedelay'|       |'wd'|    delay this many msec for each char (for debug)
  764. ------------------------------------------------------------------------------
  765. *X_ur*        Undo/Redo commands
  766.  
  767. |u|      N  u        undo last N changes
  768. |CTRL-R|  N  CTRL-R    redo last N undone changes
  769. |U|         U        restore last changed line
  770. ------------------------------------------------------------------------------
  771. *X_et*        External commands
  772.  
  773. |:shell|    :sh[ell]    start a shell
  774. |:!|        :!{command}    execute {command} with a shell
  775. |K|           K        lookup keyword under the cursor with
  776.                    'keywordprg' program (default: "man")
  777. ------------------------------------------------------------------------------
  778. *X_qf*        Quickfix commands
  779.  
  780. |:cc|        :cc [nr]    display error [nr] (default is the same again)
  781. |:cnext|    :cn        display the next error
  782. |:cprevious|    :cp        display the previous error
  783. |:clist|    :cl        list all errors
  784. |:cfile|    :cf        read errors from the file 'errorfile'
  785. |:cquit|    :cq        quit without writing and return error code (to
  786.                    the compiler)
  787. |:make|        :make [args]    start make, read errors, and jump to first
  788.                    error
  789. ------------------------------------------------------------------------------
  790. *X_vc*        Various commands
  791.  
  792. |CTRL-L|       CTRL-L    Clear and redraw the screen.
  793. |CTRL-G|       CTRL-G    show current file name (with path) and cursor
  794.                    position
  795. |ga|           ga        show ascii value of character under cursor in
  796.                    decimal, hex, and octal
  797. |g_CTRL-G|       g CTRL-G    show cursor column, line, and character
  798.                    position
  799. |CTRL-C|       CTRL-C    during searches: Interrupt the search
  800. |CTRL-Break|       CTRL-Break    MS-DOS: during searches: Interrupt the search
  801. |<Del>|           <Del>    while entering a count: delete last character
  802. |:version|    :ve[rsion]    show exact version number of this Vim
  803. |:mode|        :mode N        MS-DOS: set screen mode to N (number, C80,
  804.                    C4350, etc.)
  805. |:normal|    :norm[al][!] {commands}
  806.                 Execute Normal mode commands.
  807. ------------------------------------------------------------------------------
  808. *X_ce*        Command-line editing
  809.  
  810. |c_<Esc>|    <Esc>           abandon command-line (if 'wildchar' is
  811.                       <Esc>, type it twice)
  812.  
  813. |c_CTRL-V|    CTRL-V {char}       insert {char} literally
  814. |c_CTRL-V|    CTRL-V {number}    enter decimal value of character (up to
  815.                       three digits)
  816. |c_CTRL-K|    CTRL-K {char1} {char2}
  817.                    enter digraph (See |X_di|)
  818. |c_CTRL-R|    CTRL-R <0-9a-z"%:->
  819.                    insert contents of register <0-9a-z"%:->
  820.  
  821. |c_<Left>|    <Left>/<Right>       cursor left/right
  822. |c_<S-Left>|    <S-Left>/<S-Right> cursor one word left/right
  823. |c_CTRL-B|    CTRL-B/CTRL-E       cursor to beginning/end of command-line
  824.  
  825. |c_<BS>|    <BS>           delete the character in front of the cursor
  826. |c_<Del>|    <Del>           delete the character under the cursor
  827. |c_CTRL-W|    CTRL-W           delete the word in front of the cursor
  828. |c_CTRL-U|    CTRL-U           remove all characters
  829.  
  830. |c_<Up>|    <Up>/<Down>       recall older/newer command-line that starts
  831.                       with current command
  832. |c_<S-Up>|    <S-Up>/<S-Down>       recall older/newer command-line from history
  833.  
  834.     Context-sensitive completion on the command-line:
  835.  
  836. |c_wildchar|    'wildchar'  (default: <Tab>)
  837.                 do completion on the pattern in front of the
  838.                    cursor.  If there are multiple matches,
  839.                    beep and show the first one; further
  840.                    'wildchar' will show the next ones.
  841. |c_CTRL-D|    CTRL-D        list all names that match the pattern in
  842.                    front of the cursor
  843. |c_CTRL-A|    CTRL-A        insert all names that match pattern in front
  844.                    of cursor
  845. |c_CTRL-L|    CTRL-L        insert longest common part of names that
  846.                    match pattern
  847. |c_CTRL-N|    CTRL-N        after 'wildchar' with multiple matches: go
  848.                    to next match
  849. |c_CTRL-P|    CTRL-P        after 'wildchar' with multiple matches: go
  850.                    to previous match
  851. ------------------------------------------------------------------------------
  852. *X_ra*        Ex ranges
  853.  
  854. |:range|    ,        separates two line numbers
  855. |:range|    ;        idem, set cursor to the first line number
  856.                 before interpreting the second one
  857.  
  858. |:range|    {number}    an absolute line number
  859. |:range|    .        the current line
  860. |:range|    $        the last line in the file
  861. |:range|    %        equal to 1,$ (the entire file)
  862. |:range|    *        equal to '<,'> (visual area)
  863. |:range|    't        position of mark t
  864. |:range|    /{pattern}[/]    the next line where {pattern} matches
  865. |:range|    ?{pattern}[?]    the previous line where {pattern} matches
  866.  
  867. |:range|    +[num]        add [num] to the preceding line number
  868.                    (default: 1)
  869. |:range|    -[num]        subtract [num] from the preceding line
  870.                    number (default: 1)
  871. ------------------------------------------------------------------------------
  872. *X_ex*        Special Ex characters
  873.  
  874. |:bar|        |        separates two commands (not for ":global" and ":!")
  875. |:quote|    "        begins comment
  876.  
  877. |:_%|        %        current filename (only where filename is expected)
  878. |:_#|        #[number]    alternate filename [number] (only where filename is
  879.                expected)
  880.     Note: The next four are typed literally; these are not special keys!
  881. |:<cword>|  <cword>    word under the cursor (only where filename is
  882.                expected)
  883. |:<cWORD>|  <cWORD>    WORD under the cursor (only where filename is
  884.                expected) (see |WORD|)
  885. |:<cfile>|  <cfile>    file name under the cursor (only where filename is
  886.                expected)
  887. |:<afile>|  <afile>    file name for autocommand (only where filename is
  888.                expected)
  889.  
  890.             After "%", "#", "<cfile>", or "<afile>"
  891.             |::p|        :p        full path
  892.             |::h|        :h        head
  893.             |::t|        :t        tail
  894.             |::r|        :r        root
  895.             |::e|        :e        extension
  896. ------------------------------------------------------------------------------
  897. *X_ed*        Editing a file
  898.  
  899. |:edit|       :e[dit]        Edit the current file, unless changes have
  900.                    been made.
  901. |:edit!|   :e[dit]!        Edit the current file always.  Discard any
  902.                    changes.
  903. |:edit_f|  :e[dit] {file}    Edit {file}, unless changes have been made.
  904. |:edit!_f| :e[dit]! {file}    Edit {file} always.  Discard any changes.
  905. |CTRL-^|   N   CTRL-^        Edit alternate file N (equivalent to ":e #N").
  906. |gf|           gf  or ]f    Edit the file whose name is under the cursor
  907. |:pwd|       :pwd            Print the current directory name.
  908. |:cd|       :cd [path]        Change the current directory to [path].
  909. |:file|       :f[ile]        Print the current filename and the cursor
  910.                    position.
  911. |:file|       :f[ile] {name}    Set the current filename to {name}.
  912. |:files|   :files        Show alternate filenames.
  913. ------------------------------------------------------------------------------
  914. *X_fl*        Using the argument list            |argument_list|
  915.  
  916. |:args|       :ar[gs]        Print the argument list, with the current file
  917.                    in "[]".
  918. |:all|       :all  or :sall    Open a window for every file in the arg list.
  919. |:wn|       :wn[ext][!]        Write file and edit next file.
  920. |:wn|       :wn[ext][!] {file}    Write to {file} and edit next file, unless
  921.                    {file} exists.  With !, overwrite existing
  922.                    file.
  923. |:wN|       :wN[ext][!] [file]    Write file and edit previous file.
  924.  
  925.            in current window    in new window
  926. |:argument|  :argu[ment] N      :sar[gument] N    Edit file N
  927. |:next|         :n[ext]          :sn[ext]        Edit next file
  928. |:next_f|    :n[ext] {arglist}      :sn[ext] {arglist}    define new arg list
  929.                                and edit first file
  930. |:Next|         :N[ext]          :sN[ext]        Edit previous file
  931. |:rewind|    :rew[ind][!]      :srew[ind]        Edit first file
  932. |:last|         :last          :slast        Edit last file
  933. ------------------------------------------------------------------------------
  934. *X_wq*        Writing and quitting
  935.  
  936. |:w|      :[range]w[rite][!]        Write to the current file.
  937. |:w_f|      :[range]w[rite] {file}    Write to {file}, unless it already
  938.                        exists.
  939. |:w_f|      :[range]w[rite]! {file}    Write to {file}.  Overwrite an existing
  940.                        file.
  941. |:w_a|      :[range]w[rite][!] >>        Append to the current file.
  942. |:w_a|      :[range]w[rite][!] >> {file}    Append to {file}.
  943. |:w_c|      :[range]w[rite] !{cmd}    Execute {cmd} with [range] lines as
  944.                        standard input.
  945. |:wall|      :wall[!]            write all changed buffers
  946.  
  947. |:q|      :q[uit]        Quit current buffer, unless changes have been
  948.                    made.  Exit Vim when there are no other
  949.                    non-help buffers
  950. |:q|      :q[uit]!        Quit current buffer always, discard any
  951.                    changes.  Exit Vim when there are no other
  952.                    non-help buffers
  953. |:qa|      :qall            Exit Vim, unless changes have been made.
  954. |:qa|      :qall!        Exit Vim always, discard any changes.
  955. |:cq|      :cq            Quit without writing and return error code.
  956.  
  957. |:wq|      :wq[!]        Write the current file and exit.
  958. |:wq|      :wq[!] {file}        Write to {file} and exit.
  959. |:xit|      :x[it][!] [file]    Like ":wq" but write only when changes have
  960.                    been made
  961. |ZZ|         ZZ            Same as ":x".
  962. |ZQ|         ZQ            Same as ":q!".
  963. |:xall|      :xall[!]  or :wqall[!]
  964.                 Write all changed buffers and exit
  965.  
  966. |:stop|      :st[op][!]        Suspend VIM or start new shell. If 'aw' option
  967.                    is set and [!] not given write the buffer.
  968. |CTRL-Z|     CTRL-Z        Same as ":stop!"
  969. ------------------------------------------------------------------------------
  970. *X_st*        Starting VIM
  971.  
  972. |-vim|       vim [options]        start editing with an empty buffer
  973. |-file|       vim [options] {file ..}    start editing one or more files
  974. |-tag|       vim [options] -t {tag}    edit the file associated with {tag}
  975. |-qf|       vim [options] -e [fname]    start editing in QuickFix mode,
  976.                        display the first error
  977.  
  978.     Vim arguments:
  979.  
  980. |-gui|    -g            start GUI (also allows other options)
  981.  
  982. |-+|    +[num]            put the cursor at line [num] (default: last line)
  983. |-+c|    +{command}        execute {command} after loading the file
  984. |-+/|    +/{pat} {file ..}   put the cursor at the first occurrence of {pat}
  985. |-v|    -v            read-only mode (View), implies -n
  986. |-R|    -R            read-only mode, same as -v
  987. |-b|    -b            binary mode
  988. |-l|    -l            lisp mode
  989. |-H|    -H            Hebrew mode ('hkmap' and 'rightleft' are set)
  990. |-r|    -r            give list of swap files
  991. |-r|    -r {file ..}        recover aborted edit session
  992. |-n|    -n            do not create swapfile
  993. |-o|    -o [N]            open N windows (default: one for each file)
  994. |-x|    -x            Amiga: do not restart VIM to open a window (for
  995.                 e.g., mail)
  996. |-s|    -s {scriptin}        first read commands from the file {scriptin}
  997. |-w|    -w {scriptout}        write typed chars to file {scriptout} (append)
  998. |-W|    -W {scriptout}        write typed chars to file {scriptout} (overwrite)
  999. |-T|    -T {terminal}        set terminal name
  1000. |-d|    -d {device}        Amiga: open {device} to be used as a console
  1001. |-u|    -u {vimrc}        read inits from {vimrc} instead of other inits
  1002. |-i|    -i {viminfo}        read info from {viminfo} instead of other files
  1003. |--|    --            end of options, other arguments are file names
  1004. ------------------------------------------------------------------------------
  1005. *X_ac*        Automatic Commands
  1006.  
  1007. |viminfo_file|    Read registers, marks, history at startup, save when exiting.
  1008.  
  1009. |:rviminfo|    :rv[iminfo] [file]    Read info from viminfo file [file]
  1010. |:rviminfo|    :rv[iminfo]! [file]    idem, overwrite exisiting info
  1011. |:wviminfo|    :wv[iminfo] [file]    Add info to viminfo file [file]
  1012. |:wviminfo|    :wv[iminfo]! [file]    Write info to viminfo file [file]
  1013.  
  1014. |modeline|    Automatic option setting when editing a file
  1015.  
  1016. |modeline|    vim:{set-arg}: ..    In the first and last lines of the
  1017.                     file (see 'ml' option), {set-arg} is
  1018.                     given as an argument to ":set"
  1019.  
  1020. |autocommand|    Automatic execution of commands on certain events.
  1021.  
  1022. |:autocmd|    :au            List all autocommands
  1023. |:autocmd|    :au {event}        List all autocommands for {event}
  1024. |:autocmd|    :au {event} {pat}    List all autocommands for {event} with
  1025.                     {pat}
  1026. |:autocmd|    :au {event} {pat} {cmd}    Enter new autocommands for {event}
  1027.                     with {pat}
  1028. |:autocmd|    :au!            Remove all autocommands
  1029. |:autocmd|    :au! {event}        Remove all autocommands for {event}
  1030. |:autocmd|    :au! * {pat}        Remove all autocommands for {pat}
  1031. |:autocmd|    :au! {event} {pat}    Remove all autocommands for {event}
  1032.                     with {pat}
  1033. |:autocmd|    :au! {event} {pat} {cmd}  Remove all autocommands for {event}
  1034.                     with {pat} and enter new one
  1035. ------------------------------------------------------------------------------
  1036. *X_wi*        Multi-window functions
  1037.  
  1038. |CTRL-W_s|    CTRL-W s  or  :split    Split window into two parts
  1039. |:split_f|    :split {file}        Split window and edit {file} in one of
  1040.                        them
  1041. |CTRL-W_]|    CTRL-W ]        Split window and jump to tag under
  1042.                        cursor
  1043. |CTRL-W_f|    CTRL-W f        Split window and edit file name under
  1044.                        the cursor
  1045. |CTRL-W_CTRL-^| CTRL-W CTRL-^        Split window and edit alternate file
  1046. |CTRL-W_n|    CTRL-W n  or  :new    Create new empty window
  1047. |CTRL-W_q|    CTRL-W q  or  :q[uit]    Quit editing and close window
  1048. |CTRL-W_c|    CTRL-W c  or  :cl[ose]    Make buffer hidden and close window
  1049. |CTRL-W_o|    CTRL-W o  or  :on[ly]    Make current window only one on the
  1050.                        screen
  1051.  
  1052. |CTRL-W_j|    CTRL-W j        Move cursor to window below
  1053. |CTRL-W_k|    CTRL-W k        Move cursor to window above
  1054. |CTRL-W_CTRL-W|    CTRL-W CTRL-W        Move cursor to window below (wrap)
  1055. |CTRL-W_W|    CTRL-W W        Move cursor to window above (wrap)
  1056. |CTRL-W_t|    CTRL-W t        Move cursor to top window
  1057. |CTRL-W_b|    CTRL-W b        Move cursor to bottom window
  1058. |CTRL-W_p|    CTRL-W p        Move cursor to previous active window
  1059.  
  1060. |CTRL-W_r|    CTRL-W r        Rotate windows downwards
  1061. |CTRL-W_R|    CTRL-W R        Rotate windows upwards
  1062. |CTRL-W_x|    CTRL-W x        Exchange current window with next one
  1063.  
  1064. |CTRL-W_=|    CTRL-W =        Make all windows equal height
  1065. |CTRL-W_-|    CTRL-W -        Decrease current window height
  1066. |CTRL-W_+|    CTRL-W +        Increase current window height
  1067. |CTRL-W__|    CTRL-W _        Set current window height (default:
  1068.                        very high)
  1069. ------------------------------------------------------------------------------
  1070. *X_bu*        Buffer list functions
  1071.  
  1072. |:buffers|    :buffers  or  :files    list all known buffer and file names
  1073.  
  1074. |:ball|        :ball      or  :sball    edit all args/buffers
  1075. |:unhide|    :unhide   or  :sunhide    edit all loaded buffers
  1076.  
  1077. |:bunload|    :bunload[!] [N]        unload buffer [N] from memory
  1078. |:bdelete|    :bdelete[!] [N]        unload buffer [N] and delete it from
  1079.                        the buffer list
  1080.  
  1081.             in current window   in new window
  1082. |:buffer|     :[N]buffer [N]      :[N]sbuffer [N]     to arg/buf N
  1083. |:bnext|      :[N]bnext [N]      :[N]sbnext [N]      to Nth next arg/buf
  1084. |:bNext|      :[N]bNext [N]      :[N]sbNext [N]      to Nth previous arg/buf
  1085. |:bprevious|  :[N]bprevious [N]   :[N]sbprevious [N]  to Nth previous arg/buf
  1086. |:brewind|    :brewind          :sbrewind          to first arg/buf
  1087. |:blast|      :blast          :sblast          to last arg/buf
  1088. |:bmodified|  :[N]bmod [N]      :[N]sbmod [N]          to Nth modified buf
  1089. ------------------------------------------------------------------------------
  1090. *bars*        Bars example
  1091.  
  1092. Now that you've jumped here with CTRL-], g<LeftMouse>, or <C-LeftMouse>, you
  1093. can use CTRL-T, g<RightMouse>, or <C-RightMouse> to go back to where you were.
  1094. ------------------------------------------------------------------------------
  1095.  
  1096.             *www* *faq* *FAQ* *ftp* *distribution* *download*
  1097.  
  1098. The Vim pages contain the most recent information about Vim.  They also
  1099. contains links to the most recent version of Vim.  The FAQ is a list of
  1100. Frequently Asked Questions, read this if you have problems.
  1101.  
  1102.     VIM home page:    <URL:http://www.math.fu-berlin.de/~guckes/vim/>
  1103.     VIM FAQ:    <URL:http://www.grafnetix.com/~laurent/vim/>
  1104.  
  1105. Bug reports:                            *bugs*
  1106.     Bram Moolenaar <mool@oce.nl>
  1107. Please be brief; all the time that is spend on answering mail is subtracted
  1108. from the time that is spent on improving Vim!  Always give a reproducible
  1109. example and try to find out which settings or other things influence the
  1110. appearance of the bug.  Try different machines, if possible.  Send me patches
  1111. if you can!  In case of doubt, include the output of these commands:
  1112.     :version
  1113.     :!uname -a    " Unix only
  1114.     :map
  1115.     :map!
  1116.     :au
  1117.     :set all
  1118.     :set termcap
  1119.  
  1120. Usenet News group where Vim is discussed:        *news* *usenet*
  1121.     comp.editors
  1122.  
  1123.                             *vimdev* *mail_list*
  1124. There are three mailing lists for Vim:
  1125. <vim@prz.tu-berlin.de>        For discussions about using existing versions
  1126.                 of Vim: Useful mappings, questions, answers,
  1127.                 where to get a specific version, etc.
  1128. <vimdev@prz.tu-berlin.de>    For discussions about changing Vim: New
  1129.                 features, porting, etc.
  1130. <vimannounce@prz.tu-berlin.de>    Announcements about new versions of Vim; also
  1131.                 beta-test versions and ports to different
  1132.                 systems.
  1133.  
  1134. NOTE:
  1135. - You can only send messages to these lists if you have subscribed!
  1136. - You need to send the messages from the same location as where you subscribed
  1137.   from (yes, Majordomo is inflexible).
  1138. - Maximum message size is 40000 characters.
  1139.  
  1140. If you want to join, send a message to
  1141.     <majordomo@prz.tu-berlin.de>
  1142. and put "info" in the body.  Then Majordomo will give you a little help.
  1143.  
  1144. An archive is kept at:
  1145. <URL:ftp://ftp.ii.uib.no/pub/vim/mail-archive/vim/maillist.html>
  1146. <URL:ftp://ftp.ii.uib.no/pub/vim/mail-archive/vimdev/maillist.html>
  1147. <URL:ftp://ftp.ii.uib.no/pub/vim/mail-archive/vimannounce/maillist.html>
  1148. <URL:http://www.findmail.com/listsaver/vimannounce.html>
  1149.  
  1150. *credits* *author*
  1151.  
  1152. Most of Vim was written by Bram Moolenaar <mool@oce.nl>.
  1153.  
  1154. Parts of the documentation come from several Vi manuals, written by:
  1155.     W.N. Joy
  1156.     Alan P.W. Hewett
  1157.     Mark Horton
  1158.  
  1159. The Vim editor is based on Stevie and includes (ideas from) other software,
  1160. worked on by the people mentioned here.  Other people helped by giving me
  1161. suggestions and discussing what is good and bad in Vim.
  1162.  
  1163.     Tony Andrews        Stevie
  1164.     Gert van Antwerpen    changes for DJGPP on MS-DOS
  1165.     Berkeley DB(3)        ideas for swapfile
  1166.     Keith Bostic        Nvi
  1167.     Ralf Brown        SPAWNO library for MS-DOS
  1168.     Robert Colon        many useful remarks
  1169.     Kayhan Demirel        sent me news in Uganda
  1170.     Chris & John Downey    xvi (ideas for multi-windows version)
  1171.     Eric Fischer        Mac port, 'cindent', and other improvements
  1172.     Bill Foster        Athena GUI port
  1173.     Loic Grenie        xvim (ideas for multi windows version)
  1174.     Steve Kirkendall    Elvis
  1175.     Sergey Laskavy        Vim's help from Moscow
  1176.     Avner Lottem        Edit in right-to-left windows (RIGHTLEFT)
  1177.     George V. Reilly    Win32 port
  1178.     Stephen Riehm        bug collector
  1179.     Olaf Seibert        DICE version and regexp improvements
  1180.     Peter da Silva        termlib
  1181.     Paul Slootman        OS/2 port
  1182.     Henry Spencer        regular expressions
  1183.     Tim Thompson        Stevie
  1184.     G. R. (Fred) Walter    Stevie
  1185.     Robert Webb        Command-line completion, GUI version, and lots
  1186.                 of patches
  1187.     Juergen Weigert        Lattice version, AUX improvements, UNIX and
  1188.                 MS-DOS ports, autoconf
  1189.  
  1190. I wish to thank all the people that sent me bug reports and suggestions.  The
  1191. list is too long to mention them all here.  Vim would not be the same without
  1192. the ideas from all these people: they keep Vim alive!
  1193.  
  1194.  vim:ts=8:sw=8:js:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":
  1195.