home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume37 / vim / part07 < prev    next >
Text File  |  1993-04-23  |  48KB  |  1,338 lines

  1. Newsgroups: comp.sources.misc
  2. From: mool@oce.nl (Bram Moolenaar)
  3. Subject: v37i007:  vim - Vi IMitation editor v1.27, Part07/24
  4. Message-ID: <1993Apr23.173105.16608@sparky.imd.sterling.com>
  5. X-Md4-Signature: 5b3f5fe05d837b4336df7ca77f3fd784
  6. Date: Fri, 23 Apr 1993 17:31:05 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: mool@oce.nl (Bram Moolenaar)
  10. Posting-number: Volume 37, Issue 7
  11. Archive-name: vim/part07
  12. Environment: UNIX, AMIGA, MS-DOS
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of archive 7 (of 23)."
  21. # Contents:  vim/doc/difference.doc vim/src/termlib.c vim/src/version.c
  22. # Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:08 1993
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'vim/doc/difference.doc' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'vim/doc/difference.doc'\"
  26. else
  27. echo shar: Extracting \"'vim/doc/difference.doc'\" \(14014 characters\)
  28. sed "s/^X//" >'vim/doc/difference.doc' <<'END_OF_FILE'
  29. XThis is a summary of the differences between VIM and vi.
  30. X
  31. X
  32. XThe most interesting additions:
  33. X
  34. XMulti level undo.
  35. X'u' goes backward in time, 'ctrl-R' goes forward again. Set option 
  36. X'undolines' to the number of changes to be remembered (default 100). Set 
  37. X'undolines' to 0 for vi-compatible one level undo.
  38. X
  39. X
  40. XRepeat a series of commands.
  41. X'v'<c> starts recording typed characters into named buffer <c> (append to the 
  42. Xbuffer if buffer name is upper case). A subsequent 'v' stops recording. The 
  43. Xbuffer can then be executed with the '@'<c> command. This is very useful to 
  44. Xrepeat a complex action.
  45. X
  46. X
  47. XFlexible insert mode.
  48. XThe arrow keys can be used in insert mode to move around in the file. This 
  49. Xbreaks the insert in two parts as far as undo and redo is concerned.
  50. X
  51. XCTRL-O can be used to execute a single command-mode command. This is almost 
  52. Xthe same as hitting ESC, typing the command and hitting 'a'. For undo/redo 
  53. Xonly those inserts are remembered where something was actually inserted.
  54. X
  55. X
  56. XQuoting.
  57. XQuoting can be used to first choose a piece of text and then give a command 
  58. Xto do something with it. This is an (easy to use) alternative to first giving 
  59. Xthe operator and then moving to the end of the text to be operated upon. 'q' 
  60. Xand 'Q' are used to start quoting a piece of text. 'q' works on characters 
  61. Xand 'Q' on lines. Move the cursor to extend the quoted part. It is shown 
  62. Xhighlighted on the screen. By typing 'o' the other end of the quoted text can 
  63. Xbe moved. The quoted text can be affected by an operator:
  64. X    d    delete
  65. X    c    change
  66. X    y    yank
  67. X    > or <    insert or delete indent
  68. X    !    filter through external program
  69. X    =    filter through indent
  70. X    :    start ":" command for the quoted lines.
  71. X    V    format text to 'textwidth' columns
  72. X    J    join lines
  73. X    ~    swap case
  74. X    u    make uppercase
  75. X    U    make lowercase
  76. X
  77. X
  78. XBlock operators.
  79. XWith quoting a rectangular block of text can be selected. Start quoting with 
  80. XCTRL-Q. The block can be deleted ('d'), yanked ('d') or its case can be 
  81. Xswapped ('~'). A deleted or yanked block can be put into the text with the 
  82. X'p' and 'P' commands.
  83. X
  84. X
  85. XOnline help.
  86. X':help' command and help key (F1 for MSDOS) display several pages of concise 
  87. Xhelp. The name of the help file can be set with the "helpfile" option.
  88. X
  89. X
  90. XCommand line editing.
  91. XYou can insert or delete at any place in the command line using the cursor 
  92. Xkeys. The right/left cursor keys can be used to move forward/backward one 
  93. Xcharacter. The shifted right/left cursor keys can be used to move 
  94. Xforward/backward one word.
  95. X
  96. XThe command lines are remembered. The up/down cursor keys can be used to 
  97. Xrecall previous command lines. The 'history' option can be set to the number 
  98. Xof lines that will be remembered.
  99. X
  100. X
  101. XFilename completion.
  102. XWhile entering a command line (on the bottom line of the screen) <ESC> can be 
  103. Xtyped after an (incomplete) file name wildcard; the wildcard will be 
  104. Xexpanded. If there are multiple matches, CTRL-N (next) and CTRL-P (previous) 
  105. Xwill walk through the matches. CTRL-D can be typed after an (incomplete) file 
  106. Xname wildcard; all matching files will be listed.
  107. X
  108. X
  109. XText formatting.
  110. XThe 'textwidth' (tw) option can be used to automatically limit the line 
  111. Xlength. This replaces the 'wrapmargin' option of Vi, which was not very 
  112. Xuseful. The 'V' operator can be used to format a piece of text ("V}" formats 
  113. Xa paragraph).
  114. X
  115. X
  116. XCommand line options:
  117. X
  118. XWhen Vim is started with "-v" (View) then readonly mode is used (includes 
  119. X"-n").
  120. X
  121. XWhen Vim is started with "-s scriptfile", the characters read from 
  122. X"scriptfile" are treated as if you typed them. If end of file is reached 
  123. Xbefore the editor exits, further characters are read from the console.
  124. X
  125. XThe "-w" option can be used to record all typed characters in a script file. 
  126. XThis file can then be used to redo the editing, possibly on another file or 
  127. Xafter changing some commands in the script file.
  128. X
  129. XThe "-n" option disables the writing of a ".vim" file (see below).
  130. X
  131. XThe "-c command" option does the same as the the "+command" option.
  132. X
  133. XThe "-T terminal" option sets the terminal type.
  134. X
  135. X
  136. XIn command mode:
  137. X
  138. XMissing command: 'Q' (go to Ex mode).
  139. XMissing Ex commands: append, change, insert, open, preserve, recover, 
  140. X(un)abbreviate, visual, z and ~.
  141. X
  142. XThe command characters are shown in the last line of the screen. They are 
  143. Xremoved when the command is finished. If you do not want this (on a slow 
  144. Xterminal) reset the 'showcmd' option.
  145. X
  146. XIf the 'ruler' option is set, the current cursor position is shown in the 
  147. Xlast line of the screen.
  148. X
  149. X'u' and CTRL-R accept a count for the number of undos/redos.
  150. X
  151. X'U' still works after having moved off of the last changed line and after 
  152. X'u'.
  153. X
  154. XNulls in the file are replaced by newlines internally. This allows editing of 
  155. Xbinary files (more or less). When searching for nulls, use a newline in the 
  156. Xsearch pattern.
  157. X
  158. XCharacters with the 8th bit set are displayed. The characters between '~' and 
  159. X0xa0 are displayed as "~?", "~@", "~A", etc., unless the "graphic' option is 
  160. Xset.
  161. X
  162. X'=' is an operator to filter lines through an external command (vi: lisp 
  163. Xstuff). The name of the command can be set with the 'equalprg' option. The 
  164. Xdefault is "indent".
  165. X
  166. X'][' goes to the next ending of a C function ('}' in column 1).
  167. X'[]' goes to the previous ending of a C function ('}' in column 1).
  168. X
  169. X'*' searches forward for the identifier under the cursor, '#' backward.
  170. X'K' runs the program defined by the "keywordprg" option, with the identifier 
  171. Xunder the cursor as argument.
  172. X
  173. X'%' can be preceded with a count. The cursor jumps to the line that 
  174. Xpercentage down in the file.
  175. X
  176. XWith the CTRL-] command, the cursor may be in the middle of the identifier.
  177. X
  178. XThe used tags are remembered. Commands that can be used with the tag stack 
  179. Xare CTRL-T, ':pop' and ':tag'. ':tags' lists the tag stack.
  180. X
  181. XThe 'tags' option can be set to a list of tag file names. Thus multiple 
  182. Xtag files can be used.
  183. X
  184. XPreviously used file names are remembered in the alternate file name list.
  185. XCTRL-^ accepts a count, which is an index in this list.
  186. X
  187. XSearch patterns have more features.
  188. X
  189. XSearches can find the end of a match and may include a character offset.
  190. X
  191. XCount added to '~', ':next', ':Next', 'n' and 'N'.
  192. X
  193. XAdded :wnext command. Same as ":write" followed by ":next".
  194. X
  195. XIf option "tildeop" has been set, '~' is an operator (must be followed by a 
  196. Xmovement command).
  197. X
  198. XWith the 'J' (join) command you can reset the 'joinspaces' (js) option to 
  199. Xhave only one space after a period (Vi inserts two spaces).
  200. X
  201. X'cw' can be used to change white space formed by several characters (Vi is 
  202. Xconfusing: 'cw' only changes one space, while 'dw' deletes all white space).
  203. X
  204. X'o' and 'O' accept a count for repeating the insert (Vi clears a part of 
  205. Xdisplay).
  206. X
  207. X':dis' command shows the contents of the yank buffers.
  208. X
  209. XPreviously used file names are remembered in the alternate file name list.
  210. X':files' command shows the list of alternate filenames.
  211. X'#'<N> means <N>th alternate filename in the list.
  212. X
  213. XFlags after command not supported (no plans to include it).
  214. X
  215. XQuickFix commands included, almost the same as with Manx's Z editor.
  216. XThe 'errorfile' option has the name of the file with error messages.
  217. X
  218. X":cd" command shows current directory instead of going to the home directory.
  219. X":cd ~" goes to home directory.
  220. X
  221. X':source!' command reads Vi commands from a file.
  222. X
  223. X':mkexrc' command writes current modified options and mappings to a ".exrc" 
  224. Xfile. ':mkvimrc' writes to a ".vimrc" file.
  225. X
  226. XThe :put! command inserts the contents of a register above the current line.
  227. X
  228. XThe named register '.' can be used with commands p, P and :put. The contents 
  229. Xof the register is the last inserted text.
  230. X
  231. X':noremap' command can be used to enter a mapping that will not be remapped.
  232. XThis is useful to exchange the meaning of two keys.
  233. X
  234. X':@r' command executes buffer r (is in some versions of vi).
  235. X
  236. XCTRL-O/CTRL-I can be used to jump to older/newer positions. These are the 
  237. Xsame positions as used with the '' command, but may be in another file. The 
  238. X':jumps' command lists the older positions.
  239. X
  240. XIf the 'shiftround' option is set, an indent is rounded to a multiple of 
  241. X'shiftwidth' with '>' and '<' commands.
  242. X
  243. XThe 'scrolljump' option can be set to the minimal number of lines to scroll 
  244. Xwhen the cursor gets off the screen. Use this when scrolling is slow.
  245. X
  246. XUppercase marks can be used to jump between files. The ':marks' command lists 
  247. Xall currently set marks. The commands "']" and "`]" jump to the end of the 
  248. Xprevious operator or end of the text inserted with the put command. "'[" and 
  249. X"`[" do jump to the start.
  250. X
  251. XThe 'shelltype' option can be set to reflect the type of shell used.
  252. X
  253. XThe CTRL-A (add) and CTRL-S (subtract) commands are new. The count to the 
  254. Xcommand (default 1) is added to/subtracted from the number at or after the 
  255. Xcursor. That number may be decimal, octal (starts with a '0') or hexadecimal 
  256. X(starts with '0x'). Very useful in macros.
  257. X
  258. XWith the :set command the prefix "inv" can be used to invert toggle options.
  259. X
  260. X
  261. XIn insert mode:
  262. X
  263. XThe backspace key can be used just like CTRL-D to remove auto-indents.
  264. X
  265. XYou can backspace, ctrl-U and CTRL-W over newlines if the 'backspace' (bs) 
  266. Xoption is set to non-zero. You can backspace over the start of insert if the 
  267. X'backspace' option is set to 2.
  268. X
  269. XIf the 'repdel' option is reset, a <BS> in replace mode will not delete a 
  270. Xcharacter.
  271. X
  272. XCTRL-T/CTRL-D always insert/delete an indent in the current line, no matter 
  273. Xwhat column the cursor is in. '0' and '^' before CTRL-D are ignored.
  274. X
  275. XCTRL-@ (insert previously inserted text) works always (Vi: only when typed as 
  276. Xfirst character).
  277. X
  278. XCTRL-A works like CTRL-@ but does not leave insert mode.
  279. X
  280. XCTRL-B <0-9a-z> can be used to insert the contents of a register.
  281. X
  282. XWhen the 'smartindent' (si) option is set, C programs will be better 
  283. Xauto-indented.
  284. X
  285. XCTRL-R and CTRL-E can be used to copy a character from above/below the 
  286. Xcurrent cursor position.
  287. X
  288. XAfter CTRL-V you can enter a three digit decimal number. This byte value is 
  289. Xinserted in the text as a single character. Useful for international 
  290. Xcharacters that are not on your keyboard.
  291. X
  292. XWhen the 'expandtab' (et) option is set, a <TAB> is expanded to the 
  293. Xappropriate number of spaces.
  294. X
  295. XThe window always reflects the contents of the buffer (Vi does not do this 
  296. Xwhen changing text and in some other cases).
  297. X
  298. XIf Vim is compiled with DIGRAPHS defined, digraphs are supported. A set of 
  299. Xnormal Amiga digraphs is included. They are shown with the :digraph" command. 
  300. XMore can be added with ":digraph {char1}{char2} {number}". A digraph is 
  301. Xentered with "CTRL-K {char1} {char2}" or "{char1} BS {char2}" (only when 
  302. X'digraph' option is set).
  303. X
  304. X
  305. Xgeneral:
  306. X
  307. XMissing options: autoprint (ap), beautify (bf), edcompatible, hardtabs (ht), 
  308. Xlisp, mesg, open, optimize (op), prompt, redraw, slowopen (slow),
  309. Xwarn, window, w300, w1200 and w9600. Terse option ignored.
  310. X
  311. XWhen the 'compatible' option is set, all options are set for maximum 
  312. Xvi-compatibility
  313. X
  314. XThe 'ttimeout' option is like 'timeout', but only works for cursor and 
  315. Xfunction keys, not for ordinary mapped characters.
  316. X
  317. XThere is an option for each terminal string. Can be used when termcap is not 
  318. Xsupported or to change individual strings.
  319. X
  320. XOn systems that have no job control (most systems but BSD-UNIX) the CTRL-Z 
  321. Xand ":stop" command starts a new shell.
  322. X
  323. XIf Vim is started on the Amiga without an interactive window for output, a 
  324. Xwindow is opened (and :sh still works). You can give a device to use for 
  325. Xediting with the '-d' argument, e.g. "-d con:20/20/600/150".
  326. X
  327. XOn startup the VIMINIT or EXINIT environment variables, the file s:.vimrc or 
  328. Xs:.exrc and .vimrc or .exrc are read for initialization commands. When 
  329. Xreading .vimrc and .exrc some commands are not allowed because of security 
  330. Xreasons (shell commands and writing to a file, :map commands are echoed).
  331. X
  332. XLine lenght can be upto 32767 characters, file length upto 2147483646 lines. 
  333. XIf a line is larger than the screen, the last line is filled with <@>s and 
  334. Xonly the part of the line before that is shown.
  335. X
  336. XThe 'columns' option is used to set or get the width of the display.
  337. X
  338. XThe name of the current file name is shown in the title bar of the window.
  339. X
  340. XWildcards in file names are expanded.
  341. X
  342. XOption settings are read from the first and last few lines of the file. 
  343. XOption 'modelines' determines how many lines are tried (default is 5). Note 
  344. Xthat this is different from the Vi versions that can execute any Ex command 
  345. Xin a modeline (a major security problem).
  346. X
  347. XIf the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode.
  348. X
  349. XAll text is kept in memory. Available memory limits the file size (and other 
  350. Xthings such as undo). This may be a problem with MSDOS, is hardly a problem 
  351. Xont the Amiga and almost never with Unix.
  352. X
  353. XIf the "backup" or "writebackup" option is set: Before a file is overwritten, 
  354. Xa backup file (.bak) is made. If the "backup" option is set it is left 
  355. Xbehind.
  356. X
  357. XAll entered commands and text is written into a script file, ending in 
  358. X".vim". This can be used to recover your work if the machine crashes during 
  359. Xan edit session. This can be switched off by setting the 'updatecount' option 
  360. Xto 0 or starting Vim with the "-n" option. Use the 'directory' option for 
  361. Xplacing the .vim file somewhere else.
  362. X
  363. XThe 'shortname' (sn) option, when set, tells Vim that ".bak" and ".vim" 
  364. Xfilenames are to be MSDOS-like: 8 characters plus 3 for extention. This 
  365. Xshould be used on messydos or crossdos filesystems on the Amiga. If this 
  366. Xoption is off, Vim tries to guess if MSDOS filename restrictions are 
  367. Xeffective.
  368. X
  369. XRecovery after a crash has a smaller chance for success, because there is no 
  370. Xtemporary file.
  371. X
  372. XError messages are shown at least one second (Vi overwrites error messages).
  373. X
  374. XIf Vim asks to "Hit RETURN to continue", you can hit any key. Characters 
  375. Xother than <CR>, <NL> and <SPACE> are interpreted as the (start of) a 
  376. Xcommand. (Vi only accepts a command starting with ':').
  377. X
  378. XThe contents of the numbered registers is remembered when changing files.
  379. X
  380. XThe AUX: device of the Amiga is supported.
  381. X
  382. Xvi:tw=77:
  383. END_OF_FILE
  384. if test 14014 -ne `wc -c <'vim/doc/difference.doc'`; then
  385.     echo shar: \"'vim/doc/difference.doc'\" unpacked with wrong size!
  386. fi
  387. # end of 'vim/doc/difference.doc'
  388. fi
  389. if test -f 'vim/src/termlib.c' -a "${1}" != "-c" ; then 
  390.   echo shar: Will not clobber existing file \"'vim/src/termlib.c'\"
  391. else
  392. echo shar: Extracting \"'vim/src/termlib.c'\" \(15527 characters\)
  393. sed "s/^X//" >'vim/src/termlib.c' <<'END_OF_FILE'
  394. X/* vi:sw=4:ts=4:
  395. X   The following software is (C) 1984 Peter da Silva,
  396. X   the Mad Australian, in the public domain. It may
  397. X   be re-distributed for any purpose with the inclusion
  398. X   of this notice. */
  399. X/* modified by Bram Moolenaar */
  400. X
  401. X/* TERMLIB: Terminal independant database. */
  402. X
  403. X#include "vim.h"
  404. X#include "proto.h"
  405. X#include "proto/termlib.pro"
  406. X
  407. X#ifndef AMIGA
  408. X# include <sgtty.h>
  409. X#endif
  410. X
  411. Xstatic int    getent __PARMS((char *, char *, FILE *, int));
  412. Xstatic int    nextent __PARMS((char *, FILE *, int));
  413. Xstatic int    _match __PARMS((char *, char *));
  414. Xstatic char    *_addfmt __PARMS((char *, char *, int));
  415. Xstatic char    *_find __PARMS((char *, char *));
  416. X
  417. X/*
  418. X * Global variables for termlib
  419. X */
  420. X
  421. Xchar    *tent;                /* Pointer to terminal entry, set by tgetent */
  422. Xchar    PC = 0;               /* Pad character, default NULL */
  423. Xchar    *UP = 0, *BC = 0;     /* Pointers to UP and BC strings from database */
  424. Xshort    ospeed;               /* Baud rate (1-16, 1=300, 16=19200), as in stty */
  425. X
  426. X/*
  427. X * Module: tgetent
  428. X *
  429. X * Purpose: Get termcap entry for <term> into buffer at <tbuf>.
  430. X *
  431. X * Calling conventions: char tbuf[TBUFSZ+], term=canonical name for
  432. X *            terminal.
  433. X *
  434. X * Returned values: 1 = success, -1 = can't open file,
  435. X *            0 = can't find terminal.
  436. X *
  437. X * Notes
  438. X *        Should probably supply static buffer.
  439. X *
  440. X *        Uses environment variables "TERM" and
  441. X *    "TERMCAP". If TERM = term (that is, if the argument
  442. X *    matches the environment) then it looks at TERMCAP.
  443. X *        If TERMCAP begins with a slash, then it assumes
  444. X *    this is the file to search rather than /etc/termcap.
  445. X *        If TERMCAP does not begin with a slash, and it
  446. X *    matches TERM, then this is used as the entry.
  447. X *
  448. X *        This could be simplified considerably for non-UNIX
  449. X *    systems.
  450. X */
  451. X
  452. X#ifdef AMIGA
  453. X# define TERMCAPFILE "s:termcap"
  454. X#else
  455. X# define TERMCAPFILE "/etc/termcap"
  456. X#endif
  457. X
  458. Xtgetent(tbuf, term)
  459. X    char    *tbuf;               /* Buffer to hold termcap entry, TBUFSZ bytes max */
  460. X    char    *term;               /* Name of terminal */
  461. X{
  462. X    char    tcbuf[32];           /* Temp buffer to handle */
  463. X    char    *tcptr = tcbuf;      /* extended entries */
  464. X    char    *tcap = TERMCAPFILE; /* Default termcap file */
  465. X    char    *tmp;
  466. X    FILE    *termcap;
  467. X    int        retval = 0;
  468. X    int        len;
  469. X
  470. X    if ((tmp = (char *)vimgetenv("TERMCAP")) != NULL)
  471. X    {
  472. X        if (*tmp == '/')            /* TERMCAP = name of termcap file */
  473. X            tcap = tmp ;
  474. X        else                        /* TERMCAP = termcap entry itself */
  475. X        {
  476. X            int tlen = strlen(term);
  477. X
  478. X            while (*tmp && *tmp != ':') /* Check if TERM matches */
  479. X            {
  480. X                while (*tmp == '|')
  481. X                    tmp++;
  482. X                if (_match(tmp, term) == tlen)
  483. X                {
  484. X                    strcpy(tbuf, tmp);
  485. X                    tent = tbuf;
  486. X                    return 1;
  487. X                } 
  488. X                else
  489. X                    tmp = _find(tmp, ":|");
  490. X            }
  491. X        }
  492. X    }
  493. X    if (!(termcap = fopen(tcap, "r")))
  494. X    {
  495. X        strcpy(tbuf, tcap);
  496. X        return -1;
  497. X    }
  498. X
  499. X    len = 0;
  500. X    while (getent(tbuf + len, term, termcap, TBUFSZ - len))
  501. X    {
  502. X        if ((term = tgetstr("tc", &tcptr)))         /* extended entry */
  503. X        {
  504. X            rewind(termcap);
  505. X            len = strlen(tbuf);
  506. X        }
  507. X        else
  508. X        {
  509. X            retval = 1; 
  510. X            tent = tbuf;
  511. X            break;
  512. X        }
  513. X    }
  514. X    fclose(termcap);
  515. X    return retval;
  516. X}
  517. X
  518. X    static int
  519. Xgetent(tbuf, term, termcap, buflen)
  520. X    char    *tbuf, *term;
  521. X    FILE    *termcap;
  522. X    int        buflen;
  523. X{
  524. X    char    *tptr;
  525. X    int        tlen = strlen(term);
  526. X
  527. X    while (nextent(tbuf, termcap, buflen))   /* For each possible entry */
  528. X    {
  529. X        tptr = tbuf;
  530. X        while (*tptr && *tptr != ':')    /* : terminates name field */
  531. X        {
  532. X            while (*tptr == '|')             /* | seperates names */
  533. X                tptr++;
  534. X            if (_match(tptr, term) == tlen)             /* FOUND! */
  535. X            {
  536. X                tent = tbuf;
  537. X                return 1;
  538. X            } 
  539. X            else                           /* Look for next name */
  540. X                tptr = _find(tptr, ":|");
  541. X        }
  542. X    }
  543. X    return 0;
  544. X}
  545. X
  546. X    static int
  547. Xnextent(tbuf, termcap, buflen)         /* Read 1 entry from TERMCAP file */
  548. X    char    *tbuf;
  549. X    FILE    *termcap;
  550. X    int        buflen;
  551. X{
  552. X    char *lbuf = tbuf;           /* lbuf=line buffer */
  553. X                                 /* read lines straight into buffer */
  554. X
  555. X    while (lbuf < tbuf+buflen &&                        /* There's room and */
  556. X          fgets(lbuf, (int)(tbuf+buflen-lbuf), termcap))        /* another line */
  557. X    {
  558. X        int llen = strlen(lbuf);
  559. X
  560. X        if (*lbuf == '#')                               /* eat comments */
  561. X            continue;
  562. X        if (lbuf[-1] == ':' &&                        /* and whitespace */
  563. X            lbuf[0] == '\t' &&
  564. X            lbuf[1] == ':')
  565. X        {
  566. X            strcpy(lbuf, lbuf+2);
  567. X            llen -= 2;
  568. X        }
  569. X        if (lbuf[llen-2] == '\\')                  /* and continuations */
  570. X            lbuf += llen-2;
  571. X        else
  572. X        {
  573. X            lbuf[llen-1]=0;           /* no continuation, return */
  574. X            return 1;
  575. X        }
  576. X    }
  577. X
  578. X    return 0;                                    /* ran into end of file */
  579. X}
  580. X
  581. X/*
  582. X * Module: tgetflag
  583. X *
  584. X * Purpose: returns flag true or false as to the existence of a given
  585. X *        entry. used with 'bs', 'am', etc...
  586. X *
  587. X * Calling conventions: id is the 2 character capability id.
  588. X *
  589. X * Returned values: 1 for success, 0 for failure.
  590. X */
  591. X
  592. Xtgetflag(id)
  593. X    char *id;
  594. X{
  595. X    char    buf[256], *ptr = buf;
  596. X
  597. X    return tgetstr(id, &ptr) ? 1 : 0;
  598. X}
  599. X
  600. X/*
  601. X * Module: tgetnum
  602. X *
  603. X * Purpose: get numeric value such as 'li' or 'co' from termcap.
  604. X *
  605. X * Calling conventions: id = 2 character id.
  606. X *
  607. X * Returned values: -1 for failure, else numerical value.
  608. X */
  609. X
  610. Xtgetnum(id)
  611. Xchar *id;
  612. X{
  613. X    char *ptr, buf[256];
  614. X    ptr = buf;
  615. X
  616. X    if (tgetstr(id, &ptr))
  617. X        return atoi(buf);
  618. X    else
  619. X        return 0;
  620. X}
  621. X
  622. X/*
  623. X * Module: tgetstr
  624. X *
  625. X * Purpose: get terminal capability string from database.
  626. X *
  627. X * Calling conventions: id is the two character capability id.
  628. X *            (*buf) points into a hold buffer for the
  629. X *            id. the capability is copied into the buffer
  630. X *            and (*buf) is advanced to point to the next
  631. X *            free byte in the buffer.
  632. X *
  633. X * Returned values: 0 = no such entry, otherwise returns original
  634. X *            (*buf) (now a pointer to the string).
  635. X *
  636. X * Notes
  637. X *        It also decodes certain escape sequences in the buffer.
  638. X *    they should be obvious from the code:
  639. X *        \E = escape.
  640. X *        \n, \r, \t, \f, \b match the 'c' escapes.
  641. X *        ^x matches control-x (^@...^_).
  642. X *        \nnn matches nnn octal.
  643. X *        \x, where x is anything else, matches x. I differ
  644. X *    from the standard library here, in that I allow ^: to match
  645. X *    :.
  646. X *
  647. X */
  648. X
  649. Xchar *
  650. Xtgetstr(id, buf)
  651. Xchar    *id, **buf;
  652. X{
  653. X    int    len = strlen(id);
  654. X    char *tmp=tent;
  655. X    char *hold;
  656. X    int        i;
  657. X
  658. X    do {
  659. X        tmp = _find(tmp, ":");                     /* For each field */
  660. X        while (*tmp == ':')                        /* skip empty fields */
  661. X            tmp++;
  662. X        if (!*tmp)
  663. X            break;
  664. X
  665. X        if (_match(id, tmp) == len) {
  666. X            tmp += len;                   /* find '=' '@' or '#' */
  667. X            if (*tmp == '@')                  /* :xx@: entry for tc */
  668. X                return 0;                   /* deleted entry */
  669. X            hold= *buf;
  670. X            while (*++tmp && *tmp != ':') {/* not at end of field */
  671. X                switch(*tmp) {
  672. X                case '\\':            /* Expand escapes here */
  673. X                    switch(*++tmp) {
  674. X                    case 0:        /* ignore backslashes */
  675. X                        tmp--;    /* at end of entry */
  676. X                        break;   /* shouldn't happen */
  677. X                    case 'e':
  678. X                    case 'E':                     /* ESC */
  679. X                        *(*buf)++ = '\033'; 
  680. X                        break;
  681. X                    case 'n':                      /* \n */
  682. X                        *(*buf)++ = '\n'; 
  683. X                        break;
  684. X                    case 'r':                      /* \r */
  685. X                        *(*buf)++ = '\r'; 
  686. X                        break;
  687. X                    case 't':                      /* \t */
  688. X                        *(*buf)++ = '\t'; 
  689. X                        break;
  690. X                    case 'b':                      /* \b */
  691. X                        *(*buf)++ = '\b'; 
  692. X                        break;
  693. X                    case 'f':                      /* \f */
  694. X                        *(*buf)++ = '\f'; 
  695. X                        break;
  696. X                    case '0':                    /* \nnn */
  697. X                    case '1': 
  698. X                    case '2': 
  699. X                    case '3': 
  700. X                    case '4':
  701. X                    case '5': 
  702. X                    case '6': 
  703. X                    case '7': 
  704. X                    case '8': 
  705. X                    case '9':
  706. X                        **buf = 0;
  707. X                            /* get up to three digits */
  708. X                        for (i = 0; i < 3 && isdigit(*tmp); ++i)
  709. X                            **buf = **buf * 8 + *tmp++ - '0';
  710. X                        (*buf)++;
  711. X                        tmp--;
  712. X                        break;
  713. X                    default:      /* \x, for all other x */
  714. X                        *(*buf)++= *tmp;
  715. X                    }
  716. X                    break;
  717. X                case '^':              /* control characters */
  718. X                    *(*buf)++ = *++tmp - '@'; 
  719. X                    break;
  720. X                default: 
  721. X                    *(*buf)++ = *tmp;
  722. X                }
  723. X            }
  724. X            *(*buf)++ = 0;
  725. X            return hold;
  726. X        }
  727. X    } while (*tmp);
  728. X
  729. X    return 0;
  730. X}
  731. X
  732. X/*
  733. X * Module: tgoto
  734. X *
  735. X * Purpose: decode cm cursor motion string.
  736. X *
  737. X * Calling conventions: cm is cursor motion string.
  738. X *            line, col, are the desired destination.
  739. X *
  740. X * Returned values: a string pointing to the decoded string, or
  741. X *            "OOPS" if it cannot be decoded.
  742. X *
  743. X * Notes
  744. X *        The accepted escapes are:
  745. X *            %d     as in printf, 0 origin.
  746. X *            %2, %3     like %02d, %03d in printf.
  747. X *            %.     like %c
  748. X *            %+x     adds <x> to value, then %.
  749. X *            %>xy     if value>x, adds y. No output.
  750. X *            %i     increments line& col, no output.
  751. X *            %r     reverses order of line&col. No output.
  752. X *            %%     prints as a single %.
  753. X *            %n     exclusive or row & col with 0140.
  754. X *            %B     BCD, no output.
  755. X *            %D     reverse coding (x-2*(x%16)), no output.
  756. X */
  757. X
  758. Xchar *
  759. Xtgoto(cm, col, line)
  760. Xchar    *cm;                                      /* cm string, from termcap */
  761. Xint    col,                                           /* column, x position */
  762. X    line;                                            /* line, y position */
  763. X{
  764. X    char    gx, gy,                                           /*    x, y */
  765. X        *ptr,                                     /* pointer in 'cm' */
  766. X        reverse = 0,                                 /* reverse flag */
  767. X        *bufp,                         /* pointer in returned string */
  768. X        addup = 0,                                     /* add upline */
  769. X        addbak = 0,                                    /* add backup */
  770. X        c;
  771. X    static char buffer[32];
  772. X
  773. X    if (!cm)
  774. X        return "OOPS";                       /* Kludge, but standard */
  775. X
  776. X    bufp = buffer;
  777. X    ptr = cm;
  778. X
  779. X    while (*ptr) {
  780. X        if ((c = *ptr++) != '%') {                     /* normal char */
  781. X            *bufp++ = c;
  782. X        } else {                                         /* % escape */
  783. X            switch(c = *ptr++) {
  784. X            case 'd':                                 /* decimal */
  785. X                bufp = _addfmt(bufp, "%d", line);
  786. X                line = col;
  787. X                break;
  788. X            case '2':                         /* 2 digit decimal */
  789. X                bufp = _addfmt(bufp, "%02d", line);
  790. X                line = col;
  791. X                break;
  792. X            case '3':                         /* 3 digit decimal */
  793. X                bufp = _addfmt(bufp, "%03d", line);
  794. X                line = col;
  795. X                break;
  796. X            case '>':                      /* %>xy: if >x, add y */
  797. X                gx = *ptr++;
  798. X                gy = *ptr++;
  799. X                if (col>gx) col += gy;
  800. X                if (line>gx) line += gy;
  801. X                break;
  802. X            case '+':                              /* %+c: add c */
  803. X                line += *ptr++;
  804. X            case '.':                               /* print x/y */
  805. X                if (line == '\t' ||                /* these are */
  806. X                   line == '\n' ||             /* chars that */
  807. X                   line == '\004' ||             /* UNIX hates */
  808. X                   line == '\0') {
  809. X                    line++;         /* so go to next pos */
  810. X                    if (reverse == (line == col))
  811. X                        addup=1;      /* and mark UP */
  812. X                    else
  813. X                        addbak=1;           /* or BC */
  814. X                }
  815. X                *bufp++=line;
  816. X                line = col;
  817. X                break;
  818. X            case 'r':                              /* r: reverse */
  819. X                gx = line; 
  820. X                line = col; 
  821. X                col = gx;
  822. X                reverse = 1;
  823. X                break;
  824. X            case 'i':             /* increment (1-origin screen) */
  825. X                col++;
  826. X                line++;
  827. X                break;
  828. X            case '%':                          /* %%=% literally */
  829. X                *bufp++='%';
  830. X                break;
  831. X            case 'n':                       /* magic DM2500 code */
  832. X                line ^= 0140;
  833. X                col ^= 0140;
  834. X                break;
  835. X            case 'B':                            /* bcd encoding */
  836. X                line = line/10<<4+line%10;
  837. X                col = col/10<<4+col%10;
  838. X                break;
  839. X            case 'D':                   /* magic Delta Data code */
  840. X                line = line-2*(line&15);
  841. X                col = col-2*(col&15);
  842. X                break;
  843. X            default:                           /* Unknown escape */
  844. X                return "OOPS";
  845. X            }
  846. X        }
  847. X    }
  848. X
  849. X    if (addup)                                              /* add upline */
  850. X        if (UP) {
  851. X            ptr=UP;
  852. X            while (isdigit(*ptr) || *ptr == '.')
  853. X                ptr++;
  854. X            if (*ptr == '*')
  855. X                ptr++;
  856. X            while (*ptr)
  857. X                *bufp++ = *ptr++;
  858. X        }
  859. X
  860. X    if (addbak)                                          /* add backspace */
  861. X        if (BC) {
  862. X            ptr=BC;
  863. X            while (isdigit(*ptr) || *ptr == '.')
  864. X                ptr++;
  865. X            if (*ptr == '*')
  866. X                ptr++;
  867. X            while (*ptr)
  868. X                *bufp++ = *ptr++;
  869. X        } 
  870. X        else
  871. X            *bufp++='\b';
  872. X
  873. X    *bufp = 0;
  874. X
  875. X    return(buffer);
  876. X}
  877. X
  878. X/*
  879. X * Module: tinit
  880. X *
  881. X * Purpose: simplified terminal initialisation.
  882. X *
  883. X * Calling conventions: name is name of terminal.
  884. X *
  885. X * Returned values: none.
  886. X *
  887. X * Notes
  888. X *        tinit calls tgetent, then sets up the global
  889. X *    variables PC, UP, BC, ospeed appropriately.
  890. X *
  891. X */
  892. X
  893. X#if 0        /* already included in term.c */
  894. X
  895. Xchar tbuf[TBUFSZ];                                /* Buffer for termcap entry */
  896. Xchar junkbuf[TBUFSZ];                                  /* Big buffer for junk */
  897. Xchar *junkptr;
  898. X
  899. Xtinit(name)
  900. Xchar *name;
  901. X{
  902. X#ifndef AMIGA
  903. X    struct sgttyb sgbuf;
  904. X#endif
  905. X    char *ps;
  906. X
  907. X    junkptr = junkbuf;
  908. X
  909. X    tgetent(tbuf, name);
  910. X
  911. X    ps = tgetstr("pc", &junkptr);
  912. X    if (ps) PC = *ps;
  913. X    UP = tgetstr("up", &junkptr);
  914. X    BC = tgetstr("bc", &junkptr);
  915. X
  916. X#ifdef AMIGA
  917. X    ospeed=0;
  918. X#else
  919. X    gtty(1, &sgbuf);
  920. X    ospeed=sgbuf.sg_ospeed;
  921. X#endif
  922. X    return 0;
  923. X}
  924. X#endif
  925. X
  926. X/*
  927. X * Module: tputs
  928. X *
  929. X * Purpose: decode padding information
  930. X *
  931. X * Calling conventions: cp = string to be padded, affcnt = # of items
  932. X *            affected (lines, characters, whatever),
  933. X *            outc = routine to output 1 character.
  934. X *
  935. X * Returned values: none
  936. X *
  937. X * Notes
  938. X *        cp has padding information ahead of it, in the form
  939. X *    nnnTEXT or nnn*TEXT. nnn is the number of milliseconds to delay,
  940. X *    and may be a decimal (nnn.mmm). If the asterisk is given, then
  941. X *    the delay is multiplied by afcnt. The delay is produced by outputting
  942. X *    a number of nulls (or other padding char) after printing the
  943. X *    TEXT.
  944. X *
  945. X */
  946. X
  947. Xlong _bauds[16]={
  948. X    0,    50,    75,    110,
  949. X    134,    150,    200,    300,
  950. X    600,    1200,    1800,    2400,
  951. X    4800,    9600,    19200,    19200 };
  952. X
  953. Xtputs(cp, affcnt, outc)
  954. Xchar *cp;                                                 /* string to print */
  955. Xint affcnt;                                      /* Number of lines affected */
  956. Xvoid (*outc) __ARGS((unsigned int));                              /* routine to output 1 character */
  957. X{
  958. X    long    frac,                    /* 10^(#digits after decimal point) */
  959. X        counter,                                           /* digits */
  960. X        atol();
  961. X
  962. X    if (isdigit(*cp)) {
  963. X        counter = 0;
  964. X        frac = 1000;
  965. X        while (isdigit(*cp))
  966. X            counter = counter * 10L + (long)(*cp++ - '0');
  967. X        if (*cp == '.')
  968. X            while (isdigit(*++cp)) {
  969. X                counter = counter * 10L + (long)(*cp++ - '0');
  970. X                frac = frac * 10;
  971. X            }
  972. X        if (*cp!='*') {                 /* multiply by affected lines */
  973. X            if (affcnt>1) affcnt = 1;
  974. X        } 
  975. X        else
  976. X            cp++;
  977. X
  978. X        /* Calculate number of characters for padding counter/frac ms delay */
  979. X        if (ospeed)
  980. X            counter = (counter * _bauds[ospeed] * (long)affcnt) / frac;
  981. X
  982. X        while (*cp)                                  /* output string */
  983. X            (*outc)(*cp++);
  984. X        if (ospeed)
  985. X            while (counter--)            /* followed by pad characters */
  986. X                (*outc)(PC);
  987. X    } 
  988. X    else
  989. X        while (*cp)
  990. X            (*outc)(*cp++);
  991. X    return 0;
  992. X}
  993. X
  994. X/*
  995. X * Module: tutil.c
  996. X *
  997. X * Purpose: Utility routines for TERMLIB functions.
  998. X *
  999. X */
  1000. X
  1001. X    static int
  1002. X_match(s1, s2)                 /* returns length of text common to s1 and s2 */
  1003. Xchar *s1, *s2;
  1004. X{
  1005. X    int i = 0;
  1006. X
  1007. X    while (s1[i] && s1[i] == s2[i])
  1008. X        i++;
  1009. X
  1010. X    return i;
  1011. X}
  1012. X
  1013. X    static char *
  1014. X_find(s, set)   /* finds next c in s that's a member of set, returns pointer */
  1015. Xchar *s, *set;
  1016. X{
  1017. X    for(; *s; s++) {
  1018. X        char    *ptr = set;
  1019. X
  1020. X        while (*ptr && *s != *ptr)
  1021. X            ptr++;
  1022. X
  1023. X        if (*ptr)
  1024. X            return s;
  1025. X    }
  1026. X
  1027. X    return s;
  1028. X}
  1029. X
  1030. X    static char *
  1031. X_addfmt(buf, fmt, val)             /* add val to buf according to format fmt */
  1032. Xchar *buf, *fmt;
  1033. Xint val;
  1034. X{
  1035. X    sprintf(buf, fmt, val);
  1036. X    while (*buf)
  1037. X        buf++;
  1038. X    return buf;
  1039. X}
  1040. END_OF_FILE
  1041. if test 15527 -ne `wc -c <'vim/src/termlib.c'`; then
  1042.     echo shar: \"'vim/src/termlib.c'\" unpacked with wrong size!
  1043. fi
  1044. # end of 'vim/src/termlib.c'
  1045. fi
  1046. if test -f 'vim/src/version.c' -a "${1}" != "-c" ; then 
  1047.   echo shar: Will not clobber existing file \"'vim/src/version.c'\"
  1048. else
  1049. echo shar: Extracting \"'vim/src/version.c'\" \(14258 characters\)
  1050. sed "s/^X//" >'vim/src/version.c' <<'END_OF_FILE'
  1051. X/* vi:ts=4:sw=4:tw=77
  1052. X *
  1053. X *
  1054. X * VIM - Vi IMitation
  1055. X *
  1056. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  1057. X *                            Tim Thompson            twitch!tjt
  1058. X *                            Tony Andrews            onecom!wldrdg!tony 
  1059. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  1060. X */
  1061. X
  1062. X/*
  1063. X Started with Stevie version 3.6 (Fish disk 217) - GRWalter (Fred)
  1064. X
  1065. X VIM 1.0    - Changed so many things that I felt that a new name was required
  1066. X            (I didn't like the name Stevie that much: I don't have an ST).
  1067. X            - VIM stands for "Vi IMitation".
  1068. X            - New storage structure, MULTI-LEVEL undo and redo,
  1069. X            improved screen output, removed an awful number of bugs,
  1070. X            removed fixed size buffers, added counts to a lot of commands,
  1071. X            added new commands, added new options, added 'smart indent',
  1072. X            added recording mode, added script files, moved help to a file,
  1073. X            etc. etc. etc.
  1074. X            - Compiles under Manx/Aztec C 5.0. You can use "rez" to make VIM
  1075. X            resident.
  1076. X            - Bram Moolenaar (Mool)
  1077. X
  1078. X VIM 1.09 - spaces can be used in tags file instead of tabs (compatible with
  1079. X            Manx ctags).
  1080. X
  1081. X VIM 1.10 - Csh not required anymore for CTRL-D. Search options /e and /s added.
  1082. X            Shell option implemented. BS in replace mode does not delete
  1083. X            character. Backspace, wrapmargin and tags options added.
  1084. X            Added support for Manx's QuickFix mode (just like "Z").
  1085. X            The ENV: environment variables instead of the Old Manx environment
  1086. X            variables are now used, because Vim was compiled with version 5.0d
  1087. X            of the compiler. "mool" library not used anymore. Added index to
  1088. X            help screens.
  1089. X
  1090. X VIM 1.11 - removed bug that caused :e of same file, but with name in upper case,
  1091. X            to re-edit that file.
  1092. X
  1093. X VIM 1.12 - The second character of several commands (e.g. 'r', 't', 'm') not
  1094. X            :mapped anymore (UNIX vi does it like this, don't know why); Some
  1095. X            operators did not work when doing a 'l' on the last character in
  1096. X            a line (e.g. 'yl'); Added :mapping when executing registers;
  1097. X            Removed vi incompatibility from 't' and 'T' commands; :mapping! also
  1098. X            works for command line editing; Changed a few details to have Vim
  1099. X            run the macros for solving a maze and Towers of Hanoi! It now also
  1100. X            runs the Turing machine macros!
  1101. X
  1102. X VIM 1.13 - Removed a bug for !! on empty line. "$" no longer puts cursor at
  1103. X            the end of the line when combined with an operator. Added
  1104. X            automatic creation of a script file for recovery after a crash.
  1105. X            Added "-r" option. Solved bug for not detecting end of script file.
  1106. X            ".bak" is now appended, thus "main.c" and "main.h" will have
  1107. X            separate backup files.
  1108. X
  1109. X VIM 1.14 - Removed a few minor bugs. Added "-n" option to skip autoscript.
  1110. X            Made options more Vi compatible. Improved ^C handling. On serious
  1111. X            errors typahead and scripts are discarded. 'U' is now correctly
  1112. X            undone with 'u'. Fixed showmatch() handling of 'x' and '\x'.
  1113. X            Solved window size dependency for scripts by adding ":winsize"
  1114. X            commands to scripts. This version released on Fish disk 591.
  1115. X
  1116. X VIM 1.15 - No extra return in recording mode (MCHAR instead of MLINE buffer).
  1117. X            plural() argument is now a long. Search patterns shared between
  1118. X            :g, :s and /. After recovery a message is given. Overflow of mapbuf
  1119. X            is detected. Line number possible with :read. Error message when
  1120. X            characters follow a '$' in a search pattern. Cause for crash
  1121. X            removed: ":s/pat/repl/g" allocated not enough memory. Option
  1122. X            "directory" added. Option "expandtab" added. Solved showmode non-
  1123. X            functioning. Solved bug with window resizing. Removed some *NULL
  1124. X            references. CTRL-], * and # commands now skips non-identifier
  1125. X            characters. Added tag list, CTRL-T, :pop and :tags commands.
  1126. X            Added jump list, CTRL-O and CTRL-I commands. Added "shiftround"
  1127. X            option. Applied AUX and Lattice mods from Juergen Weigert.
  1128. X            Finally made linenr_t a long, files can be > 65000 lines!
  1129. X            :win command could be written to script file halfway a command.
  1130. X            Option shelltype added. With ^V no mapping anymore.
  1131. X            Added :move, :copy, :t, :mark and :k. Improved Ex address parsing.
  1132. X            Many delimiters possible with :s.
  1133. X
  1134. X VIM 1.16 - Solved bug with zero line number in Ex range. Added file-number to
  1135. X            jump list. Solved bug when scrolling downwards. Made tagstack vi
  1136. X            compatible. Cmdline editing: CTRL-U instead of '@'. Made Vim DICE
  1137. X            compatible. Included regexp improvements from Olaf Seibert,
  1138. X            mapstring() removed. Removed bug with CTRL-U in insert mode.
  1139. X            Count allowed before ". Added uppercase (file) marks. Added
  1140. X            :marks command. Added joinspaces option. Added :jumps command. Made
  1141. X            jumplist compatible with tag list. Added count to :next and :Next.
  1142. X
  1143. X VIM 1.17 - Removed '"' for Ex register name. Repaired stupid bug in tag code.
  1144. X            Now compiled with Aztec 5.2a. Changed Arpbase.h for use with 2.04
  1145. X            includes. Added repdel option. Improved :set listing. Added count
  1146. X            to 'u' and CTRL-R commands. "vi:" and "ex:" in modelines must now
  1147. X            be preceded with a blank. Option "+command" for command line and
  1148. X            :edit command added.
  1149. X
  1150. X VIM 1.18 - Screen was not updated when all lines deleted. Readfile() now
  1151. X            puts cursor on first new line. Catch strange disk label.
  1152. X            Endless "undo line missing" loop removed. With empty file 'O' would
  1153. X            cause this. Added window size reset in windexit(). Flush .vim file
  1154. X            only when buffer has been changed. Added the nice things from
  1155. X            Elvis 1.5: Added "equalprg" and "ruler" option. Added quoting.
  1156. X            Added third meaning to 'backspace' option: backspacing over start
  1157. X            of insert. Added "-c {command}" command line option. Made generating
  1158. X            of prototypes automatically. Added insert mode command CTRL-O and
  1159. X            arrow keys. CTRL-T/CTRL-D now always insert/delete indent. When
  1160. X            starting an edit on specified lnum there was redraw of first lines.
  1161. X            Added 'inputmode' option. Added CTRL-A and CTRL-S commands. '`' is
  1162. X            now exclusive (as it should be). Added digraphs as an option.
  1163. X            Changed implementation of parameters. Added :wnext command.
  1164. X            Added ':@r' command. Changed handling of CTRL-V in command line.
  1165. X            Block macros now work. Added keyword lookup command 'K'. Added
  1166. X            CTRL-N and CTRL-P to command line editing. For DOS 2.0x the Flush
  1167. X            function is used for the autoscript file; this should solve the
  1168. X            lockup bug. Added wait_return to msg() for long messages.
  1169. X
  1170. X VIM 1.19 - Changes from Juergen Weigert:
  1171. X            Terminal type no longer restricted to machine console. New
  1172. X            option -T terminal. New set option "term". Builtin termcap 
  1173. X            entries for "amiga", "ansi", "atari", "nansi", "pcterm". 
  1174. X            Ported to MSDOS. New set option "textmode" ("tx") to control 
  1175. X            CR-LF translation. CTRL-U and CTRL-D scroll half a screen full,
  1176. X            rather than 12 lines. New set option "writebackup" ("wb") to 
  1177. X            disable even the 'backup when writing' feature.
  1178. X            Ported to SunOS. Full termcap support. Does resize on SIGWINCH.
  1179. X
  1180. X            Made storage.c portable. Added reading of ".vimrc". Added
  1181. X            'helpfile' option. With quoting the first char of an empty line
  1182. X            is inverted. Optimized screen updating a bit. Startup code 
  1183. X            looks for VIMINIT variable and .vimrc file first. Added option
  1184. X            helpfile. Solved bug of inserting deletes: redefined ISSPECIAL.
  1185. X            Changed inchar() to use key codes from termcap. Added parameters
  1186. X            for terminal codes. Replaced aux device handling by amiga window
  1187. X            handling. Added optional termcap code. Added 'V', format
  1188. X            operator.
  1189. X
  1190. X VIM 1.20 - wait_return only ignores CR, LF and space. 'V' also works for
  1191. X            single line. No redrawing while formatting text. Added CTRL-Z.
  1192. X            Added usage of termcap "ks" and "ke". Fixed showmatch().
  1193. X            Added timeout option. Added newfile argument to readfile().
  1194. X
  1195. X VIM 1.21 - Added block mode. Added 'o' command for quoting. Added :set inv.
  1196. X            Added pos2ptr(). Added repeating and '$' to Quoting.
  1197. X
  1198. X VIM 1.22 - Fixed a bug in doput() with count > 1.
  1199. X            Port to linux by Juergen Weigert included.
  1200. X            More unix semantics in writeit(), forceit flag ignores errors while 
  1201. X            preparing backup file. For UNIX, backup is now copied, not moved.
  1202. X            When the current directory is not writable, vim now tries a backup
  1203. X            in the directory given with the backupdir option. For UNIX, raw mode
  1204. X            has now ICRNL turned off, that allowes ^V^M. Makefiles for BSD,
  1205. X            SYSV, and linux unified in makefile.unix. For MSDOS
  1206. X            mch_get_winsize() implemented. Reimplemented builtin termcaps in
  1207. X            term.c and term.h. set_term() now handles all cases. Even builtins
  1208. X            when TERMCAP is defined. Show "..." while doing filename completion.
  1209. X
  1210. X VIM 1.23 -    Improved MSDOS version: Added function and cursor keys to builtin 
  1211. X            pcterm. Replaced setmode by settmode, delay by vim_delay and 
  1212. X            delline by dellines to avoid name conflicts. Made F1 help key.
  1213. X            Renamed makecmdtab to mkcmdtab and cmdsearch to csearch for 
  1214. X            8 char name limit. Wildcard expansion adds *.* to names without a 
  1215. X            dot. Added shell execution.
  1216. X            For unix: writeit() overwrites readonly files when forced write,
  1217. X            more safety checks. Termcap buffer for linux now 2048 bytes.
  1218. X            Expandone() no longer appends "*" to file name. Added "graphic"
  1219. X            option. Added ':' command to quoting.
  1220. X            
  1221. X VIM 1.24    Adjusted number of spaces inserted by dojoin(). MSDOS version uses 
  1222. X            searchpath() to find helpfile. Fixed a few small problems. Fixed 
  1223. X            nasty bug in getperm() for SAS 6.0. Removed second argument from 
  1224. X            wait_return(). Script files accessed in binary mode with MSDOS. 
  1225. X            Added 'u' and 'U' commands to quoting (make upper or lower case). 
  1226. X            Added "CTRL-V [0-9]*" to enter any byte value. Fixed doput().
  1227. X            Dodis() displays register 0. Added CTRL-B to insert mode. Attempt 
  1228. X            to fix the lockup bug by adding Delay() to startscript(). -v 
  1229. X            option now implies -n option. doformat() added to improve 'V' 
  1230. X            command. Replace bool_t with int. Fixed handling of \& and ~ in
  1231. X            regsub(). Added interrupt handling in msdos.c for ctrl-break and
  1232. X            critical errors. Added scrolljump option. Added :stop. Added -d
  1233. X            argument. Fixed bug in quickfix startup from cli. Fixed enforcer
  1234. X            hit with aux:. Added CTRL-C handling to unix.c. Fixed "O<BS><CR>" 
  1235. X            bug with autoindent. Worked around :cq not working by adding a 
  1236. X            printf()!? Added default mapping for MSDOS PageUp etc. Fixed 
  1237. X            cursor position after 'Y'. Added shift-cursor commands. Changed 
  1238. X            ExpandFile() to keep names with errors. Added CLEAR and CURSUPD 
  1239. X            arguments to updateScreen(). Fixed CTRL-@ after a change command.
  1240. X            modname() changes '.' into '_'. Added emptyrows to screen.c. 
  1241. X            Fixed redo of search with offset. Added count to 'z' command. 
  1242. X            Made :so! work with :global. Added writing of cursor postition to 
  1243. X            startscript(). Minimized terminal requirements. Fixed problem 
  1244. X            with line in tags file with mixed spaces and tabs. Fixed problem 
  1245. X            with pattern "\\" in :s and :g. This version posted on Usenet.
  1246. X
  1247. X VIM 1.25    Improved error messages for :set. Open helpfile in binary mode 
  1248. X            for MSDOS. Fixed ignorecase for Unix in cstrncmp(). Fixed read 
  1249. X            from NULL with :tags after vim -t. Repaired 'z' command. Changed 
  1250. X            outnum() for >32767. In msdos.c flushbuf did write(1, .. instead 
  1251. X            of write(0, .. Added secure to fix security. Fixed pointer 
  1252. X            use after free() bug in regsub() (made :s fail under MSDOS). 
  1253. X            Added nofreeNULL(), needed for some UNIXes. Improved window 
  1254. X            resizing for Unix. Fixed messages for report == 0. Added 
  1255. X            bsdmemset(). Changed a few small things for portability. Added 
  1256. X            :list. Made '0' and '^' exclusive. Fixed regexp for /pattern* 
  1257. X            (did /(pattern)* instead of /pattern(n)*). Added "']" and "'[". 
  1258. X            Changed Delay(2L) into Delay(10L). Made 'timeout' option 
  1259. X            vi-compatible, added 'ttimeout' option. Changed TIOCSETP to 
  1260. X            TIOCSETN in unix.c. Added "ti" and "te" termcap entries, makes 
  1261. X            sun cmdtool work. Added stop- and starttermcap(). Use cooked 
  1262. X            output for listings on Amiga only. Added "starting" flag, no ~s 
  1263. X            anymore with every startup. Modname made portable; Added 
  1264. X            'shortname' option, Fixed problems with .vim file on messydos. 
  1265. X            Global .exrc/.vimrc for Unix added. Added patches for SCO Xenix. 
  1266. X            Add :w argument to list of alternate file names. Applied a few 
  1267. X            changes for HPUX. Added Flock in writeit() for safety. Command 
  1268. X            ":'a,'bm." moved to 'b instead of current line. Argument in 
  1269. X            'shell' option allowed. Re-implemented :copy and :move. Fixed 
  1270. X            BS-CR-BS on empty line bug in edit.c. -t option was ignored if 
  1271. X            there is a file ".vim". Changed amiga.c to work without 
  1272. X            arp.library for dos 2.0. Fixed "\$" and "\^" in regexp. Fixed 
  1273. X            pipe in filter command. Fixed CTRL-U and CTRL-D. With '}' indent 
  1274. X            in front of the cursor is included in the operated text. Fixed 
  1275. X            tag with '[' in search pattern. Added CTRL-V to 'r'. Fixed "tc" 
  1276. X            entry in termlib.c. term_console now default off. Added :noremap 
  1277. X            and ^V in :map argument. Replaced CTRL by Ctrl because some 
  1278. X            unixes have this already. Fixed "Empty file" message disappearing 
  1279. X            when there is no .exrc file. Added CTRL-K for entering digraphs. 
  1280. X            Removed escape codes from vim.hlp, added handling of inversion to 
  1281. X            help().
  1282. X
  1283. X VIM 1.26    For Unix: Removed global .exrc; renamed global .vimrc to vimrc.
  1284. X             Moved names of *rc and help files to makefile. Added various 
  1285. X            little changes for different kinds of Unix. Changed CR-LF 
  1286. X            handling in dosource() for MSDOS. Added :mkvimrc. Fixed 
  1287. X            WildExpand in unix.c for empty file. Fixed incompatibility with 
  1288. X            msdos share program (removed setperm(fname, 0) from fileio.c).
  1289. X            Added ":set compatible". Fixed 'history=0'.
  1290. X
  1291. X VIM 1.27    Added USE_LOCALE. Changed swapchar() to use toupper() and 
  1292. X            tolower(). Changed init order: .vimrc before EXINIT. Half-fixed 
  1293. X            lines that do not fit on screen. A few minor bug fixes. Fixed 
  1294. X            typehead bug in Read() in unix.c. Added :number. Reset IXON flag 
  1295. X            in unix.c for CTRL-Q. In tags file any Ex command can be used. Ex 
  1296. X            search command accepts same flags as normal search command. Fixed 
  1297. X            '?' in tag search pattern. 'New file' message was wrong when 'bk' 
  1298. X            and 'wb' options were both off.
  1299. X*/
  1300. X
  1301. Xchar           *Version = "VIM 1.27";
  1302. X#if !defined(linux) && defined(BSD) || defined(SYSV)
  1303. Xchar           *longVersion = "Vi IMitation 1.27 (1993 April 6) by Bram Moolenaar";
  1304. X#else
  1305. Xchar           *longVersion = "Vi IMitation 1.27 (" __DATE__ " " __TIME__ ") by Bram Moolenaar";
  1306. X#endif
  1307. END_OF_FILE
  1308. if test 14258 -ne `wc -c <'vim/src/version.c'`; then
  1309.     echo shar: \"'vim/src/version.c'\" unpacked with wrong size!
  1310. fi
  1311. # end of 'vim/src/version.c'
  1312. fi
  1313. echo shar: End of archive 7 \(of 23\).
  1314. cp /dev/null ark7isdone
  1315. MISSING=""
  1316. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ; do
  1317.     if test ! -f ark${I}isdone ; then
  1318.     MISSING="${MISSING} ${I}"
  1319.     fi
  1320. done
  1321. if test "${MISSING}" = "" ; then
  1322.     echo You have unpacked all 23 archives.
  1323.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1324. else
  1325.     echo You still need to unpack the following archives:
  1326.     echo "        " ${MISSING}
  1327. fi
  1328. ##  End of shell archive.
  1329. exit 0
  1330. -------------8<----------------8<----------------8<---------------8<--------
  1331. Bram Moolenaar                             | DISCLAIMER:  This  note  does  not
  1332. Oce Nederland B.V., Research & Development | necessarily represent the position
  1333. p.o. box 101, 5900 MA  Venlo               | of  Oce-Nederland  B.V.  Therefore
  1334. The Netherlands        phone +31 77 594077 | no liability or responsibility for
  1335. UUCP: mool@oce.nl        fax +31 77 595450 | whatever will be accepted.
  1336.  
  1337. exit 0 # Just in case...
  1338.