home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d591 / vim.lha / Vim / vim.hlp < prev   
Text File  |  1992-01-31  |  17KB  |  383 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, which was worked on by:
  6.     b    one page backward       Tim Thompson, Tony Andrews, G.R. (Fred) Walter
  7.  
  8. c   left-right and up-down motions   m   options a-n
  9. d   word and text object motions     n   options p-s
  10. e   pattern searches                 o   options t-z
  11. f   various motions; scrolling       p   quickfix and various commands
  12. g   inserting text                   q   command line editing; Ex characters
  13. h   special inserts; changing text   r   Ex ranges
  14. i   complex changes                  s   editing files; using the file list
  15. j   deleting, copying, moving text   t   using tags; writing and quitting
  16. k   repeating commands               u   starting VIM
  17. l   key mapping; option commands
  18.  
  19. Read "reference.doc" for a more complete explanation.
  20. Left-right motions
  21. N  h        left (same as CTRL-H, BS and cursor-left key)
  22. N  l        right (same as SPACE and cursor-right key)
  23.    0        to first character in the line
  24.    ^        to first non-blank character in the line
  25. N  $        to the last character in the line (N-1 lines lower)
  26. N  |        to column N
  27. N  f<char>    to the Nth occurrence of <char> to the right
  28. N  F<char>    to the Nth occurrence of <char> to the left
  29. N  t<char>    till before the Nth occurrence of <char> to the right
  30. N  T<char>    till before the Nth occurrence of <char> to the left
  31. N  ;        repeat the last f, F, t or T N times
  32. N  ,        repeat the last f, F, t or T N times in opposite direction
  33.  
  34. Up-down motions
  35. N  k        up (same as CTRL-P and cursor-up key)
  36. N  j        down (same as CTRL-J, CTRL-N, LF and cursor-down key)
  37. N  -        up, on the first non-blank character
  38. N  +        down, on the first non-blank character (same as CTRL-M and CR)
  39. N  _        N - 1 lines down, on the first non-blank character
  40. N  G        goto line N (default last line), on the first non-blank char.
  41. Word motions
  42. N  w        N words forward
  43. N  W        N blank-separated words forward
  44. N  e        forward to the end of the Nth word
  45. N  E        forward to the end of the Nth blank-separated word
  46. N  b        N words backward
  47. N  B        N blank-separated words backward
  48.  
  49. Text object motions
  50. N  )        N sentences forward
  51. N  (        N sentences backward
  52. N  }        N paragraphs forward
  53. N  {        N paragraphs backward
  54. N  ]]        N sections forward
  55. N  [[        N sections backward
  56. N  ][        N sections (starting with a <}>) forward
  57. N  []        N sections (starting with a <}>) backward
  58.  
  59. Pattern searches
  60. N  /{pattern}[/]    search forward for the Nth occurrence of {pattern}
  61. N  ?{pattern}[?]    search backward for the Nth occurrence of {pattern}
  62. N  /            repeat last search, in the forward direction
  63. N  ?            repeat last search, in the backward direction
  64. N  n            repeat last search
  65. N  N            repeat last search, in opposite direction
  66. N  *            search forward for the ident under the cursor
  67. N  #            search backward for the ident under the cursor
  68.  
  69. special characters in search patterns       magic    nomagic        
  70.        matches any single character         .          \.        
  71.           matches start of line         ^          ^        
  72.             matches end of line         $          $        
  73.           matches start of word         \<          \<        
  74.             matches end of word         \>          \>        
  75.    matches a single char from the range         [a-z]      \[a-z\]
  76.  matches a single char not in the range         [^a-z]      \[^a-z\]
  77. matches 0 or more of the preceding atom         *          \*
  78. matches 1 or more of the preceding atom         \+          \+
  79.    matches 0 or 1 of the preceding atom         \?          \?
  80.              separates two branches         \|          \|
  81.            group a pattern into an atom         \(\)      \(\)
  82. Various motions
  83.    m<a-z>    mark current position with mark <a-z>
  84.    '<a-z>    go to the line with mark <a-z>, on the first non-blank ch.
  85.    `<a-z>    go to mark <a-z>
  86.    ''        go to the line before the last jump, on the first non-blank ch.
  87.    ``        go to the position before the last jump
  88.    %        find the next brace or bracket in this line and go to its match
  89. N  H        go to the Nth line in the window, on the first non-blank ch.
  90.    M        go to the middle line in the window, on the first non-blank ch.
  91. N  L        go to the Nth line from the bottom of the window, on the
  92.         first non-blank character
  93.  
  94. Scrolling
  95. N  CTRL-E    window N lines downwards in the buffer (N lines Extra)
  96. N  CTRL-D    window N lines Downwards in the buffer (default half a window)
  97. N  CTRL-F    window N pages Forwards (downwards) in the buffer
  98. N  CTRL-Y    window N lines upwards in the buffer
  99. N  CTRL-U    window N lines Upwards in the buffer (default half a window)
  100. N  CTRL-B    window N pages Backwards (upwards) in the buffer
  101.    z<CR>    redraw, current line at top of window
  102.    z.        redraw, current line at center of window
  103.    z-        redraw, current line at bottom of window
  104. Inserting text
  105. N  a        append text after the cursor (N times)
  106. N  A        append text at the end of the line (N times)
  107. N  i        insert text before the cursor (N times)
  108. N  I        insert text before the first non-blank in the line (N times)
  109. N  o        open a new line below the current line and append text (N times)
  110. N  O        open a new line above the current line and append text (N times)
  111.  
  112. char            action in insert mode
  113. -----------------------------------------------------------------------
  114. CTRL-[ <ESC>    End insert or replace mode, back to command mode.
  115. CTRL-@          Insert previously inserted text and stop insert.
  116. CTRL-J <LF>     Begin new line.
  117. CTRL-M <CR>     Begin new line.
  118. CTRL-R          Insert the character which is above the cursor.
  119. CTRL-E          Insert the character which is below the cursor.
  120. CTRL-T          Insert one shiftwidth or <TAB>.
  121. CTRL-V          Insert next character literally.
  122. CTRL-H <BS>     Delete the character before the cursor.
  123. CTRL-D          Delete one shiftwidth or <TAB>.
  124. CTRL-W          Delete word before the cursor.
  125. CTRL-U          Delete all entered characters in the current line.
  126. Special inserts
  127. :r {file}    insert the contents of {file} below the cursor
  128. :r!{command}    insert the standard output of {command} below the cursor
  129.  
  130. Changing text
  131. N  R        enter replace mode (repeat the entered text N times)
  132. N  c{motion}    change the text that is moved over with {motion}
  133. N  cc        change N lines
  134. N  C        change to end of line (and N-1 more lines)
  135. N  s        change N characters
  136. N  S        change N lines
  137. N  r<char>    replace N characters by <char>
  138. N  ~        switch case for N characters and advance cursor
  139. N  <{motion}    move the lines that are moved over one shiftwidth left
  140. N  <<        move N lines one shiftwidth left
  141. N  >{motion}    move the lines that are moved over one shiftwidth right
  142. N  >>        move N lines one shiftwidth right
  143. Complex changes
  144. N  !{motion}{command}
  145.         filter the lines that are moved over through {command}
  146. N  !!{command}
  147.         filter N lines through {command}
  148. :[range]!{command}
  149.         filter [range] lines through {command}
  150. N  ={motion}{command}
  151.         filter the lines that are moved over through "indent"
  152. N  =={command}
  153.         filter N lines through "indent"
  154. :[range]s[ubstitute]/{pattern}/{string}/[g][c]
  155.            substitute {pattern} by {string} in [range] lines; with [g]
  156.         replace all occurrences of {pattern}; with [c] ask first
  157. :[range]s[ubstitute] [g][c]
  158.            repeat previous :s with new range and options
  159.    &            Repeat previous :s on current line without options.
  160.  
  161. Deleting text
  162. N  x        delete N characters under and after the cursor
  163. N  X        delete N characters before the cursor
  164. N  d{motion}    delete the text that is moved over with {motion}
  165. N  dd        delete N lines
  166. N  D        delete to end of line (and N-1 more lines)
  167. N  J        join N-1 lines (delete newlines)
  168. :[range]d ["x]
  169.            delete [range] lines (into register ["x])
  170.  
  171. Copying and moving text
  172.    "<char>    put the text from the next delete or yank in register <char>
  173. :dis        show the register contents
  174. N  y{motion}    yank the text that is moved over with {motion} into a register
  175. N  yy        yank N lines into a register
  176. N  Y        yank N lines into a register
  177. N  p        put a register below the current line (N times)
  178. N  P        put a register above the current line (N times)
  179. Repeating commands
  180. N  .        repeat last change (with count replaced by N)
  181.    v<a-z>    record typed characters into register <a-z>
  182.    v        stop recording
  183. N  @<a-z>    execute the contents of register <a-z> (N times)
  184. N  @@        repeat previous @<a-z> (N times)
  185. :[range]g[lobal]/{pattern}/[cmd]
  186.            Execute Ex command [cmd] (default :p) on the lines within
  187.         [range] where {pattern} matches.
  188. :[range]g[lobal]!/{pattern}/[cmd]
  189.            Execute Ex command [cmd] (default :p) on the lines within
  190.         [range] where {pattern} does NOT match.
  191. :so[urce] {file}
  192.            Read Ex commands from {file}.
  193. :so[urce]! {file}
  194.            Read VIM commands from {file}.
  195. Key mapping
  196. :ma[p] {lhs} {rhs}      Map the key sequence {lhs} to {rhs} in normal mode.
  197. :ma[p]! {lhs} {rhs}     Map the key sequence {lhs} to {rhs} in insert mode.
  198. :unm[ap] {lhs}          Remove the mapping of {lhs} for normal mode.
  199. :unm[ap]! {lhs}         Remove the mapping of {lhs} for insert mode.
  200. :map [lhs]              List all key mappings (starting with [lhs]) for
  201.             normal mode.
  202. :map! [lhs]             List all key mappings (starting with [lhs]) for
  203.             insert mode.
  204.  
  205. Options
  206. :se[t]                  Show all modified options.
  207. :se[t] all              Show all options.
  208. :se[t] {option}         Set toggle option on, show string or number option.
  209. :se[t] no{option}       Set toggle option off.
  210. :se[t] {option}={value} Set string or number option to {value}.
  211. :se[t] {option}?        Show value of {option}.
  212. option (shorthand)    type  default    effect
  213. autoindent (ai)        toggle    off     copy indent from previous line when
  214.                     starting a new line in insert mode
  215. autowrite (aw)        toggle    off    write the contents of the file on each
  216.                     :n, :N, :rew, :prev, :tag, :!, CTRL-]
  217.                     and CTRL-^ command
  218. backspace (bs)          toggle  off    allow backspacing over newlines in
  219.                     insert mode
  220. backup (bk)        toggle    on    make a backup before overwriting a file
  221. errorbells (eb)        toggle    off    ring the bell for error messages
  222. errorfile (ef)        string    "AztecC.Err"
  223.                     name of error file for QuickFix option
  224. history (hi)        number    20    number of remembered command lines
  225. ignorecase (ic)        toggle    off    ignore case in search patterns
  226. lines            number    25    number of lines in the display
  227. list            toggle    off    display lines in list mode
  228. magic            toggle    on    different pattern matching characters
  229. modelines (ml)        number    5    number of lines checked for set commands
  230. number (nu)        toggle    off    display line numbers
  231. option (shorthand)    type  default    effect
  232. paragraphs (para)    string    "IPLPPPQPP LIpplpipbp"
  233.                     nroff macros that separate paragraphs
  234. readonly (ro)        toggle    off    overwriting the file not allowed
  235. remap            toggle    on    :map command works recursively
  236. report            number    5    minimal number of lines for reporting
  237. scroll            number    12    scroll size for CTRL-U and CTRL-D
  238. sections        string    "SHNHH HUnhsh"
  239.                     nroff macros that separate sections
  240. shell (sh)        string    "sh"    shell to use for ! and :! commands
  241. shiftwidth (sw)        number    8    number of spaces to use for (auto)indent
  242. showmatch (sm)        toggle    off    when a bracket is inserted, briefly
  243.                     jump to the matching one
  244. showmode (mo)        toggle    on    show insert/replace mode message
  245. smartindent (si)    toggle    off    do smart autoindenting
  246. suffixes (su)        string    ".bak.o.h.info"
  247.                     these suffixes are ignored when multiple
  248.                     files match a wildcard
  249. option (shorthand)    type  default    effect
  250. tabstop (ts)        number    8    number of spaces that a TAB counts for
  251. taglength (tl)        number    0    if non-zero, tags are significant upto
  252.                     this number of characters
  253. tags            string    "tags"    names of tag files
  254. tildeop (to)        toggle    off    tilde behaves like an operator
  255. textwidth        number    9999    making a line wider than this will
  256.                     start a new line
  257. undolevels (ul)        number    100    number of changes that can be undone
  258.                     (0 for Vi compatibility)
  259. wrapmargin (wm)        number    0    textwidth is set to window width minus
  260.                     wrapmargin
  261. wrapscan (ws)        toggle    on    searches wrap around the end of the file
  262. writeany (wa)        toggle    off    no allowance check when writing files
  263. yankendofline (ye)    toggle    off    the Y command yanks from the cursor
  264.                     until the end of the line
  265. Various commands
  266.    u        undo last change
  267.    CTRL-R    redo last undone change
  268.    U        restore last changed line
  269.  
  270.    CTRL-L    Clear and redraw the screen.
  271.    CTRL-G    show current file name and cursor position
  272.    CTRL-C    during searches: interrupt the search
  273.    <DEL>    while entering a count: delete last character
  274. :vers        show exact version number of this VIM
  275. :sh        start a shell
  276. :!{command}    execute {command} with a shell
  277.  
  278. Quickfix commands
  279. :cc [nr]    display error [nr] (default is the same again)
  280. :cn        display the next error
  281. :cp        display the previous error
  282. :cf        read errors from the error file
  283. :cq        quit without writing and return error code (to the compiler)
  284. Command line editing
  285. CTRL-V          insert next character literally
  286. <C_LEFT>        cursor left
  287. <C_RIGHT>       cursor right
  288. <SC_LEFT>       cursor one word left
  289. <SC_RIGHT>      cursor one word right
  290. <BS>            delete the character in front of the cursor
  291. <DEL>           delete the character under the cursor
  292. @               remove all characters
  293. <C_UP>          recall older command line from history
  294. <C_DOWN>        recall more recent command line from history
  295. CTRL-D          list filenames that match the pattern in front of the cursor
  296. <ESC>           do filename completion on the pattern in front of the cursor
  297.  
  298. Special Ex characters
  299.     |    separates two commands (not for ":global" and ":!")
  300.     "    begins comment
  301.     #    in first column: begins comment
  302.     #[number]
  303.         alternate filename [number] (only where a filename is expected)
  304.     %    current filename (only where a filename is expected)
  305. Ex ranges
  306. ,        separates two line numbers
  307. ;        idem, set cursor to the first line number
  308.  
  309. {number}        an absolute line number
  310. .               the current line
  311. $               the last line in the file
  312. %               equal to 1,$ (the entire file)
  313. 't              position of mark t
  314. /{pattern}      the next line where {pattern} matches
  315. ?{pattern}      the previous line where {pattern} matches
  316.  
  317. +[num]        add [num] to the preceding line number (default 1)
  318. -[num]        subtract [num] from the preceding line number (default 1)
  319. Editing a file
  320. :e                   Edit the current file, unless changes have been made.
  321. :e!                  Edit the current file always. Discard any changes.
  322. :e[dit] {file}       Edit {file}, unless changes have been made.
  323. :e[dit]! {file}      Edit {file} always. Discard any changes.
  324. N   CTRL-^        Edit alternate file N (equivalent to ":e #N").
  325. :cd                     Print the current directory name.
  326. :cd {path}              Change the current directory to {path}.
  327. :f[ile]            Print the current filename and the cursor position.
  328. :f[ile] {name}          Set the current filename to {name}.
  329.  
  330. Using the file list
  331. :ar[gs]                 Print the file list, with the current file in "[]".
  332. :n[ext]                 Edit next file, unless changes have been made.
  333. :n[ext]!                Edit next file, discard any changes to the buffer.
  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}     Idem, but discard any changes to the buffer.
  337. :N[ext]                 Edit previous file, unless changes have been made.
  338. :N[ext]!                Edit previous file. Discard any changes to the buffer.
  339. :rew[ind]               Edit first file, unless changes have been made.
  340. :rew[ind]!              Edit first file. Discard any changes to the buffer.
  341.  
  342. Using tags
  343. :ta[g] {tag}        Jump to tag {tag}, unless changes have been made.
  344. :ta[g]! {tag}        Jump to tag {tag} always. Discard any changes.
  345.    CTRL-]        ":ta" to the identifier under cursor.
  346.  
  347. Writing and quitting
  348. :[range]w[rite][!]      Write to the current file.
  349. :[range]w[rite] {file}  Write to {file}, unless it already exists.
  350. :[range]w[rite]! {file} Write to {file}. Overwrite an existing file.
  351. :[range]w[rite][!] >>   Append to the current file.
  352. :[range]w[rite][!] >> {file}
  353.                         Append to {file}.
  354. :[range]w[rite] !{cmd}  Execute {cmd} with [range] lines as standard input.
  355.  
  356. :q[uit]                 Quit, unless changes have been made.
  357. :wq[!]            Write the current file and exit.
  358. :cq            Quit without writing and return error code
  359. :wq[!] {file}        Write to {file} and exit.
  360. :x[it][!] [file]        Like ":wq", but write only when changes have been made.
  361.    ZZ            Same as ":x".
  362.  
  363. Starting VIM
  364. vim [options]
  365.         start editing with an empty buffer
  366. vim [options] {file ..}
  367.         start editing one or more files
  368. vim [options] +[num] {file ..}
  369.         idem, put the cursor at line [num] (default last line)
  370. vim [options] +/{pat} {file ..}
  371.         idem, put the cursor at the first occurrence of {pat}
  372. vim [options] -t {tag}
  373.         edit the file associated with {tag}
  374. vim [options] -e
  375.         start editing in QuickFix mode, display the first error
  376.  
  377. options:
  378. -v        read-only mode (View)
  379. -r        recover, using commands from ".vim" file
  380. -n        no autoscript file
  381. -s {scriptin}    first read the commands in the file {scriptin}
  382. -w {scriptout}    write all typed characters to the file {scriptout}
  383.