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