home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / textedit / vim.zip / VIM.HLP < prev    next >
Text File  |  1993-04-08  |  21KB  |  447 lines

  1.         VIM help file index
  2.  
  3. RETURN    quit help        VIM stands for Vi IMitation.
  4. SPACE    one page forward    Most of VIM was made by Bram Moolenaar.
  5.     a    go to this index    VIM is based on Stevie, worked on by: Tim
  6.     b    one page backward       Thompson, Tony Andrews, G.R. (Fred) Walter
  7.  
  8. c   left-right and up-down motions   n     key mapping; option commands
  9. d   word and text object motions     o     options a-l
  10. e   pattern searches             p     options l-s
  11. f   various motions; using tags      q     options s-z
  12. g   scrolling                 r     undo; shell; quickfix; various
  13. h   inserting text; digraphs         s     command line editing; Ex characters
  14. i   insert mode              t     Ex ranges
  15. j   changing text             u     editing files; using the file list
  16. k   complex changes             v     writing and quitting
  17. l   deleting, copying, moving text   w     starting VIM
  18. m   repeating commands
  19.  
  20. Read "reference.doc" for a more complete explanation.
  21. Left-right motions
  22. N  h        left (same as CTRL-H, BS and cursor-left key)
  23. N  l        right (same as SPACE and cursor-right key)
  24.    0        to first character in the line
  25.    ^        to first non-blank character in the line
  26. N  $        to the last character in the line (N-1 lines lower)
  27. N  |        to column N
  28. N  f<char>    to the Nth occurrence of <char> to the right
  29. N  F<char>    to the Nth occurrence of <char> to the left
  30. N  t<char>    till before the Nth occurrence of <char> to the right
  31. N  T<char>    till before the Nth occurrence of <char> to the left
  32. N  ;        repeat the last f, F, t or T N times
  33. N  ,        repeat the last f, F, t or T N times in opposite direction
  34.  
  35. Up-down motions
  36. N  k        up (same as CTRL-P and cursor-up key)
  37. N  j        down (same as CTRL-J, CTRL-N, LF and cursor-down key)
  38. N  -        up, on the first non-blank character
  39. N  +        down, on the first non-blank char. (same as CTRL-M and CR)
  40. N  _        N - 1 lines down, on the first non-blank character
  41. N  G        goto line N (default last line), on the first non-blank char.
  42. N  %        goto line N percentage down in the file.
  43. Word motions
  44. N  w        N words forward
  45. N  W        N blank-separated words forward
  46. N  e        forward to the end of the Nth word
  47. N  E        forward to the end of the Nth blank-separated word
  48. N  b        N words backward
  49. N  B        N blank-separated words backward
  50.  
  51. Text object motions
  52. N  )        N sentences forward
  53. N  (        N sentences backward
  54. N  }        N paragraphs forward
  55. N  {        N paragraphs backward
  56. N  ]]        N sections forward
  57. N  [[        N sections backward
  58. N  ][        N sections (starting with a <}>) forward
  59. N  []        N sections (starting with a <}>) backward
  60.  
  61. Pattern searches
  62. N  /{pattern}[/]    search forward for the Nth occurrence of {pattern}
  63. N  ?{pattern}[?]    search backward for the Nth occurrence of {pattern}
  64. N  /            repeat last search, in the forward direction
  65. N  ?            repeat last search, in the backward direction
  66. N  n            repeat last search
  67. N  N            repeat last search, in opposite direction
  68. N  *            search forward for the ident under the cursor
  69. N  #            search backward for the ident under the cursor
  70.  
  71. special characters in search patterns      magic    nomagic
  72.        matches any single character         .          \.
  73.           matches start of line         ^          ^
  74.             matches end of line         $          $
  75.           matches start of word         \<          \<
  76.             matches end of word         \>          \>
  77.    matches a single char from the range         [a-z]      \[a-z]
  78.  matches a single char not in the range         [^a-z]      \[^a-z]
  79. matches 0 or more of the preceding atom         *          \*
  80. matches 1 or more of the preceding atom         \+          \+
  81.    matches 0 or 1 of the preceding atom         \?          \?
  82.          separates two branches         \|          \|
  83.        group a pattern into an atom         \(\)      \(\)
  84. Various motions
  85.    m<a-zA-Z>    mark current position with mark <a-zA-Z>
  86.    `<a-zA-Z>    go to mark <a-zA-Z>
  87.    ``        go to the position before the last jump
  88.    `[ or `]    go to the start or end of the previously operated or put text
  89.    '<a-zA-Z[]'>    same as `, but on the first non-blank in the line
  90. :marks        print the active marks
  91. N  CTRL-O    go to N older position in jump list
  92. N  CTRL-I    go to N newer position in jump list
  93. :jumps        print the jump list
  94.    %        find the next brace or bracket in this line, go to its match
  95. N  H        go to the Nth line in the window, on the first non-blank
  96.    M        go to the middle line in the window, on the first non-blank
  97. N  L        go to the Nth line from the bottom, on the first non-blank
  98.  
  99. Using tags
  100. :ta[g] {tag}        Jump to tag {tag}, unless changes have been made.
  101. :ta[g]! {tag}        Jump to tag {tag} always. Discard any changes.
  102.    CTRL-]        ":ta" to the identifier under cursor.
  103. N  CTRL-T        Jump to N older tag in tag list
  104. :[count]po[p][!]    Jump to [count] older tag in tag list
  105. :[count]ta[g][!]    Jump to [count] newer tag in tag list
  106. :tags            Print tag list
  107. Scrolling
  108. N  CTRL-E    window N lines downwards (N lines Extra)
  109. N  CTRL-D    window N lines Downwards (default half a window)
  110. N  CTRL-F    window N pages Forwards (downwards)
  111. N  CTRL-Y    window N lines upwards
  112. N  CTRL-U    window N lines Upwards (default half a window)
  113. N  CTRL-B    window N pages Backwards (upwards)
  114.    z<CR>    redraw, current line at top of window
  115.    z.        redraw, current line at center of window
  116.    z-        redraw, current line at bottom of window
  117. Inserting text
  118. N  a        append text after the cursor (N times)
  119. N  A        append text at the end of the line (N times)
  120. N  i        insert text before the cursor (N times)
  121. N  I        insert text before the first non-blank in the line (N times)
  122. N  o        open a new line below the current line, append text (N times)
  123. N  O        open a new line above the current line, append text (N times)
  124.  
  125. Special inserts
  126. :r {file}    insert the contents of {file} below the cursor
  127. :r!{command}    insert the standard output of {command} below the cursor
  128.  
  129. Digraphs
  130. :dig[raph]    show current list of digraphs
  131. :dig[raph] {char1}{char2} {number} ...
  132.         add digraph(s) to the list
  133. char         action in insert mode
  134. CTRL-[ or <ESC>    end insert or replace mode, back to command mode
  135. CTRL-A        insert previously inserted text
  136. CTRL-B <0-9a-z> insert contents of register <0-9a-z>
  137. CTRL-@        insert previously inserted text and stop insert
  138. CTRL-J or <LF> or CTRL-M or <CR>   begin new line
  139. CTRL-K {char1} {char2}    enter digraph
  140. CTRL-R        insert the character which is above the cursor
  141. CTRL-E        insert the character which is below the cursor
  142. CTRL-V        insert character literally, or enter decimal byte value
  143. CTRL-H or <BS> or <DEL> delete the character before the cursor
  144. CTRL-W        delete word before the cursor
  145. CTRL-U        delete all entered characters in the current line
  146. CTRL-T        insert one shiftwidth of indent in the current line
  147. CTRL-D        delete one shiftwidth of indent in the current line
  148. {char1} <BS> {char2}    enter digraph
  149.     keys that stop insert, do something and get back to insert:
  150. cursor keys    move cursor left/right/up/down
  151. shift-up    one screenfull backward
  152. shift-down    one screenfull forward
  153. shift-left    one word left
  154. shift-right    one word right
  155. CTRL-O        execute one command
  156. Changing text
  157. N  R        enter replace mode (repeat the entered text N times)
  158. N  c{motion}    change the text that is moved over with {motion}
  159. {quote}c    change the quoted text
  160. N  cc        change N lines
  161. N  C        change to end of line (and N-1 more lines)
  162. N  s        change N characters
  163. N  S        change N lines
  164. N  r<char>    replace N characters by <char>
  165. N  ~        switch case for N characters and advance cursor
  166. {quote}~    switch case for quoted text
  167. {quote}u    make quoted text uppercase
  168. {quote}U    make quoted text lowercase
  169. N  CTRL-A    add N to the number at or after the cursor
  170. N  CTRL-S    subtract N from the number at or after the cursor
  171. N  <{motion}    move the lines that are moved over one shiftwidth left
  172. N  <<        move N lines one shiftwidth left
  173. N  >{motion}    move the lines that are moved over one shiftwidth right
  174. N  >>        move N lines one shiftwidth right
  175. N  V{motion}    format the lines that are moved over to 'textwidth' length
  176. Complex changes
  177.    q        start quoting characters   } move cursor and use
  178.    Q        start quoting linewise     } operator to affect
  179.    CTRL-Q    start quoting blockwise    } quoted text
  180.    o        exchange cursor position with start of quoting
  181.  
  182. N  !{motion}{command}
  183.         filter the lines that are moved over through {command}
  184. N  !!{command}
  185.         filter N lines through {command}
  186. :[range]!{command}
  187.         filter [range] lines through {command}
  188. N  ={motion}{command}
  189.         filter the lines that are moved over through "indent"
  190. N  =={command}
  191.         filter N lines through "indent"
  192. :[range]s[ubstitute]/{pattern}/{string}/[g][c]
  193.            substitute {pattern} by {string} in [range] lines; with [g]
  194.         replace all occurrences of {pattern}; with [c] ask first
  195. :[range]s[ubstitute] [g][c]
  196.            repeat previous :s with new range and options
  197.    &        Repeat previous :s on current line without options
  198.  
  199. Deleting text
  200. N  x        delete N characters under and after the cursor
  201. N  X        delete N characters before the cursor
  202. N  d{motion}    delete the text that is moved over with {motion}
  203. {quote}d    detete the quoted text
  204. N  dd        delete N lines
  205. N  D        delete to end of line (and N-1 more lines)
  206. N  J        join N-1 lines (delete newlines)
  207. {quote}J    join the quoted lines
  208. :[range]d ["x]    delete [range] lines (into register ["x])
  209.  
  210. Copying and moving text
  211.    "<char>    put the text from the next delete or yank in register <char>
  212. :dis        show the register contents
  213. N  y{motion}    yank the text, moved over with {motion}, into a register
  214. {quote}y    yank the quoted text into a register
  215. N  yy        yank N lines into a register
  216. N  Y        yank N lines into a register
  217. N  p        put a register below the current line (N times)
  218. N  P        put a register above the current line (N times)
  219. Repeating commands
  220. N  .        repeat last change (with count replaced by N)
  221.    v<a-z>    record typed characters into register <a-z>
  222.    v        stop recording
  223. N  @<a-z>    execute the contents of register <a-z> (N times)
  224. N  @@        repeat previous @<a-z> (N times)
  225. :@<a-z>        execute the contents of register <a-z> as an Ex command
  226. :@@        repeat previous :@<a-z>
  227. :[range]g[lobal]/{pattern}/[cmd]
  228.            Execute Ex command [cmd] (default :p) on the lines within
  229.         [range] where {pattern} matches.
  230. :[range]g[lobal]!/{pattern}/[cmd]
  231.            Execute Ex command [cmd] (default :p) on the lines within
  232.         [range] where {pattern} does NOT match.
  233. :so[urce] {file}
  234.            Read Ex commands from {file}.
  235. :so[urce]! {file}
  236.            Read VIM commands from {file}.
  237. Key mapping
  238. :ma[p] {lhs} {rhs}    Map the key sequence {lhs} to {rhs} in normal mode.
  239. :ma[p]! {lhs} {rhs}    Map the key sequence {lhs} to {rhs} in insert mode.
  240. :no[remap][!] {lhs} {rhs}
  241.             Same as :map, no remapping for this {rhs}
  242. :unm[ap] {lhs}        Remove the mapping of {lhs} for normal mode.
  243. :unm[ap]! {lhs}     Remove the mapping of {lhs} for insert mode.
  244. :ma[p] [lhs]        List all key mappings (starting with [lhs]) for
  245.             normal mode.
  246. :ma[p]! [lhs]        List all key mappings (starting with [lhs]) for
  247.             insert mode.
  248. :mk[exrc][!] [file]    write current mappings and settings to [file] 
  249.             (default ".exrc"; use ! to overwrite existing file)
  250. :mkv[imrc][!] [file]    same as :mkexrc, but with default ".vimrc"
  251.  
  252. Options
  253. :se[t]            Show all modified options.
  254. :se[t] all        Show all options.
  255. :se[t] {option}     Set toggle option on, show string or number option.
  256. :se[t] no{option}    Set toggle option off.
  257. :se[t] inv{option}    invert toggle option.
  258. :se[t] {option}={value} Set string or number option to {value}.
  259. :se[t] {option}?    Show value of {option}.
  260. option (shorthand)   type  default    effect
  261. autoindent (ai)        toggle    off   insert mode: copy indent from prev line
  262. autowrite (aw)        toggle    off   write the file when starting a new edit
  263. backspace (bs)        number    0     0 standard Vi, 1 delete NL, 2 delete all
  264. backup (bk)        toggle    on    backup a file before overwriting it
  265. backupdir (bdir)    string    "~/"  Unix only: Directory for backup files
  266. columns            number    80    number of columns in the display
  267. compatible (cp)        toggle    off   set options for maximum vi-compatibility
  268. digraph (dg)        toggle    off   enable <BS> digraphs in insert mode
  269. directory (dir)        string    ""    directory to put autoscript file
  270. equalprg (ep)        string    "indent"    program used for '=' command
  271. errorbells (eb)        toggle    off   ring the bell for error messages
  272. errorfile (ef)        string    "AztecC.Err" file for QuickFix option
  273. expandtab (et)        toggle    off   insert mode: use spaces to enter a tab
  274. graphic (gr)        toggle    off   display chars 0x80-0x9f directly
  275. helpfile (hf)        string    "vim:vim.hlp"    name of help file
  276. history (hi)        number    20    number of remembered command lines
  277. ignorecase (ic)        toggle    off   ignore case in search patterns
  278. isertmode (im)        toggle    off   start editing in insert mode
  279. joinspaces (js)        toggle    on    insert two spaces after a '.' with join
  280. keywordprg (kp)        string    "ref" name of program for 'K' command
  281. lines            number    25    number of lines in the display
  282. option (shorthand)   type  default    effect
  283. list            toggle    off   display lines in list mode
  284. magic            toggle    on    different pattern matching characters
  285. modelines (ml)        number    5        number of lines checked for set commands
  286. number (nu)        toggle    off   display line numbers
  287. paragraphs (para)   string    "IPLPPPQPP LIpplpipbp"
  288.                     nroff macros that separate paragraphs
  289. readonly (ro)        toggle    off   overwriting the file not allowed
  290. remap            toggle    on    :map command works recursively
  291. repdel (rd)        toggle    on    delete char with BS in replace mode
  292. report            number    2        minimal number of lines for reporting
  293. ruler (ru)        toggle    off   show cursor position in status line
  294. scroll            number    12    scroll size for CTRL-U and CTRL-D
  295. scrolljump        number    1     minimal number of lines for scrolling
  296. sections        string    "SHNHH HUnhsh"
  297.                     nroff macros that separate sections
  298. shell (sh)        string    "sh"  shell to use for ! and :! commands
  299. shelltype (st)        number    0        how to use the shell
  300. shiftround (sr)        toggle    off   round indent to shiftwidth with > and <
  301. shiftwidth (sw)        number    8     number of spaces to use for (auto)indent
  302. showcmd (sc)        toggle    on    show command in status line
  303. showmatch (sm)        toggle    off   show matching bracket if one is inserted 
  304. shortname (sn)        toggle    off   MSDOS-like filesystem being used
  305. option (shorthand)   type  default    effect
  306. showmode (mo)        toggle    on    show insert/replace mode message
  307. smartindent (si)    toggle    off   do smart autoindenting
  308. suffixes (su)        string    ".bak.o.h.info.vim" suffixes that are ignored
  309.                     when multiple files match a wildcard
  310. tabstop (ts)        number    8        number of spaces that a TAB counts for
  311. taglength (tl)        number    0        if non-zero, tags are significant upto
  312.                     this number of characters
  313. tags            string    "tags"   names of tag files
  314. term            string    "amiga"    name of terminal
  315. textwidth        number    9999  maximum width of a line in insert mode
  316. tildeop (to)        toggle    off   tilde behaves like an operator
  317. timeout            toggle    on    wait only 1 sec for mappings and key codes 
  318. ttimeout        toggle    off   wait only 1 sec for key codes 
  319. undolevels (ul)        number    100   number of changes that can be undone
  320.                     (0 for Vi compatibility)
  321. visualbell (vb)        toggle    off   use visual instead of audible beep
  322. wrapmargin (wm)        number    0     textwidth is set to window width minus
  323.                     wrapmargin
  324. wrapscan (ws)        toggle    on    searches wrap around the end of the file
  325. writeany (wa)        toggle    off   always write file without asking
  326. writebackup (wb)    toggle    on    backup a file WHILE overwriting it
  327. yankendofline (ye)  toggle    off   'Y' yanks from cursor to end of line
  328. Undo/Redo commands
  329. N  u        undo N last changes
  330. N  CTRL-R    redo N last undone changes
  331.    U        restore last changed line
  332. External commands
  333. :sh        start a shell
  334. :!{command}    execute {command} with a shell
  335.    K        lookup keyword under the cursor with external program
  336. Quickfix commands
  337. :cc [nr]    display error [nr] (default is the same again)
  338. :cn        display the next error
  339. :cp        display the previous error
  340. :cf        read errors from the error file
  341. :cq        quit without writing and return error code (to the compiler)
  342. Various commands
  343.    CTRL-L    Clear and redraw the screen.
  344.    CTRL-G    show current file name and cursor position
  345.    CTRL-C    during searches: interrupt the search
  346.    <DEL>    while entering a count: delete last character
  347. :vers        show exact version number of this VIM
  348. Command line editing
  349. CTRL-V        insert character literally, or enter decimal byte value
  350. <C_LEFT>    cursor left
  351. <C_RIGHT>    cursor right
  352. <SC_LEFT>    cursor one word left
  353. <SC_RIGHT>    cursor one word right
  354. <BS>        delete the character in front of the cursor
  355. <DEL>        delete the character under the cursor
  356. CTRL-U        remove all characters
  357. <C_UP>        recall older command line from history
  358. <C_DOWN>    recall more recent command line from history
  359. CTRL-D        list filenames that match the pattern in front of the cursor
  360. <ESC>        do filename completion on the pattern in front of the cursor
  361. CTRL-N        only after <ESC> with multiple matches: go to next match
  362. CTRL-P        only after <ESC> with multiple matches: go to previous match
  363.  
  364. Special Ex characters
  365.     |        separates two commands (not for ":global" and ":!")
  366.     "        begins comment
  367.     #        in first column: begins comment
  368.     #[number]    alternate filename [number] (only where filename is expected)
  369.     %        current filename (only where filename is expected)
  370. Ex ranges
  371. ,        separates two line numbers
  372. ;        idem, set cursor to the first line number
  373.  
  374. {number}    an absolute line number
  375. .        the current line
  376. $        the last line in the file
  377. %        equal to 1,$ (the entire file)
  378. 't              position of mark t
  379. /{pattern}    the next line where {pattern} matches
  380. ?{pattern}    the previous line where {pattern} matches
  381.  
  382. +[num]        add [num] to the preceding line number (default 1)
  383. -[num]        subtract [num] from the preceding line number (default 1)
  384. Editing a file
  385. :e             Edit the current file, unless changes have been made.
  386. :e!             Edit the current file always. Discard any changes.
  387. :e[dit] {file}         Edit {file}, unless changes have been made.
  388. :e[dit]! {file}      Edit {file} always. Discard any changes.
  389. N   CTRL-^        Edit alternate file N (equivalent to ":e #N").
  390. :cd            Print the current directory name.
  391. :cd {path}        Change the current directory to {path}.
  392. :f[ile]            Print the current filename and the cursor position.
  393. :f[ile] {name}        Set the current filename to {name}.
  394.  
  395. Using the file list
  396. :ar[gs]         Print the file list, with the current file in "[]".
  397. :n[ext]         Edit next file, unless changes have been made.
  398. :n[ext]!        Edit next file, discard any changes to the buffer.
  399. :n[ext][!] {filelist}    Define {filelist} as the new list of files and edit
  400.             the first one (see :next for [!]).
  401. :N[ext][!]         Edit previous file (see :next for [!]).
  402. :rew[ind][!]        Edit first file (see :next for [!]).
  403. :wn[ext][!]        Write file and edit next file. 
  404. :wn[ext][!] {file}    Write to {file} and edit next file, unless {file}
  405.             exists. With ! overwrite existing files.
  406. Writing and quitting
  407. :[range]w[rite][!]    Write to the current file.
  408. :[range]w[rite] {file}    Write to {file}, unless it already exists.
  409. :[range]w[rite]! {file} Write to {file}. Overwrite an existing file.
  410. :[range]w[rite][!] >>    Append to the current file.
  411. :[range]w[rite][!] >> {file}
  412.             Append to {file}.
  413. :[range]w[rite] !{cmd}    Execute {cmd} with [range] lines as standard input.
  414.  
  415. :q[uit]         Quit, unless changes have been made.
  416. :wq[!]            Write the current file and exit.
  417. :cq            Quit without writing and return error code
  418. :wq[!] {file}        Write to {file} and exit.
  419. :x[it][!] [file]    Like ":wq" but write only when changes have been made
  420.    ZZ            Same as ":x".
  421.  
  422. :st[op][!]        suspend Vim or start new shell. If 'aw' option is set 
  423.             and [!] not given write the buffer.
  424. CTRL-Z            same as ":stop!"
  425. Starting VIM
  426. vim [options]        start editing with an empty buffer
  427. vim [options] {file ..}
  428.             start editing one or more files
  429. vim [options] +[num] {file ..}
  430.             idem, put the cursor at line [num] (default last line)
  431. vim [options] +/{pat} {file ..}
  432.             idem, put the cursor at the first occurrence of {pat}
  433. vim [options] -t {tag}    edit the file associated with {tag}
  434. vim [options] -e    start editing in QuickFix mode, display the first error
  435. options
  436. -v            read-only mode (View), implies -n
  437. -r            recover aborted edit, using commands from ".vim" file
  438. -n            do not create autoscript file
  439. -s {scriptin}        first read the commands in the file {scriptin}
  440. -w {scriptout}        write all typed characters to the file {scriptout}
  441. -T {terminal}        set terminal type
  442. -d {device}        open {device} to be used as a console
  443.  
  444. automatic option setting when editing a file
  445. vi:{set-arg}: ..    In the first and last lines of the file (see 'ml'
  446.             option), {set-arg} is given as an argument to :set
  447.