home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d591 / vim.lha / Vim / index < prev    next >
Text File  |  1992-01-31  |  15KB  |  455 lines

  1. index of vim commands for
  2.  1. insert mode
  3.  2. VI commands (normal mode)
  4.  3. command line editing
  5.  4. EX commands
  6.  
  7.  
  8. 1. INSERT MODE
  9. ==============
  10.  
  11. char        action
  12. -----------------------------------------------------------------------
  13. ^@        insert previously inserted text and stop insert {vi: up to 128
  14.         chars}
  15. ^D        delete indent after auto-indent, character before the cursor
  16.         otherwise {vi: only after auto-indent}
  17. ^E        insert the character which is below the cursor
  18. ^H <BS>        delete character before the cursor {vi: does not cross lines,
  19.         does not delete autoindents}
  20. ^J <LF>        begin new line
  21. ^M <CR>        begin new line
  22. ^R        insert the character which is above the cursor
  23. ^T        insert indent after auto-indent, TAB otherwise {vi: no TAB}
  24. ^U        delete all entered characters in the current line
  25. ^V        insert next character literally
  26. ^W        delete word before the cursor
  27. ^[ <ESC>    end insert mode
  28.  
  29.  
  30. 2. VI COMMANDS
  31. ==============
  32.  
  33. CHAR means non-blank char
  34. WORD means sequences of non-blank chars
  35. N is number entered before the command
  36. <move> is a cursor movement command
  37. Nmove is the text that is moved over with a cursor movement command
  38. SECTION is a section that possibly starts with '}' instead of '{'
  39.  
  40. note: 1 = cursor movement command; 2 = can be undone/redone
  41.  
  42. char        note    vim normal mode (vi: what the unix vi does)
  43. ------------------------------------------------------------------------------
  44. ^@            error
  45. ^A            error
  46. ^B            scroll N screens Backwards
  47. ^C            interrupt current (search) command
  48. ^D            scroll Down N lines (default: half a screen)
  49. ^E            scroll N lines upwards (N lines Extra)
  50. ^F        1    scroll N screens Forward
  51. ^G            display current file name and position
  52. ^H <BS>        1    cursor N chars to the left
  53. ^I <TAB>        error
  54. ^J <LF>        1    cursor N lines downward
  55. ^K            error
  56. ^L            redraw screen
  57. ^M <CR>        1    cursor to the first CHAR N lines lower
  58. ^N        1    cursor N lines downward
  59. ^O            error
  60. ^P        1    cursor N lines upward
  61. ^Q            error
  62. ^R        2    redo changes which were undone with 'u' (vi: no redo)
  63. ^S            error
  64. ^T            error
  65. ^U            scroll N lines Upwards (default: half a screen)
  66. ^V            error
  67. ^W            error
  68. ^X            error
  69. ^Y            scroll N lines downwards
  70. ^Z            error (vi: suspend program)
  71. ^[ <ESC>        error
  72. ^\            error
  73. ^]            :ta to ident under cursor
  74. ^^            edit Nth alternate file (equivalent to :e #N)
  75. ^_            error
  76. <SPACE>        1    cursor N chars to the right
  77. !<move><filter>        filter Nmove text through the "filter" command
  78. !!<filter>        filter N lines through the "filter" command
  79. "<a-zA-Z0-9>        use buffer <a-zA-Z0-9> for next delete, yank or put
  80.             (upper case to append)
  81. #        1    search backward for the Nth occurrence of the ident under
  82.             the cursor {not in vi}
  83. $        1    cursor to the end of line N from the cursor
  84. %        1    find the next (curly/square) bracket on this line and go
  85.             to its match
  86. &        2    repeat last :s
  87. '<a-z>        1    cursor to the first CHAR on the line with mark <a-z>
  88. ''        1    cursor to the first CHAR of the line where the cursor was
  89.             before the latest jump.
  90. (        1    cursor N sentences backward
  91. )        1    cursor N sentences forward
  92. *        1    search forward for the Nth occurrence of the ident under
  93.             the cursor {not in vi}
  94. +        1    cursor to the first CHAR N lines lower
  95. ,        1    repeat latest f, t, F or T in opposite direction N times
  96. -        1    cursor to the first CHAR N lines higher
  97. .        2    repeat last change with count replaced by N
  98. /<pattern>    1    search forward for the Nth occurrence of <pattern>
  99. 0        1    cursor to the first char of the line
  100. 1            prepend to command to give a count
  101. 2            "
  102. 3            "
  103. 4            "
  104. 5            "
  105. 6            "
  106. 7            "
  107. 8            "
  108. 9            "
  109. :            Ex command (see below)        
  110. ;        1    repeat latest f, t, F or T N times
  111. <<move>        2    shift the Nmove lines one shiftwidth leftwards
  112. <<        2    shift N lines one shiftwidth leftwards
  113. =<move>        2    filter Nmove lines through "indent" (vi: when option
  114.             'lisp' is set autoindent Nmove lines)
  115. ==        2    filter N lines through "indent"
  116. ><move>        2    shift Nmove lines one shiftwidth rightwards
  117. >>        2    shift N lines one shiftwidth rightwards
  118. ?<pattern>    1    search backward for the Nth previous occurrence of
  119.             <pattern>
  120. @<a-z>        2    execute the contents of named buffer <a-z> N times
  121. @@        2    repeat the previous @<a-z> N times
  122. A        2    append text at the end of the line N times
  123. B        1    cursor N WORDS backward
  124. <"x>C        2    change from the cursor position to the end of the line,
  125.             and N-1 more lines [into buffer x]; synonym for c$
  126. <"x>D        2    delete the characters under the cursor until the end of
  127.             the line and N-1 more lines [into buffer x]; synonym for d$
  128. E        1    cursor forward to the end of WORD N
  129. F<char>            cursor to the Nth occurrence of <char> to the left
  130. G        1    cursor to line N, default last line
  131. H        1    cursor to line N from top of screen
  132. I        2    insert text before the first CHAR on the line N times
  133. J        2    Join N lines; default is 2
  134. K            error
  135. L        1    cursor to line N from bottom of screen
  136. M        1    cursor to middle line of screen
  137. N        1    repeat the latest '/' or '?' N times in opposite
  138.             direction
  139. O        2    begin a new line above the cursor and insert text, repeat
  140.             N times (vi: blank N screen lines)
  141. <"x>P        2    put the text [from buffer x] before the cursor N times
  142. Q            error (vi: go to Ex mode)
  143. R        2    enter replace mode: overtype existing characters, repeat the
  144.             entered text N-1 times
  145. <"x>S        2    delete N lines [into buffer x] and start insert; synonym
  146.             for ^cc or 0cc, depending on autoindent
  147. T<char>        1    cursor till after Nth occurrence of <char> to the left
  148. U        2    undo all latest changes on one line (vi: while not moved
  149.             off of it)
  150. V            error
  151. W        1    cursor N WORDS forward
  152. <"x>X        2    delete N characters before the cursor [into buffer x]
  153. <"x>Y            yank N lines [into buffer x]; synonym for yy
  154. ZZ            store current file, if modified, and exit        
  155. [[        1    cursor N sections backward
  156. []        1    cursor N SECTIONS backward
  157. \            error
  158. ]]        1    cursor N sections forward
  159. ][        1    cursor N SECTIONS forward
  160. ^        1    cursor to the first CHAR of the line
  161. _        1    cursor to the first CHAR N - 1 lines lower
  162. `<a-z>        1    cursor to the mark <a-z>
  163. ``        1    cursor to the position before latest jump
  164. a        2    append text after the cursor N times
  165. b        1    cursor N words backward
  166. <"x>c<move>    2    delete Nmove text [into buffer x] and start insert
  167. <"x>cc        2    delete N lines [into buffer x] and start insert
  168. <"x>d<move>    2    delete Nmove text [into buffer x]
  169. <"x>dd        2    delete N lines [into buffer x]
  170. e        1    cursor forward to the end of word N
  171. f<char>        1    cursor to Nth occurrence of <char> to the right
  172. g            error
  173. h        1    cursor N chars to the left
  174. i        2    insert text before the cursor N times
  175. j        1    cursor N lines downward
  176. k        1    cursor N lines upward
  177. l        1    cursor N chars to the right
  178. m<a-z>            set mark <a-z> at cursor position        
  179. n        1    repeat the latest '/' or '?' N times
  180. o        2    begin a new line below the cursor and insert text, repeat
  181.             N times (vi: blank N screen lines)
  182. <"x>p        2    put the text [from buffer x] after the cursor N times
  183. q            error
  184. r<char>        2    replace N chars by <char>
  185. <"x>s        2    (substitute) delete N characters [into buffer x] and
  186.             start insert
  187. t<char>        1    cursor till before Nth occurrence of <char> to the right
  188. u        2    undo changes (vi: only one level)
  189. v<a-zA-Z>        record typed characters into named buffer <a-zA-Z>
  190.             (upper case to append)
  191. v            stops recording (vi: no recording)
  192. w        1    cursor N words forward
  193. <"x>x        2    delete N characters under and after the cursor [into
  194.             buffer x]
  195. <"x>y<move>        yank Nmove text [into buffer x]
  196. <"x>yy            yank N lines [into buffer x]
  197. z<CR>            redraw, cursor line to top of window        
  198. z.            redraw, cursor line to center of window
  199. z-            redraw, cursor line at bottom of window
  200. {        1    cursor N paragraphs backward
  201. |        1    cursor to column N
  202. }        1    cursor N paragraphs forward
  203. ~        2    option notildeop: switch case of N characters under
  204.             cursor and move the cursor N characters to the right
  205.             (vi: no count)
  206. ~<move>            option tildeop: switch case of Nmove text (vi: no tildeop
  207.             option)
  208. <DEL>            when entering a number: remove the last digit
  209. <HELP>            show the file vim:vim.hlp page by page (vi: no help)
  210. <C_UP>        1    move cursor N lines upwards
  211. <C_DOWN>    1    move cursor N lines downwards
  212. <C_LEFT>    1    move cursor N chars to the left
  213. <C_RIGHT>    1    move cursor N chars to the right
  214.  
  215.  
  216. 3. command line editing
  217. =======================
  218.  
  219. Get to the command line with the ':', '!', '/' or '?' commands.
  220. Normal characters are inserted at the current cursor position.
  221. (vi: can only alter last character in the line)
  222.  
  223. ^D        list filenames that match the pattern in front of the cursor
  224. ^H        delete the character in front of the cursor
  225. ^V        insert next character literally {Vi: type the CTRL-V twice to
  226.                 get one}
  227. <ESC>           do filename completion on the pattern in front of the cursor
  228. @        remove all characters
  229. <DEL>        delete the character under the cursor
  230. <C_UP>        recall previous command line from history
  231. <C_DOWN>    recall next command line from history
  232. <C_LEFT>    cursor left
  233. <C_RIGHT>    cursor right
  234. <SC_LEFT>    cursor one word left
  235. <SC_RIGHT>    cursor one word right
  236.  
  237.  
  238. 4. EX commands
  239. ==============
  240.  
  241. lines that start with " or # are ignored
  242.  
  243. <range> stands for a series of line specifiers, separated with ',' or ';'.
  244. When separated with ';' the cursor position will be set to that line before
  245. interpreting the next line specifier.
  246. The default line specifier (for most commands) is the Cursor position.
  247. line numbers may be specified with:
  248.     <number>    the absolute line number
  249.     .        the current line
  250.     $        the last line in the file
  251.     %        equal to 1,$ (the entire file)
  252.     't        position of mark t
  253.     /<pattern>    the next line where <pattern> matches
  254.     ?<pattern>    the previous line where <pattern> matches
  255. Each may be followed (several times) by '+' or '-' and an optional number.
  256. This number is added or subtracted from the preceding line number.
  257. if the number is omitted, 1 is used.
  258. Examples:
  259.     .+3        three lines below the cursor
  260.     /that+1        the line below the next line containing "that"
  261.     .,$        from current line until end of file
  262.  
  263. In the commands below the characters in square brackets are optional.
  264.  
  265. :<range>        set the cursor on the (last) specified line number
  266.  
  267. :a[ppend]        {vi: append text}
  268.  
  269. :ar[gs]            print the file list, with the current file in []
  270.  
  271. :cc [nr]        Display error [nr] (default is same error)
  272.  
  273. :cd            print the current directory name {vi: not}
  274. :cd <path>        change the current directory to <path>
  275.  
  276. :cf            read error file (from errorfile option)
  277.  
  278. :c[hange]        {vi: replace lines}
  279.  
  280. :ch[dir]        same as :cd
  281.  
  282. :cn            display next error
  283.  
  284. :co[py]            {vi: copy lines}
  285.  
  286. :cp            display previous error
  287.  
  288. :cq            Quit without writing and return an error code
  289.  
  290. :[<range>]d[elete] ["x] [count]
  291.             delete <range> lines (default: current line)
  292.  
  293. :di[splay]        display the contents of numbered and named buffers
  294.             {vi: no such command}
  295.  
  296. :e[dit] [file]        edit 'file' (default: current file), unless changes have
  297.             been made {vi: allow +n to start at certain position}
  298. :e[dit]! [file]        edit 'file' (default: current file) always
  299.  
  300. :ex            same as :edit
  301.  
  302. :f[ile]            prints the current file name and some more info
  303. :f[ile] <name>        sets current file name to <name>
  304. :files            lists the alternate file names
  305.  
  306. :<range>g[lobal]/<pattern>/<cmd>
  307.             execute the EX command <cmd> on the lines where <pattern>
  308.             matches
  309. :<range>g[lobal]!/<pattern>/<cmd>
  310.             execute the EX command <cmd> on the lines where <pattern>
  311.             does not match
  312.  
  313. :h[elp]            show the file vim:vim.hlp page by page {vi: no help}
  314.  
  315. :i[nsert]        {vi: insert text}
  316.  
  317. :j[oin]            {vi: join lines}
  318.  
  319. :k            {vi: synonym for mark without a space}
  320.  
  321. :l[ist]            {vi: list lines}
  322.  
  323. :ma[p] <lhs> <rhs>    map the key sequence <lhs> to <rhs> in normal mode
  324. :ma[p]! <lhs> <rhs>    map the key sequence <lhs> to <rhs> in insert mode
  325.  
  326. :mar[k]            {vi: mark line}
  327.  
  328. :mk[exrc]        {vi: write options to .exrc file}
  329.  
  330. :m[ove]            {vi: move lines}
  331.  
  332. :n[ext]            edit next file, unless changes have been made
  333. :n[ext]!        edit next file
  334. :n[ext] <filelist>    define <filelist> as the new list of files and edit
  335.             the first one, unless changes have been made
  336. :n[ext]! <filelist>    define <filelist> as the new list of files and edit
  337.             the first one {vi: +command to start editing at a
  338.             specified position}
  339.  
  340. :nu[mber]        {vi: print specified lines with their line number}
  341.  
  342. :N[ext]            edit previous file in file list, unless changes have
  343.             been made
  344. :N[ext]!        edit previous file in file list
  345.  
  346. :o[pen]            {vi: start editing in open mode}
  347.  
  348. :pres[erve]        {vi: emergency exit}
  349.  
  350. :<range>p[rint]        print the specified lines
  351.  
  352. :pu[t] ["x]        insert text from buffer ["x]
  353.  
  354. :pr[evious]        same as :Next
  355.  
  356. :q[uit]         quit, unless changes have been made
  357. :q[uit]!        quit always, without writing
  358.  
  359. :r[ead] <name>        insert the file <name> below the cursor
  360. :r[ead]!<cmd>        excute <cmd> and insert its standard output below the
  361.             cursor
  362.  
  363. :rec[over]        {vi: recover a file after a crash or :preserve}
  364.  
  365. :rew[ind]        start editing the first file in the file list, unless
  366.             changes have been made
  367. :rew[ind]!        start editing the first file in the file list
  368.  
  369. :se[t]            show all modified options {vi: non-default options}
  370. :se[t] all        show all options
  371. :se[t] <option>        set toggle option on, show value of string or number
  372.             option
  373. :se[t] no<option>    set toggle option off
  374. :se[t] <option>=<value> set string or number option to <value>
  375. :se[t] <option>?    show value of <option>
  376.  
  377. :sh[ell]        escape to a shell {vi: shell name from option 'shell'}
  378.  
  379. :so[urce] <file>    read EX commands from <file>
  380. :so[urce]! <file>    read VI commands from <file> {vi: not}
  381.  
  382. :st[op]            {vi: suspend the editor}
  383.  
  384. :<range>s[ubstitute]/<pattern>/<string>/<option>
  385.             for each line in <range> replace the first occurrence of
  386.             <pattern> by <string>; with <option> 'g' all occurrences
  387.             on the line are replaced; with <option> 'c' each
  388.             replace has to be confirmed
  389. :<range>s[ubstitute]    repeat last :substitute
  390.  
  391. :t            {vi: synonym for copy}
  392.  
  393. :ta[g] <ident>        search for <indent> in the tags file and execute
  394.             the accompanying command, unless changes have been made
  395. :ta[g]! <ident>        search for <indent> in the tags file and execute
  396.             the accompanying command
  397.  
  398. :una[bbreviate]        {vi: remove from abbreviation list}
  399.  
  400. :u[ndo]            undo last change
  401.  
  402. :unm[ap] <lhs>        remove the mapping of <lhs> for normal mode
  403. :unm[ap]! <lhs>        remove the mapping of <lhs> for insert mode
  404.  
  405. :ve[rsion]        print the version number of the editor
  406.  
  407. :<range>v[global]/<pattern>/<cmd>
  408.             execute the EX command <cmd> on the lines where <pattern>
  409.             does not match
  410.  
  411. :vi[sual]        {vi: switch from EX or open to visual mode}
  412.  
  413. :wi[nsize] <width> <height>
  414.             Set effective window size to <width> columns and <height>
  415.             rows. Does not change actual window size. Should only be
  416.             used from script files. {vi: not}
  417.  
  418. :<range>w[rite][!]    write the specified lines to the current file
  419. :<range>w[rite]    <file>    write the specified lines to <file>, unless it
  420.             already exists
  421. :<range>w[rite]! <file>    write the specified lines to <file>
  422. :<range>w[rite][!] >>    append the specified lines to the current file
  423. :<range>w[rite][!] >> <file>
  424.             append the specified lines to <file>
  425. :<range>w[rite] !<cmd>    execute <cmd> with <range> lines as standard input
  426.  
  427. :wq            write the current file and exit if no more files
  428. :wq!            write the current file and exit
  429. :wq <file>        write to <file> and exit if no more files
  430. :wq! <file>        write to <file> and exit
  431.  
  432. :x[it][!] [file]    same as :wq, but write only when changes have been made
  433.  
  434. :y[ank] ["x]        copy lines into buffer ["x]
  435.  
  436. :z            {vi: print some lines}
  437.  
  438. :![!]<cmd> [!][<arg>]    execute <cmd> with the shell, replace the optional bangs
  439.             with the previously given command, append the optional
  440.             <arg>
  441. :<range>![!]<cmd> [!][<arg>]
  442.             filter <range> lines through <cmd>, replace the optional bangs
  443.             with the previously given command, append the optional
  444.             <arg>
  445.  
  446. :<            shift left
  447.  
  448. :>            shift right
  449.  
  450. :=            print the line number
  451.  
  452. :&            same as :substitute
  453.  
  454. :~            {vi: do a substitute on the previous regular expression}
  455.