home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / util / vim-2.0.lha / Vim-2.0 / doc / difference.doc < prev    next >
Encoding:
Text File  |  1993-12-14  |  18.2 KB  |  445 lines

  1.  
  2.  
  3. This is a summary of the differences between VIM and vi.
  4.  
  5.  
  6. The most interesting additions:
  7.  
  8. Vi compatibility.
  9. When the 'compatible' option is set, all options are given a vi-compatible
  10. value. Vim will behave like the "real" vi as much as possible.
  11.  
  12.  
  13. Multi level undo.
  14. 'u' goes backward in time, 'ctrl-R' goes forward again. Set option 
  15. 'undolines' to the number of changes to be remembered (default 100). Set 
  16. 'undolines' to 0 for vi-compatible one level undo.
  17.  
  18.  
  19. Repeat a series of commands.
  20. 'q'<c> starts recording typed characters into named register <c> (append to
  21. the register if register name is upper case). A subsequent 'q' stops
  22. recording. The register can then be executed with the '@'<c> command. This is
  23. very useful to repeat a complex action.
  24.  
  25.  
  26. Flexible insert mode.
  27. The arrow keys can be used in insert mode to move around in the file. This 
  28. breaks the insert in two parts as far as undo and redo is concerned.
  29.  
  30. CTRL-O can be used to execute a single command-mode command. This is almost 
  31. the same as hitting ESC, typing the command and hitting 'a'. For undo/redo 
  32. only those inserts are remembered where something was actually inserted.
  33.  
  34.  
  35. Visual mode.
  36. Visual can be used to first choose a piece of text and then give a command 
  37. to do something with it. This is an (easy to use) alternative to first giving 
  38. the operator and then moving to the end of the text to be operated upon. 'v' 
  39. and 'V' are used to start Visual mode. 'v' works on characters and 'V' on
  40. lines. Move the cursor to extend the Visual part. It is shown highlighted on
  41. the screen. By typing 'o' the other end of the Visual text can be moved. The
  42. Visual text can be affected by an operator:
  43.     d    delete
  44.     c    change
  45.     y    yank
  46.     > or <    insert or delete indent
  47.     !    filter through external program
  48.     =    filter through indent
  49.     :    start ":" command for the Visual lines.
  50.     Q    format text to 'textwidth' columns
  51.     J    join lines
  52.     ~    swap case
  53.     u    make lowercase
  54.     U    make uppercase
  55.  
  56.  
  57. Block operators.
  58. With Visual a rectangular block of text can be selected. Start Visual with 
  59. CTRL-V. The block can be deleted ('d'), yanked ('y') or its case can be 
  60. changed ('~', 'u' and 'U'). A deleted or yanked block can be put into the
  61. text with the 'p' and 'P' commands.
  62.  
  63.  
  64. Online help.
  65. ':help' command and help key (F1 for MSDOS) display several pages of concise 
  66. help. The name of the help file can be set with the "helpfile" option.
  67.  
  68.  
  69. Command line editing.
  70. You can insert or delete at any place in the command line using the cursor 
  71. keys. The right/left cursor keys can be used to move forward/backward one 
  72. character. The shifted right/left cursor keys can be used to move 
  73. forward/backward one word. CTRL-B/CTRL-E can be used to go to the begin/end
  74. of the command line.
  75.  
  76. The command lines are remembered. The up/down cursor keys can be used to 
  77. recall previous command lines. The 'history' option can be set to the number 
  78. of lines that will be remembered.
  79.  
  80.  
  81. Filename completion.
  82. While entering a command line (on the bottom line of the screen) <TAB> can be 
  83. typed after an (incomplete) file name wildcard; the wildcard will be 
  84. expanded. If there are multiple matches, CTRL-N (next) and CTRL-P (previous) 
  85. will walk through the matches. The 'wildchar' option can be set to the
  86. character for filename completion, <TAB> is the default. CTRL-D can be typed
  87. after an (incomplete) file name wildcard; all matching files will be listed.
  88. CTRL-A will insert all matching files. CTRL-L will insert the longest common
  89. part of the matching files.
  90.  
  91.  
  92. Horizontal scrolling.
  93. If the 'wrap' option is off, long lines will not wrap and only part of them
  94. will be shown. When the cursor is moved to a part that is not shown, the
  95. screen will scroll horizontally. The minimal number of columns to scroll can
  96. be set with the 'sidescroll' option.
  97.  
  98.  
  99. Text formatting.
  100. The 'textwidth' (tw) option can be used to automatically limit the line 
  101. length. This supplements the 'wrapmargin' option of Vi, which was not very 
  102. useful. The 'Q' operator can be used to format a piece of text ("Q}" formats 
  103. a paragraph). Commands for text alignment: ":center", ":left" and ":right".
  104.  
  105.  
  106. Edit-compile-edit speedup.
  107. The ":make" command can be used to run the compilation and jump to the first
  108. error. Alternatively Vim can be started with the "-e" option from the
  109. compiler. A file with compiler error messages is interpreted. Each line in
  110. the error file is scanned for the name of a file, line number and error
  111. message. Vim starts editing at the first error. Optionally the name of the
  112. error file can be given with "-e errorfile". The ":cn" command can be used to
  113. jump to the next error. ":cl" lists all the error messages. Other commands
  114. are available (almost the same as with Manx's Z editor). The 'errorfile'
  115. option has the name of the file with error messages. The 'errorformat' option
  116. can be set to a scanf-like string to handle output from many compilers. The
  117. 'makeprg' option contains the name of the program to be executed with the
  118. ":make" command.
  119.  
  120.  
  121. Command line options:
  122.  
  123. When Vim is started with "-v" (View) then readonly mode is used (includes 
  124. "-n").
  125.  
  126. When Vim is started with "-b" (Binary) then some options are set to be able
  127. to edit binary or executable files.
  128.  
  129. When Vim is started with "-s scriptfile", the characters read from 
  130. "scriptfile" are treated as if you typed them. If end of file is reached 
  131. before the editor exits, further characters are read from the console.
  132.  
  133. The "-w" option can be used to record all typed characters in a script file. 
  134. This file can then be used to redo the editing, possibly on another file or 
  135. after changing some commands in the script file.
  136.  
  137. The "-n" option disables the writing of a ".vim" file (see below).
  138.  
  139. The "-c command" option does the same as the the "+command" option.
  140.  
  141. The "-T terminal" option sets the terminal type.
  142.  
  143. The "-e" option starts Vim in quickfix mode.
  144.  
  145.  
  146. In command mode:
  147.  
  148. Missing command: 'Q' (go to Ex mode).
  149. Missing Ex commands: append, change, insert, open, preserve, recover, 
  150. visual, z and ~.
  151.  
  152. The command characters are shown in the last line of the screen. They are 
  153. removed when the command is finished. If you do not want this (on a slow 
  154. terminal) reset the 'showcmd' option.
  155.  
  156. If the 'ruler' option is set, the current cursor position is shown in the 
  157. last line of the screen.
  158.  
  159. 'u' and CTRL-R accept a count for the number of undos/redos.
  160.  
  161. 'U' still works after having moved off of the last changed line and after 
  162. 'u'.
  163.  
  164. Nulls in the file are replaced by <LF> internally. This allows editing of 
  165. binary files (more or less).
  166.  
  167. Characters with the 8th bit set are displayed. The characters between '~' and 
  168. 0xa0 are displayed as "~?", "~@", "~A", etc., unless the "graphic' option is 
  169. set.
  170.  
  171. '=' is an operator to filter lines through an external command (vi: lisp 
  172. stuff). The name of the command can be set with the 'equalprg' option. The 
  173. default is "indent".
  174.  
  175. '][' goes to the next ending of a C function ('}' in column 1).
  176. '[]' goes to the previous ending of a C function ('}' in column 1).
  177.  
  178. '*' searches forward for the identifier under the cursor, '#' backward.
  179. 'K' runs the program defined by the "keywordprg" option, with the identifier 
  180. under the cursor as argument.
  181.  
  182. '%' can be preceded with a count. The cursor jumps to the line that 
  183. percentage down in the file. The normal '%' function to jump to the matching
  184. brace skips braces inside quotes.
  185.  
  186. With the CTRL-] command, the cursor may be in the middle of the identifier.
  187.  
  188. The used tags are remembered. Commands that can be used with the tag stack 
  189. are CTRL-T, ':pop' and ':tag'. ':tags' lists the tag stack.
  190.  
  191. The 'tags' option can be set to a list of tag file names. Thus multiple 
  192. tag files can be used.
  193.  
  194. Previously used file names are remembered in the alternate file name list.
  195. CTRL-^ accepts a count, which is an index in this list.
  196.  
  197. Search patterns have more features.
  198.  
  199. Searches can find the end of a match and may include a character offset.
  200.  
  201. Count added to '~', ':next', ':Next', 'n' and 'N'.
  202.  
  203. "5r<CR>" replaces five characters by five line breaks. Vi replaces five
  204. characters with a single line break.
  205.  
  206. Added :wnext command. Same as ":write" followed by ":next".
  207.  
  208. If option "tildeop" has been set, '~' is an operator (must be followed by a 
  209. movement command).
  210.  
  211. With the 'J' (join) command you can reset the 'joinspaces' (js) option to 
  212. have only one space after a period (Vi inserts two spaces).
  213.  
  214. 'cw' can be used to change white space formed by several characters (Vi is 
  215. confusing: 'cw' only changes one space, while 'dw' deletes all white space).
  216.  
  217. 'o' and 'O' accept a count for repeating the insert (Vi clears a part of 
  218. display).
  219.  
  220. ':dis' command shows the contents of the yank register.
  221.  
  222. Previously used file names are remembered in the alternate file name list.
  223. ":files" command shows the list of alternate filenames.
  224. '#'<N> is replaced by the <N>th alternate filename in the list.
  225. "#<" is replaced by the current filename without extension.
  226.  
  227. Flags after command not supported (no plans to include it).
  228.  
  229. On non-UNIX systems ":cd" command shows current directory instead of going to
  230. the home directory. ":pwd" prints the current directory on all systems.
  231.  
  232. ':source!' command reads Vi commands from a file.
  233.  
  234. ':mkexrc' command writes current modified options and mappings to a ".exrc" 
  235. file. ':mkvimrc' writes to a ".vimrc" file.
  236.  
  237. No check for "tail recursion" with mappings. This allows things like
  238. ":map! foo ^]foo".
  239.  
  240. The :put! command inserts the contents of a register above the current line.
  241.  
  242. The named register '.' can be used with commands p, P and :put. The contents 
  243. of the register is the last inserted text.
  244.  
  245. ":noremap" command can be used to enter a mapping that will not be remapped.
  246. This is useful to exchange the meaning of two keys. ":cmap", ":cunmap" and
  247. ":cnoremap" can be used for mapping in command line editing only. ":imap",
  248. ":iunmap" and ":inoremap" can be used for mapping in insert mode only.
  249. Similar commands exist for abbreviations: ":noreabbrev", ":iabbrev"
  250. ":cabbrev", ":iunabbrev", ":cunabbrev", ":inoreabbrev", ":cnoreabbrev".
  251.  
  252. In vi the command ":map foo bar" would remove a previous mapping
  253. ":map bug foo". This is considered a bug, so it is not included in Vim.
  254. ":unmap! foo" does remove ":map! bug foo", because unmapping would be very
  255. difficult otherwise (this is vi compatible).
  256.  
  257. ":@r" command executes register r (is in some versions of vi).
  258.  
  259. CTRL-O/CTRL-I can be used to jump to older/newer positions. These are the 
  260. same positions as used with the '' command, but may be in another file. The 
  261. ':jumps' command lists the older positions.
  262.  
  263. If the 'shiftround' option is set, an indent is rounded to a multiple of 
  264. 'shiftwidth' with '>' and '<' commands.
  265.  
  266. The 'scrolljump' option can be set to the minimal number of lines to scroll 
  267. when the cursor gets off the screen. Use this when scrolling is slow.
  268.  
  269. Uppercase marks can be used to jump between files. The ':marks' command lists 
  270. all currently set marks. The commands "']" and "`]" jump to the end of the 
  271. previous operator or end of the text inserted with the put command. "'[" and 
  272. "`[" do jump to the start.
  273.  
  274. The 'shelltype' option can be set to reflect the type of shell used.
  275.  
  276. The CTRL-A (add) and CTRL-S (subtract) commands are new. The count to the 
  277. command (default 1) is added to/subtracted from the number at or after the 
  278. cursor. That number may be decimal, octal (starts with a '0') or hexadecimal 
  279. (starts with '0x'). Very useful in macros.
  280.  
  281. With the :set command the prefix "inv" can be used to invert toggle options.
  282.  
  283. In both Vi and Vim you can create a line break with the ":substitute" command
  284. by using a CTRL-M. For Vi this means you cannot insert a real CTRL-M in the
  285. text. With Vim you can put a real CTRL-M in the text by preceding it with a
  286. CTRL-V.
  287.  
  288.  
  289. In insert mode:
  290.  
  291. If the 'revins' option is set, insert happens backwards. This is for typing
  292. Hebrew. When inserting normal characters the cursor will not be shifted and
  293. the text moves rightwards. In replace mode the cursor will move leftwards.
  294. Backspace, CTRL-W and CTRL-U will also work in the opposite direction. CTRL-P
  295. toggles the 'revins' option.
  296.  
  297. The backspace key can be used just like CTRL-D to remove auto-indents.
  298.  
  299. You can backspace, ctrl-U and CTRL-W over line breaks if the 'backspace' (bs) 
  300. option is set to non-zero. You can backspace over the start of insert if the 
  301. 'backspace' option is set to 2.
  302.  
  303. When the 'paste' option is set, a few option are reset and mapping in insert
  304. mode and abbreviation are disabled. This allows for pasting text in windowing
  305. systems without unexpected results. When the 'paste' option is reset, the old
  306. option values are restored.
  307.  
  308. CTRL-T/CTRL-D always insert/delete an indent in the current line, no matter 
  309. what column the cursor is in.
  310.  
  311. CTRL-@ (insert previously inserted text) works always (Vi: only when typed as 
  312. first character).
  313.  
  314. CTRL-A works like CTRL-@ but does not leave insert mode.
  315.  
  316. CTRL-R <0-9a-z> can be used to insert the contents of a register.
  317.  
  318. When the 'smartindent' (si) option is set, C programs will be better 
  319. auto-indented.
  320.  
  321. CTRL-Y and CTRL-E can be used to copy a character from above/below the 
  322. current cursor position.
  323.  
  324. After CTRL-V you can enter a three digit decimal number. This byte value is 
  325. inserted in the text as a single character. Useful for international 
  326. characters that are not on your keyboard.
  327.  
  328. When the 'expandtab' (et) option is set, a <TAB> is expanded to the 
  329. appropriate number of spaces.
  330.  
  331. The window always reflects the contents of the buffer (Vi does not do this 
  332. when changing text and in some other cases).
  333.  
  334. If Vim is compiled with DIGRAPHS defined, digraphs are supported. A set of 
  335. normal Amiga digraphs is included. They are shown with the :digraph" command. 
  336. More can be added with ":digraph {char1}{char2} {number}". A digraph is 
  337. entered with "CTRL-K {char1} {char2}" or "{char1} BS {char2}" (only when 
  338. 'digraph' option is set).
  339.  
  340.  
  341. In command line mode:
  342.  
  343. ESC terminates the command line without executing it. In vi the command line
  344. would be executed, which is not what most people expect (hitting ESC should
  345. always get you back to command mode). To avoid problems with some
  346. obscure macros, an ESC in a macro will execute the command. If you want a
  347. typed ESC to execute the command like vi does you can fix this with
  348.     ":cmap ^V<ESC> ^V<CR>"
  349.  
  350. general:
  351.  
  352. Missing options: autoprint (ap), beautify (bf), edcompatible, hardtabs (ht), 
  353. lisp, mesg, open, optimize (op), prompt, redraw, slowopen (slow), terse,
  354. window, w300, w1200 and w9600. These options can be set but are otherwise
  355. ignored.
  356.  
  357. When the 'compatible' option is set, all options are set for maximum 
  358. vi-compatibility
  359.  
  360. The 'ttimeout' option is like 'timeout', but only works for cursor and 
  361. function keys, not for ordinary mapped characters. The 'timoutlen' option
  362. gives the number of milliseconds that is waited for. If the 'esckeys' option
  363. is not set, cursor and function keys that start with <ESC> are not recognized
  364. in insert mode.
  365.  
  366. There is an option for each terminal string. Can be used when termcap is not 
  367. supported or to change individual strings.
  368.  
  369. When the 'textmode' option is set (default for MSDOS) <CR><LF> is used as
  370. line separator. When reset (default for Unix and Amiga) <LF> is used. When
  371. the 'textauto' option is set, Vim tries to detect the type of line separator
  372. used by reading up to the first <LF>. The 'textmode' option is set
  373. accordingly.
  374.  
  375. On systems that have no job control (most systems but BSD-UNIX) the CTRL-Z, 
  376. ":stop" or ":suspend" command starts a new shell.
  377.  
  378. If Vim is started on the Amiga without an interactive window for output, a 
  379. window is opened (and :sh still works). You can give a device to use for 
  380. editing with the '-d' argument, e.g. "-d con:20/20/600/150".
  381.  
  382. On startup the VIMINIT or EXINIT environment variables, the file s:.vimrc or 
  383. s:.exrc and .vimrc or .exrc are read for initialization commands. When 
  384. reading .vimrc and .exrc some commands are not allowed because of security 
  385. reasons (shell commands and writing to a file, :map commands are echoed). 
  386. This can be overrided with the 'secure' option.
  387.  
  388. Line lenght can be at least upto the maximum value of an int (for the Amiga
  389. 32767 characters, for most 32-bit systems much larger). Editing such lines is
  390. not always possible. File length upto 2147483646 lines. If a line is larger
  391. than the screen, the last line is filled with <@>s and only the part of the
  392. line before that is shown (unless 'wrap' option is reset).
  393.  
  394. The 'columns' option is used to set or get the width of the display.
  395.  
  396. The name of the current file name is shown in the title bar of the window.
  397.  
  398. Wildcards in file names are expanded.
  399.  
  400. Option settings are read from the first and last few lines of the file. 
  401. Option 'modelines' determines how many lines are tried (default is 5). Note 
  402. that this is different from the Vi versions that can execute any Ex command 
  403. in a modeline (a major security problem).
  404.  
  405. If the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode.
  406.  
  407. All text is kept in memory. Available memory limits the file size (and other 
  408. things such as undo). This may be a problem with MSDOS, is hardly a problem 
  409. ont the Amiga and almost never with Unix.
  410.  
  411. If the 'backup' or 'writebackup' option is set: Before a file is overwritten, 
  412. a backup file (.bak) is made. If the "backup" option is set it is left 
  413. behind.
  414.  
  415. If the 'binary' option is set and the file does not have an end-of-line for
  416. the last line, the end-of-line is not appended when writing.
  417.  
  418. All entered commands and text is written into a script file, ending in 
  419. ".vim". This can be used to recover your work if the machine crashes during 
  420. an edit session. This can be switched off by setting the 'updatecount' option 
  421. to 0 or starting Vim with the "-n" option. Use the 'directory' option for 
  422. placing the .vim file somewhere else.
  423.  
  424. The 'shortname' (sn) option, when set, tells Vim that ".bak" and ".vim" 
  425. filenames are to be MSDOS-like: 8 characters plus 3 for extention. This 
  426. should be used on messydos or crossdos filesystems on the Amiga. If this 
  427. option is off, Vim tries to guess if MSDOS filename restrictions are 
  428. effective.
  429.  
  430. Recovery after a crash has a smaller chance for success, because there is no 
  431. temporary file.
  432.  
  433. Error messages are shown at least one second (Vi overwrites error messages).
  434.  
  435. If Vim asks to "Hit RETURN to continue", you can hit any key. Characters 
  436. other than <CR>, <LF> and <SPACE> are interpreted as the (start of) a 
  437. command. (Vi only accepts a command starting with ':').
  438.  
  439. The contents of the numbered and unnamed registers is remembered when
  440. changing files.
  441.  
  442. The AUX: device of the Amiga is supported.
  443.  
  444. vi:tw=77:
  445.