home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume41 / vim / part03 < prev    next >
Text File  |  1993-12-20  |  61KB  |  1,741 lines

  1. Newsgroups: comp.sources.misc
  2. From: mool@oce.nl (Bram Moolenaar)
  3. Subject: v41i053:  vim - Vi IMitation editor, v2.0, Part03/25
  4. Message-ID: <1993Dec21.034342.27031@sparky.sterling.com>
  5. X-Md4-Signature: 4a4205fc214a0707effa8c55425a46b3
  6. Keywords: utility, editor, vi, vim
  7. Sender: kent@sparky.sterling.com (Kent Landfield)
  8. Organization: Sterling Software
  9. Date: Tue, 21 Dec 1993 03:43:42 GMT
  10. Approved: kent@sparky.sterling.com
  11.  
  12. Submitted-by: mool@oce.nl (Bram Moolenaar)
  13. Posting-number: Volume 41, Issue 53
  14. Archive-name: vim/part03
  15. Environment: UNIX, AMIGA, MS-DOS
  16. Supersedes: vim: Volume 37, Issue 1-24
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 3 (of 25)."
  25. # Contents:  vim/doc/msdos.doc vim/src/arp_proto.h vim/src/cmdtab.h
  26. #   vim/src/cmdtab.tab vim/src/makefile.unix vim/src/param.h
  27. #   vim/src/regsub.c vim/todo
  28. # Wrapped by mool@oce-rd2 on Wed Dec 15 09:50:04 1993
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'vim/doc/msdos.doc' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'vim/doc/msdos.doc'\"
  32. else
  33. echo shar: Extracting \"'vim/doc/msdos.doc'\" \(6542 characters\)
  34. sed "s/^X//" >'vim/doc/msdos.doc' <<'END_OF_FILE'
  35. XThis file contains the particularities for the MSDOS version of Vim.
  36. X
  37. XThe default output method is to use bios calls. This will work right away on
  38. Xmost systems. You do not need ansi.sys.
  39. X
  40. XYou can set the color used in vim with two termcap options:
  41. X
  42. X    ":set t_tp=^V^[\|xxm"        for normal text
  43. X    ":set t_ti=^V^[\|xxm"        for error messages and visual mode
  44. X
  45. X^V is CTRL-V
  46. X^[ is ESC
  47. Xxx must be replaced by a decimal code: The foreground color number and
  48. X   background color number added together:
  49. X
  50. XCOLOR        FOREGROUND    BACKGROUND
  51. Xblack            0            0
  52. Xblue            1           16
  53. Xgreen            2           32
  54. Xcyan            3           48
  55. Xred            4           64
  56. Xmagenta            5           80
  57. Xbrown            6           96
  58. Xlighgray        7          112
  59. Xdarkgray        8
  60. Xlightblue        9
  61. Xlightgreen       10
  62. Xlighcyan       11
  63. Xlightred       12
  64. Xlighmagenta       13
  65. Xyellow           14
  66. Xwhite           15
  67. Xblink               128
  68. X
  69. XWhen you use 0, the color is reset to the one used when you started Vim. This
  70. Xis the default for t_tp. The default for t_ti is white on red, 15 + 64 = 79.
  71. X
  72. XThe termcap codes that are translated into bios calls are:
  73. X    ESC |J        clear screen
  74. X    ESC |K        clear to end of line
  75. X    ESC |L        insert line
  76. X    ESC |M        delete line
  77. X    ESC |row;colH    position cursor
  78. X    ESC |attrm    set character attribute
  79. X
  80. XIf you want to use another output method (e.g. when using a terminal on a COM
  81. Xport), set the terminal name to "pcansi". You can change the termcap options
  82. Xwhen needed (see chapter 20 of reference.doc). Note that the normal IBM
  83. Xansi.sys does not support all the codes of the builtin pcansi terminal. If
  84. Xyou use ansi.sys you will need to delete the termcap entries t_il and t_dl
  85. Xwith
  86. X    ":set t_il= t_dl=".
  87. XOtherwise the screen will not be updated correctly. It is better to use
  88. Xnansi.sys, nnansi.sys or the like instead of ansi.sys.
  89. X
  90. XIf you want to use Vim on a terminal connected to a COM: port, reset the
  91. X'bioskey' option. Otherwise the commands will be read from the PC keyboard.
  92. XCTRL-C and CTRL-P may not work correctly with 'bioskey' reset.
  93. X
  94. XIf the "tx" (textmode) option is set (which is the default), Vim will accept a 
  95. Xsingle <LF> or a <CR><LF> pair for end-of-line. When writing a file Vim will 
  96. Xuse <CR><LF>. Thus if you edit a file and write it, <LF> is replaced with 
  97. X<CR><LF>. If the "tx" option is not set the single <LF> will be used for
  98. Xend-of-line. A <CR> will be shown as ^M. You can use Vim to replace <LF> by
  99. X<CR><LF> by reading in any mode and writing in text mode. You can use Vim to
  100. Xreplace <CR><LF> by <LF> by reading in text mode and writing in non-text
  101. Xmode. 'textmode' is set automatically when 'textauto' is on (which is the
  102. Xdefault), so you don't really have to worry about what you are doing.
  103. X
  104. XIf you want to edit a script file or a binary file you should reset the
  105. X'textmode' and 'textauto' options before loading the file. Script files
  106. Xcontain single <LF> characters which would be replaced by <CR><LF>. You can
  107. Xdo this by starting Vim with the "-b" (binary) option.
  108. X
  109. XThe default help filename is "$VIM\vim.hlp". If the environment variable $VIM 
  110. Xis not defined or the file is not found, the DOS search path is used to 
  111. Xsearch for the file "vim.hlp". If you do not want to put "vim.hlp" in your 
  112. Xsearch path, use the command ":set helpfile=pathname" to tell Vim where the 
  113. Xhelp file is.
  114. X
  115. XThe ":cd" command recognizes the drive specifier and changes the current
  116. Xdrive. Use ":cd c:" to make drive C the active drive. Use ":cd d:\dos" to go
  117. Xto the directory "dos" in the root of drive D.
  118. X
  119. XThe files "_vimrc" and "_exrc" are used instead of ".vimrc" and ".exrc".
  120. XThe files "$VIM\_vimrc" and "$VIM\_exrc" are used instead of "s:.vimrc" and 
  121. X"s:.exrc". To use the file "c:\_vimrc" use the command "set vim=c:".
  122. X
  123. XUse CTRL-break instead of CTRL-C to interrupt searches. The CTRL-C is not
  124. Xdetected until a key is read.
  125. X
  126. XUse CTRL-arrow-left and CTRL-arrow-right instead of SHIFT-arrow-left and 
  127. XSHIFT-arrow-right. The arrow-up and arrow-down cannot be used with SHIFT or 
  128. XCTRL.
  129. X
  130. XTemporary files (for filtering) are put in the current directory.
  131. X
  132. XThe default for the sh (shell) option is "command". External commands are 
  133. Xstarted with "command /c <command_name>". Typing CTRL-Z starts a new command 
  134. Xshell. Return to Vim with "exit".
  135. X
  136. XIf you want to use different colors set the termcap code t_tp (for normal
  137. Xtext) and/or t_ti (for inverted text).
  138. X
  139. XStandard ANSI escape sequences are used. The codes are:
  140. X30 black foreground       40 black background        0 all attributes off
  141. X31 red foreground         41 red background         1 high intensity (bold)
  142. X32 green foreground       42 green background       2 normal intensity
  143. X33 yellow foreground      43 yellow background      4 underline
  144. X34 blue foreground        44 blue background        5 blinking
  145. X35 magenta foreground     45 magenta background     7 reverse video
  146. X36 cyan foreground        46 cyan background        8 invisible
  147. X37 white foreground       47 white background  
  148. X
  149. XThe codes can be combined by separating them with a semicolon. For example to
  150. Xget white text on a blue background:
  151. X    :set t_tp=^V<ESC>[0;37;44m
  152. X
  153. X
  154. XMS-DOS allows for only one filename extention. Therefore, in the original 
  155. Xfilename the '.' is replaced by a '_', the name is truncated to 8 characters 
  156. Xand the new extention ".vim" or ".bak" is appended. Two examples: "test.c" 
  157. Xbecomes "test_c.bak", "ditiseen.tst" becomes "ditiseen.bak". The 'shortname' 
  158. Xoption is not available.
  159. X
  160. XThe MS-DOS binary was compiled with Borland-C++ version 3.1, using
  161. Xmakefile.bcc. Other compilers should also work. Use makefile.dos for Turbo-C
  162. X2.0. Use makefile.bcc for other Borland compilers, also Turbo-C++ 3.0 (with
  163. Xsmall changes). If you get all kinds of strange error messages when compiling,
  164. Xyou have to add <CR> characters at the end of each line. This can be done with
  165. Xthe addcr program: "make addcr". This will compile addcr.c to addcr.exe and
  166. Xexecute the addcr.bat file. Sometimes this fails. Then execute the addcr.bat
  167. Xfile from the DOS prompt.
  168. X
  169. XAll text is kept in memory. This limits the size of the file you can edit,
  170. Xthe number of undo levels that can be remembered, etc.. If Vim gives an "Out 
  171. Xof memory" warning you should stop editing. Result of further editing actions 
  172. Xis unpredictable. Setting 'undolevels' to 0 saves some memory. Running the
  173. Xmaze macros on a big maze is guaranteed to run out of memory, because each
  174. Xchange is remembered for undo. In this case set 'undolevels' to a negative
  175. Xnumber. This will switch off undo completely. In a future release extended
  176. Xmemory and/or a swap file will be used to avoid these problems.
  177. X
  178. XThe *.info files are for the Amiga. You don't need them with MSDOS.
  179. END_OF_FILE
  180. if test 6542 -ne `wc -c <'vim/doc/msdos.doc'`; then
  181.     echo shar: \"'vim/doc/msdos.doc'\" unpacked with wrong size!
  182. fi
  183. chmod +x 'vim/doc/msdos.doc'
  184. # end of 'vim/doc/msdos.doc'
  185. fi
  186. if test -f 'vim/src/arp_proto.h' -a "${1}" != "-c" ; then 
  187.   echo shar: Will not clobber existing file \"'vim/src/arp_proto.h'\"
  188. else
  189. echo shar: Extracting \"'vim/src/arp_proto.h'\" \(6655 characters\)
  190. sed "s/^X//" >'vim/src/arp_proto.h' <<'END_OF_FILE'
  191. X#ifndef    PROTO_ARP_H
  192. X#define    PROTO_ARP_H    1
  193. X
  194. X/*
  195. X ************************************************************************
  196. X *    The arp copies of the dos.library calls...            *
  197. X ************************************************************************
  198. X */
  199. X
  200. X/* Only include these if you can use ARP.library without dos.library... */
  201. X#ifdef    DO_ARP_COPIES
  202. X#pragma    amicall(ArpBase, 0x1E, Open(d1, d2))
  203. X#pragma    amicall(ArpBase, 0x24, Close(d1))
  204. X#pragma    amicall(ArpBase, 0x2A, Read(d1, d2, d3))
  205. X#pragma    amicall(ArpBase, 0x30, Write(d1, d2, d3))
  206. X#pragma    amicall(ArpBase, 0x36, Input())
  207. X#pragma    amicall(ArpBase, 0x3C, Output())
  208. X#pragma    amicall(ArpBase, 0x42, Seek(d1, d2, d3))
  209. X#pragma    amicall(ArpBase, 0x48, DeleteFile(d1))
  210. X#pragma    amicall(ArpBase, 0x4E, Rename(d1, d2))
  211. X#pragma    amicall(ArpBase, 0x54, Lock(d1, d2))
  212. X#pragma    amicall(ArpBase, 0x5A, UnLock(d1))
  213. X#pragma    amicall(ArpBase, 0x60, DupLock(d1))
  214. X#pragma    amicall(ArpBase, 0x66, Examine(d1, d2))
  215. X#pragma    amicall(ArpBase, 0x6C, ExNext(d1, d2))
  216. X#pragma    amicall(ArpBase, 0x72, Info(d1, d2))
  217. X#pragma    amicall(ArpBase, 0x78, CreateDir(d1))
  218. X#pragma    amicall(ArpBase, 0x7E, CurrentDir(d1))
  219. X#pragma    amicall(ArpBase, 0x84, IoErr())
  220. X#pragma    amicall(ArpBase, 0x8A, CreateProc(d1, d2, d3, d4))
  221. X#pragma    amicall(ArpBase, 0x90, Exit(d1))
  222. X#pragma    amicall(ArpBase, 0x96, LoadSeg(d1))
  223. X#pragma    amicall(ArpBase, 0x9C, UnLoadSeg(d1))
  224. X#pragma    amicall(ArpBase, 0xAE, DeviceProc(d1))
  225. X#pragma    amicall(ArpBase, 0xB4, SetComment(d1, d2))
  226. X#pragma    amicall(ArpBase, 0xBA, SetProtection(d1, d2))
  227. X#pragma    amicall(ArpBase, 0xC0, DateStamp(d1))
  228. X#pragma    amicall(ArpBase, 0xC6, Delay(d1))
  229. X#pragma    amicall(ArpBase, 0xCC, WaitForChar(d1, d2))
  230. X#pragma    amicall(ArpBase, 0xD2, ParentDir(d1))
  231. X#pragma    amicall(ArpBase, 0xD8, IsInteractive(d1))
  232. X#pragma    amicall(ArpBase, 0xDE, Execute(d1, d2, d3))
  233. X#endif
  234. X
  235. X/*
  236. X ************************************************************************
  237. X *    Stuff only in arp.library                    *
  238. X ************************************************************************
  239. X */
  240. X/*    amicall(ArpBase, 0x0E4, Printf(a0, a1))    This does not work without glue */
  241. X/*    amicall(ArpBase, 0x0EA, FPrintf(d0, a0, a1))    This does not work without glue */
  242. X#pragma    amicall(ArpBase, 0x0F0, Puts(a1))
  243. X#pragma    amicall(ArpBase, 0x0F6, Readline(a0))
  244. X#pragma    amicall(ArpBase, 0x0FC, GADS(a0, d0, a1, a2, a3))
  245. X#pragma    amicall(ArpBase, 0x102, Atol(a0))
  246. X#pragma    amicall(ArpBase, 0x108, EscapeString(a0))
  247. X#pragma    amicall(ArpBase, 0x10E, CheckAbort(a1))
  248. X#pragma    amicall(ArpBase, 0x114, CheckBreak(d1, a1))
  249. X#pragma    amicall(ArpBase, 0x11A, Getenv(a0, a1, d0))
  250. X#pragma    amicall(ArpBase, 0x120, Setenv(a0, a1))
  251. X#pragma    amicall(ArpBase, 0x126, FileRequest(a0))
  252. X#pragma    amicall(ArpBase, 0x12C, CloseWindowSafely(a0, a1))
  253. X#pragma    amicall(ArpBase, 0x132, CreatePort(a0, d0))
  254. X#pragma    amicall(ArpBase, 0x138, DeletePort(a1))
  255. X#pragma    amicall(ArpBase, 0x13E, SendPacket(d0, a0, a1))
  256. X#pragma    amicall(ArpBase, 0x144, InitStdPacket(d0, a0, a1, a2))
  257. X#pragma    amicall(ArpBase, 0x14A, PathName(d0, a0, d1))
  258. X#pragma    amicall(ArpBase, 0x150, Assign(a0, a1))
  259. X#pragma    amicall(ArpBase, 0x156, DosAllocMem(d0))
  260. X#pragma    amicall(ArpBase, 0x15C, DosFreeMem(a1))
  261. X#pragma    amicall(ArpBase, 0x162, BtoCStr(a0, d0, d1))
  262. X#pragma    amicall(ArpBase, 0x168, CtoBStr(a0, d0, d1))
  263. X#pragma    amicall(ArpBase, 0x16E, GetDevInfo(a2))
  264. X#pragma    amicall(ArpBase, 0x174, FreeTaskResList())
  265. X#pragma    amicall(ArpBase, 0x17A, ArpExit(d0, d2))
  266. X#pragma    amicall(ArpBase, 0x180, ArpAlloc(d0))
  267. X/*    amicall(ArpBase, 0x186, ArpAllocMem(d0, d1))    Secondary result - IoErr() */
  268. X/*    amicall(ArpBase, 0x18C, ArpOpen(d1, d2))    Secondary result - IoErr() */
  269. X/*    amicall(ArpBase, 0x192, ArpDupLock(d1))        Secondary result - IoErr() */
  270. X/*    amicall(ArpBase, 0x198, ArpLock(d1, d2))    Secondary result - IoErr() */
  271. X/*    amicall(ArpBase, 0x19E, RListAlloc(a0, d0))    Secondary result - IoErr() */
  272. X#pragma    amicall(ArpBase, 0x1A4, FindCLI(d0))
  273. X#pragma    amicall(ArpBase, 0x1AA, QSort(a0, d0, d1, a1))
  274. X
  275. X#pragma    amicall(ArpBase, 0x1B0, PatternMatch(a0, a1))
  276. X#pragma    amicall(ArpBase, 0x1B6, FindFirst(d0, a0))
  277. X#pragma    amicall(ArpBase, 0x1BC, FindNext(a0))
  278. X#pragma    amicall(ArpBase, 0x1C2, FreeAnchorChain(a0))
  279. X
  280. X#pragma    amicall(ArpBase, 0x1C8, CompareLock(d0, d1))
  281. X
  282. X#pragma    amicall(ArpBase, 0x1CE, FindTaskResList())
  283. X#pragma    amicall(ArpBase, 0x1D4, CreateTaskResList())
  284. X#pragma    amicall(ArpBase, 0x1DA, FreeResList(a1))
  285. X#pragma    amicall(ArpBase, 0x1E0, FreeTrackedItem(a1))
  286. X/*    amicall(ArpBase, 0x1E6, GetTracker())    Stores the ID in the tracker */
  287. X
  288. X#pragma    amicall(ArpBase, 0x1EC, GetAccess(a1))
  289. X#pragma    amicall(ArpBase, 0x1F2, FreeAccess(a1))
  290. X
  291. X#pragma    amicall(ArpBase, 0x1F8, FreeDAList(a1))
  292. X#pragma    amicall(ArpBase, 0x1FE, AddDANode(a0, a1, d0, d1))
  293. X#pragma    amicall(ArpBase, 0x204, AddDADevs(a0, d0))
  294. X
  295. X#pragma    amicall(ArpBase, 0x20A, Strcmp(a0, a1))
  296. X#pragma    amicall(ArpBase, 0x210, Strncmp(a0, a1, d0))
  297. X#pragma    amicall(ArpBase, 0x216, Toupper(d0))
  298. X#pragma    amicall(ArpBase, 0x21C, SyncRun(a0, a1, d0, d1))
  299. X
  300. X/*
  301. X ************************************************************************
  302. X *    Added V32 of arp.library                    *
  303. X *    Note that SpawnShell is ASyncRun but was added at V39 of arp...    *
  304. X ************************************************************************
  305. X */
  306. X#pragma    amicall(ArpBase, 0x222, ASyncRun(a0, a1, a2))
  307. X#pragma    amicall(ArpBase, 0x222, SpawnShell(a0, a1, a2))
  308. X#pragma    amicall(ArpBase, 0x228, LoadPrg(d1))
  309. X#pragma    amicall(ArpBase, 0x22E, PreParse(a0, a1))
  310. X
  311. X/*
  312. X ************************************************************************
  313. X *    Added V33 of arp.library                    *
  314. X ************************************************************************
  315. X */
  316. X#pragma    amicall(ArpBase, 0x234, StamptoStr(a0))
  317. X#pragma    amicall(ArpBase, 0x23A, StrtoStamp(a0))
  318. X
  319. X#pragma    amicall(ArpBase, 0x240, ObtainResidentPrg(a0))
  320. X#pragma    amicall(ArpBase, 0x246, AddResidentPrg(d1, a0))
  321. X#pragma    amicall(ArpBase, 0x24C, RemResidentPrg(a0))
  322. X#pragma    amicall(ArpBase, 0x252, UnLoadPrg(d1))
  323. X#pragma    amicall(ArpBase, 0x258, LMult(d0, d1))
  324. X#pragma    amicall(ArpBase, 0x25E, LDiv(d0, d1))
  325. X#pragma    amicall(ArpBase, 0x264, LMod(d0, d1))
  326. X
  327. X#pragma    amicall(ArpBase, 0x26A, CheckSumPrg(d1))
  328. X#pragma    amicall(ArpBase, 0x270, TackOn(a0, a1))
  329. X#pragma    amicall(ArpBase, 0x276, BaseName(a0))
  330. X#pragma    amicall(ArpBase, 0x27C, ReleaseResidentPrg(d1))
  331. X
  332. X/*
  333. X ************************************************************************
  334. X *    Added V36 of arp.library                    *
  335. X ************************************************************************
  336. X */
  337. X/*    amicall(ArpBase, 0x282, SPrintf(d0, a0, a1))    This does not work without glue */
  338. X#pragma    amicall(ArpBase, 0x288, GetKeywordIndex(a0, a1))
  339. X/*    amicall(ArpBase, 0x28E, ArpOpenLibrary(a1, d0))    Secondary result - IoErr() */
  340. X#pragma    amicall(ArpBase, 0x294, ArpAllocFreq())
  341. X
  342. X#endif
  343. END_OF_FILE
  344. if test 6655 -ne `wc -c <'vim/src/arp_proto.h'`; then
  345.     echo shar: \"'vim/src/arp_proto.h'\" unpacked with wrong size!
  346. fi
  347. chmod +x 'vim/src/arp_proto.h'
  348. # end of 'vim/src/arp_proto.h'
  349. fi
  350. if test -f 'vim/src/cmdtab.h' -a "${1}" != "-c" ; then 
  351.   echo shar: Will not clobber existing file \"'vim/src/cmdtab.h'\"
  352. else
  353. echo shar: Extracting \"'vim/src/cmdtab.h'\" \(7223 characters\)
  354. sed "s/^X//" >'vim/src/cmdtab.h' <<'END_OF_FILE'
  355. X/* vi:ts=4
  356. X *
  357. X * VIM - Vi IMproved
  358. X *
  359. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  360. X *                            Tim Thompson            twitch!tjt
  361. X *                            Tony Andrews            onecom!wldrdg!tony 
  362. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  363. X */
  364. X
  365. X/*
  366. X * THIS FILE IS AUTOMATICALLY PRODUCED - DO NOT EDIT
  367. X */
  368. X
  369. X#define RANGE    0x01            /* allow a linespecs */
  370. X#define BANG    0x02            /* allow a ! after the command name */
  371. X#define EXTRA    0x04            /* allow extra args after command name */
  372. X#define XFILE    0x08            /* expand wildcards in extra part */
  373. X#define NOSPC    0x10            /* no spaces allowed in the extra part */
  374. X#define    DFLALL    0x20            /* default file range is 1,$ */
  375. X#define NODFL    0x40            /* do not default to the current file name */
  376. X#define NEEDARG    0x80            /* argument required */
  377. X#define TRLBAR    0x100            /* check for trailing vertical bar */
  378. X#define REGSTR    0x200            /* allow "x for register designation */
  379. X#define COUNT    0x400            /* allow count in argument */
  380. X#define NOTRLCOM 0x800            /* no trailing comment allowed */
  381. X#define ZEROR    0x1000            /* zero line number allowed */
  382. X#define USECTRLV 0x2000            /* do not remove CTRL-V from argument */
  383. X#define FILES    (XFILE + EXTRA)    /* multiple extra files allowed */
  384. X#define WORD1    (EXTRA + NOSPC)    /* one extra word allowed */
  385. X#define FILE1    (FILES + NOSPC)    /* 1 file allowed, defaults to current file */
  386. X#define NAMEDF    (FILE1 + NODFL)    /* 1 file allowed, defaults to "" */
  387. X#define NAMEDFS    (FILES + NODFL)    /* multiple files allowed, default is "" */
  388. X
  389. X/*
  390. X * This array maps ex command names to command codes. The order in which
  391. X * command names are listed below is significant -- ambiguous abbreviations
  392. X * are always resolved to be the first possible match (e.g. "r" is taken
  393. X * to mean "read", not "rewind", because "read" comes before "rewind").
  394. X * Not supported commands are included to avoid ambiguities.
  395. X */
  396. Xstatic struct
  397. X{
  398. X    char    *cmd_name;    /* name of the command */
  399. X    short     cmd_argt;    /* command line arguments permitted/needed/used */
  400. X} cmdnames[] =
  401. X{
  402. X    {"append",        BANG+RANGE+TRLBAR},            /* not supported */
  403. X#define CMD_append 0
  404. X    {"abbreviate",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  405. X#define CMD_abbreviate 1
  406. X    {"args",        TRLBAR},
  407. X#define CMD_args 2
  408. X    {"change",        BANG+RANGE+COUNT+TRLBAR},    /* not supported */
  409. X#define CMD_change 3
  410. X    {"cabbrev",        EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  411. X#define CMD_cabbrev 4
  412. X    {"cc",            TRLBAR+WORD1+BANG},
  413. X#define CMD_cc 5
  414. X    {"cd",            NAMEDF+TRLBAR},
  415. X#define CMD_cd 6
  416. X    {"center",        TRLBAR+RANGE+EXTRA},
  417. X#define CMD_center 7
  418. X    {"cf",            TRLBAR+FILE1+BANG},
  419. X#define CMD_cf 8
  420. X    {"chdir",        NAMEDF+TRLBAR},
  421. X#define CMD_chdir 9
  422. X    {"cl",            TRLBAR},
  423. X#define CMD_cl 10
  424. X    {"cmap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  425. X#define CMD_cmap 11
  426. X    {"cn",            TRLBAR+BANG},
  427. X#define CMD_cn 12
  428. X    {"cnoremap",    BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  429. X#define CMD_cnoremap 13
  430. X    {"cnoreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  431. X#define CMD_cnoreabbrev 14
  432. X    {"copy",        RANGE+EXTRA+TRLBAR},
  433. X#define CMD_copy 15
  434. X    {"cp",            TRLBAR+BANG},
  435. X#define CMD_cp 16
  436. X    {"cq",            TRLBAR+BANG},
  437. X#define CMD_cq 17
  438. X    {"cunmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  439. X#define CMD_cunmap 18
  440. X    {"cunabbrev",    EXTRA+TRLBAR+USECTRLV},
  441. X#define CMD_cunabbrev 19
  442. X    {"delete",        RANGE+REGSTR+COUNT+TRLBAR},
  443. X#define CMD_delete 20
  444. X    {"display",        TRLBAR},
  445. X#define CMD_display 21
  446. X    {"digraphs",    EXTRA+TRLBAR},
  447. X#define CMD_digraphs 22
  448. X    {"edit",        BANG+FILE1+TRLBAR},
  449. X#define CMD_edit 23
  450. X    {"ex",            BANG+FILE1+TRLBAR},
  451. X#define CMD_ex 24
  452. X    {"file",        FILE1+TRLBAR},
  453. X#define CMD_file 25
  454. X    {"files",        TRLBAR},
  455. X#define CMD_files 26
  456. X    {"global",        RANGE+BANG+EXTRA+DFLALL},
  457. X#define CMD_global 27
  458. X    {"help",        TRLBAR},
  459. X#define CMD_help 28
  460. X    {"insert",        BANG+RANGE+TRLBAR},            /* not supported */
  461. X#define CMD_insert 29
  462. X    {"iabbrev",        EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  463. X#define CMD_iabbrev 30
  464. X    {"imap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  465. X#define CMD_imap 31
  466. X    {"inoremap",    BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  467. X#define CMD_inoremap 32
  468. X    {"inoreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  469. X#define CMD_inoreabbrev 33
  470. X    {"iunmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  471. X#define CMD_iunmap 34
  472. X    {"iunabbrev",    EXTRA+TRLBAR+USECTRLV},
  473. X#define CMD_iunabbrev 35
  474. X    {"join",        RANGE+COUNT+TRLBAR},
  475. X#define CMD_join 36
  476. X    {"jumps",        TRLBAR},
  477. X#define CMD_jumps 37
  478. X    {"k",            RANGE+WORD1+TRLBAR},
  479. X#define CMD_k 38
  480. X    {"list",        RANGE+COUNT+TRLBAR},
  481. X#define CMD_list 39
  482. X    {"left",        TRLBAR+RANGE+EXTRA},
  483. X#define CMD_left 40
  484. X    {"move",        RANGE+EXTRA+TRLBAR},
  485. X#define CMD_move 41
  486. X    {"mark",        RANGE+WORD1+TRLBAR},
  487. X#define CMD_mark 42
  488. X    {"marks",        TRLBAR},
  489. X#define CMD_marks 43
  490. X    {"map",            BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  491. X#define CMD_map 44
  492. X    {"make",        NEEDARG+EXTRA+TRLBAR+XFILE},
  493. X#define CMD_make 45
  494. X    {"mkexrc",        BANG+FILE1+TRLBAR},
  495. X#define CMD_mkexrc 46
  496. X    {"mkvimrc",        BANG+FILE1+TRLBAR},
  497. X#define CMD_mkvimrc 47
  498. X    {"next",        RANGE+BANG+NAMEDFS+TRLBAR},
  499. X#define CMD_next 48
  500. X    {"number",        RANGE+COUNT+TRLBAR},
  501. X#define CMD_number 49
  502. X    {"noremap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  503. X#define CMD_noremap 50
  504. X    {"noreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  505. X#define CMD_noreabbrev 51
  506. X    {"Next",        RANGE+BANG+TRLBAR},
  507. X#define CMD_Next 52
  508. X    {"print",        RANGE+COUNT+TRLBAR},
  509. X#define CMD_print 53
  510. X    {"pop",            RANGE+TRLBAR+ZEROR},
  511. X#define CMD_pop 54
  512. X    {"put",            RANGE+BANG+REGSTR+TRLBAR},
  513. X#define CMD_put 55
  514. X    {"previous",    RANGE+BANG+TRLBAR},
  515. X#define CMD_previous 56
  516. X    {"pwd",            TRLBAR},
  517. X#define CMD_pwd 57
  518. X    {"quit",        BANG+TRLBAR},
  519. X#define CMD_quit 58
  520. X    {"read",        RANGE+NAMEDF+NEEDARG+TRLBAR+ZEROR},
  521. X#define CMD_read 59
  522. X    {"rewind",        BANG+TRLBAR},
  523. X#define CMD_rewind 60
  524. X    {"recover",        FILE1+TRLBAR},                /* not supported */
  525. X#define CMD_recover 61
  526. X    {"redo",        TRLBAR},
  527. X#define CMD_redo 62
  528. X    {"right",        TRLBAR+RANGE+EXTRA},
  529. X#define CMD_right 63
  530. X    {"substitute",    RANGE+EXTRA},
  531. X#define CMD_substitute 64
  532. X    {"suspend",        TRLBAR+BANG},
  533. X#define CMD_suspend 65
  534. X    {"set",            EXTRA+TRLBAR},
  535. X#define CMD_set 66
  536. X    {"setkeymap",    NAMEDF+TRLBAR},
  537. X#define CMD_setkeymap 67
  538. X    {"shell",        TRLBAR},
  539. X#define CMD_shell 68
  540. X    {"source",        NAMEDF+NEEDARG+TRLBAR},
  541. X#define CMD_source 69
  542. X    {"stop",        TRLBAR+BANG},
  543. X#define CMD_stop 70
  544. X    {"t",            RANGE+EXTRA+TRLBAR},
  545. X#define CMD_t 71
  546. X    {"tag",            RANGE+BANG+WORD1+TRLBAR+ZEROR},
  547. X#define CMD_tag 72
  548. X    {"tags",        TRLBAR},
  549. X#define CMD_tags 73
  550. X    {"undo",        TRLBAR},
  551. X#define CMD_undo 74
  552. X    {"unabbreviate", EXTRA+TRLBAR+USECTRLV},
  553. X#define CMD_unabbreviate 75
  554. X    {"unmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  555. X#define CMD_unmap 76
  556. X    {"vglobal",        RANGE+EXTRA+DFLALL},
  557. X#define CMD_vglobal 77
  558. X    {"version",        TRLBAR},
  559. X#define CMD_version 78
  560. X    {"visual",        RANGE+BANG+FILE1+TRLBAR},
  561. X#define CMD_visual 79
  562. X    {"write",        RANGE+BANG+FILE1+DFLALL+TRLBAR},
  563. X#define CMD_write 80
  564. X    {"wnext",        RANGE+BANG+FILE1+TRLBAR},
  565. X#define CMD_wnext 81
  566. X    {"winsize",        EXTRA+NEEDARG+TRLBAR},
  567. X#define CMD_winsize 82
  568. X    {"wq",            BANG+FILE1+DFLALL+TRLBAR},
  569. X#define CMD_wq 83
  570. X    {"xit",            BANG+FILE1+DFLALL+TRLBAR},
  571. X#define CMD_xit 84
  572. X    {"yank",        RANGE+REGSTR+COUNT+TRLBAR},
  573. X#define CMD_yank 85
  574. X    {"z",            RANGE+COUNT+TRLBAR},        /* not supported */
  575. X#define CMD_z 86
  576. X    {"@",            RANGE+EXTRA+TRLBAR},
  577. X#define CMD_at 87
  578. X    {"!",            RANGE+NAMEDFS},
  579. X#define CMD_bang 88
  580. X    {"<",            RANGE+COUNT+TRLBAR},
  581. X#define CMD_lshift 89
  582. X    {">",            RANGE+COUNT+TRLBAR},
  583. X#define CMD_rshift 90
  584. X    {"=",            RANGE+TRLBAR},
  585. X#define CMD_equal 91
  586. X    {"&",            RANGE+EXTRA},
  587. X#define CMD_and 92
  588. X    {"~",            RANGE+TRLBAR}                /* not supported */
  589. X#define CMD_tilde 93
  590. X#define CMD_SIZE 94
  591. X
  592. X};
  593. END_OF_FILE
  594. if test 7223 -ne `wc -c <'vim/src/cmdtab.h'`; then
  595.     echo shar: \"'vim/src/cmdtab.h'\" unpacked with wrong size!
  596. fi
  597. chmod +x 'vim/src/cmdtab.h'
  598. # end of 'vim/src/cmdtab.h'
  599. fi
  600. if test -f 'vim/src/cmdtab.tab' -a "${1}" != "-c" ; then 
  601.   echo shar: Will not clobber existing file \"'vim/src/cmdtab.tab'\"
  602. else
  603. echo shar: Extracting \"'vim/src/cmdtab.tab'\" \(5314 characters\)
  604. sed "s/^X//" >'vim/src/cmdtab.tab' <<'END_OF_FILE'
  605. X/* vi:ts=4
  606. X *
  607. X * VIM - Vi IMproved
  608. X *
  609. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  610. X *                            Tim Thompson            twitch!tjt
  611. X *                            Tony Andrews            onecom!wldrdg!tony 
  612. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  613. X */
  614. X
  615. X/*
  616. X * |This file is read by mkcmdtab to produce cmdtab.h.
  617. X *
  618. X * The bars are used to recognize file positions. Do not insert/delete them.|
  619. X */
  620. X
  621. X#define RANGE    0x01            /* allow a linespecs */
  622. X#define BANG    0x02            /* allow a ! after the command name */
  623. X#define EXTRA    0x04            /* allow extra args after command name */
  624. X#define XFILE    0x08            /* expand wildcards in extra part */
  625. X#define NOSPC    0x10            /* no spaces allowed in the extra part */
  626. X#define    DFLALL    0x20            /* default file range is 1,$ */
  627. X#define NODFL    0x40            /* do not default to the current file name */
  628. X#define NEEDARG    0x80            /* argument required */
  629. X#define TRLBAR    0x100            /* check for trailing vertical bar */
  630. X#define REGSTR    0x200            /* allow "x for register designation */
  631. X#define COUNT    0x400            /* allow count in argument */
  632. X#define NOTRLCOM 0x800            /* no trailing comment allowed */
  633. X#define ZEROR    0x1000            /* zero line number allowed */
  634. X#define USECTRLV 0x2000            /* do not remove CTRL-V from argument */
  635. X#define FILES    (XFILE + EXTRA)    /* multiple extra files allowed */
  636. X#define WORD1    (EXTRA + NOSPC)    /* one extra word allowed */
  637. X#define FILE1    (FILES + NOSPC)    /* 1 file allowed, defaults to current file */
  638. X#define NAMEDF    (FILE1 + NODFL)    /* 1 file allowed, defaults to "" */
  639. X#define NAMEDFS    (FILES + NODFL)    /* multiple files allowed, default is "" */
  640. X
  641. X/*
  642. X * This array maps ex command names to command codes. The order in which
  643. X * command names are listed below is significant -- ambiguous abbreviations
  644. X * are always resolved to be the first possible match (e.g. "r" is taken
  645. X * to mean "read", not "rewind", because "read" comes before "rewind").
  646. X * Not supported commands are included to avoid ambiguities.
  647. X */
  648. Xstatic struct
  649. X{
  650. X    char    *cmd_name;    /* name of the command */
  651. X    short     cmd_argt;    /* command line arguments permitted/needed/used */
  652. X} cmdnames[] =
  653. X{
  654. X|    {"append",        BANG+RANGE+TRLBAR},            /* not supported */
  655. X    {"abbreviate",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  656. X    {"args",        TRLBAR},
  657. X    {"change",        BANG+RANGE+COUNT+TRLBAR},    /* not supported */
  658. X    {"cabbrev",        EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  659. X    {"cc",            TRLBAR+WORD1+BANG},
  660. X    {"cd",            NAMEDF+TRLBAR},
  661. X    {"center",        TRLBAR+RANGE+EXTRA},
  662. X    {"cf",            TRLBAR+FILE1+BANG},
  663. X    {"chdir",        NAMEDF+TRLBAR},
  664. X    {"cl",            TRLBAR},
  665. X    {"cmap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  666. X    {"cn",            TRLBAR+BANG},
  667. X    {"cnoremap",    BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  668. X    {"cnoreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  669. X    {"copy",        RANGE+EXTRA+TRLBAR},
  670. X    {"cp",            TRLBAR+BANG},
  671. X    {"cq",            TRLBAR+BANG},
  672. X    {"cunmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  673. X    {"cunabbrev",    EXTRA+TRLBAR+USECTRLV},
  674. X    {"delete",        RANGE+REGSTR+COUNT+TRLBAR},
  675. X    {"display",        TRLBAR},
  676. X    {"digraphs",    EXTRA+TRLBAR},
  677. X    {"edit",        BANG+FILE1+TRLBAR},
  678. X    {"ex",            BANG+FILE1+TRLBAR},
  679. X    {"file",        FILE1+TRLBAR},
  680. X    {"files",        TRLBAR},
  681. X    {"global",        RANGE+BANG+EXTRA+DFLALL},
  682. X    {"help",        TRLBAR},
  683. X    {"insert",        BANG+RANGE+TRLBAR},            /* not supported */
  684. X    {"iabbrev",        EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  685. X    {"imap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  686. X    {"inoremap",    BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  687. X    {"inoreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  688. X    {"iunmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  689. X    {"iunabbrev",    EXTRA+TRLBAR+USECTRLV},
  690. X    {"join",        RANGE+COUNT+TRLBAR},
  691. X    {"jumps",        TRLBAR},
  692. X    {"k",            RANGE+WORD1+TRLBAR},
  693. X    {"list",        RANGE+COUNT+TRLBAR},
  694. X    {"left",        TRLBAR+RANGE+EXTRA},
  695. X    {"move",        RANGE+EXTRA+TRLBAR},
  696. X    {"mark",        RANGE+WORD1+TRLBAR},
  697. X    {"marks",        TRLBAR},
  698. X    {"map",            BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  699. X    {"make",        NEEDARG+EXTRA+TRLBAR+XFILE},
  700. X    {"mkexrc",        BANG+FILE1+TRLBAR},
  701. X    {"mkvimrc",        BANG+FILE1+TRLBAR},
  702. X    {"next",        RANGE+BANG+NAMEDFS+TRLBAR},
  703. X    {"number",        RANGE+COUNT+TRLBAR},
  704. X    {"noremap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  705. X    {"noreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  706. X    {"Next",        RANGE+BANG+TRLBAR},
  707. X    {"print",        RANGE+COUNT+TRLBAR},
  708. X    {"pop",            RANGE+TRLBAR+ZEROR},
  709. X    {"put",            RANGE+BANG+REGSTR+TRLBAR},
  710. X    {"previous",    RANGE+BANG+TRLBAR},
  711. X    {"pwd",            TRLBAR},
  712. X    {"quit",        BANG+TRLBAR},
  713. X    {"read",        RANGE+NAMEDF+NEEDARG+TRLBAR+ZEROR},
  714. X    {"rewind",        BANG+TRLBAR},
  715. X    {"recover",        FILE1+TRLBAR},                /* not supported */
  716. X    {"redo",        TRLBAR},
  717. X    {"right",        TRLBAR+RANGE+EXTRA},
  718. X    {"substitute",    RANGE+EXTRA},
  719. X    {"suspend",        TRLBAR+BANG},
  720. X    {"set",            EXTRA+TRLBAR},
  721. X    {"setkeymap",    NAMEDF+TRLBAR},
  722. X    {"shell",        TRLBAR},
  723. X    {"source",        NAMEDF+NEEDARG+TRLBAR},
  724. X    {"stop",        TRLBAR+BANG},
  725. X    {"t",            RANGE+EXTRA+TRLBAR},
  726. X    {"tag",            RANGE+BANG+WORD1+TRLBAR+ZEROR},
  727. X    {"tags",        TRLBAR},
  728. X    {"undo",        TRLBAR},
  729. X    {"unabbreviate", EXTRA+TRLBAR+USECTRLV},
  730. X    {"unmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  731. X    {"vglobal",        RANGE+EXTRA+DFLALL},
  732. X    {"version",        TRLBAR},
  733. X    {"visual",        RANGE+BANG+FILE1+TRLBAR},
  734. X    {"write",        RANGE+BANG+FILE1+DFLALL+TRLBAR},
  735. X    {"wnext",        RANGE+BANG+FILE1+TRLBAR},
  736. X    {"winsize",        EXTRA+NEEDARG+TRLBAR},
  737. X    {"wq",            BANG+FILE1+DFLALL+TRLBAR},
  738. X    {"xit",            BANG+FILE1+DFLALL+TRLBAR},
  739. X    {"yank",        RANGE+REGSTR+COUNT+TRLBAR},
  740. X    {"z",            RANGE+COUNT+TRLBAR},        /* not supported */
  741. X    {"@",            RANGE+EXTRA+TRLBAR},
  742. X    {"!",            RANGE+NAMEDFS},
  743. X    {"<",            RANGE+COUNT+TRLBAR},
  744. X    {">",            RANGE+COUNT+TRLBAR},
  745. X    {"=",            RANGE+TRLBAR},
  746. X    {"&",            RANGE+EXTRA},
  747. X    {"~",            RANGE+TRLBAR}                /* not supported */
  748. X|
  749. X};
  750. X|
  751. END_OF_FILE
  752. if test 5314 -ne `wc -c <'vim/src/cmdtab.tab'`; then
  753.     echo shar: \"'vim/src/cmdtab.tab'\" unpacked with wrong size!
  754. fi
  755. chmod +x 'vim/src/cmdtab.tab'
  756. # end of 'vim/src/cmdtab.tab'
  757. fi
  758. if test -f 'vim/src/makefile.unix' -a "${1}" != "-c" ; then 
  759.   echo shar: Will not clobber existing file \"'vim/src/makefile.unix'\"
  760. else
  761. echo shar: Extracting \"'vim/src/makefile.unix'\" \(7083 characters\)
  762. sed "s/^X//" >'vim/src/makefile.unix' <<'END_OF_FILE'
  763. X#
  764. X# Makefile for Vim on Unix, using gcc or standard cc
  765. X#
  766. X
  767. X#>>>>> choose BSD_UNIX for Sun, Linux, IRIX, NeXT, POSIX and SYSV R4
  768. X#       or Apollo DOMAIN (with SYSTYPE = bsd4.3, change CC below)
  769. X#       or BSD_UNIX with TERMINFO for HPUX
  770. X#       or BSD_UNIX for Convex
  771. X#          or SYSV_UNIX for Dynix/PTX, SCO-UNIX, UNICOS and SYSV R3
  772. X#          or SOLARIS
  773. X#          or UNICOS
  774. X#       or AIX (rs6000) (disable termcap below)
  775. X#       or UTS2 for Amdahl UTS 2.1.x (disable termcap below)
  776. X#       or UTS4 for Amdahl UTS 4.x
  777. X#       or USL for Unix Systems Laboratories (SYSV 4.2)
  778. XMACHINE = -DBSD_UNIX
  779. X#MACHINE = -DBSD_UNIX -DDOMAIN
  780. X#MACHINE = -DBSD_UNIX -DTERMINFO
  781. X#MACHINE = -DBSD_UNIX -DCONVEX
  782. X#
  783. X#MACHINE = -DSYSV_UNIX
  784. X#MACHINE = -DSYSV_UNIX -DSOLARIS -DTERMINFO
  785. X#MACHINE = -DSYSV_UNIX -DUNICOS
  786. X#MACHINE = -DSYSV_UNIX -DAIX
  787. X#MACHINE = -DSYSV_UNIX -DUTS2
  788. X#MACHINE = -DSYSV_UNIX -DUTS4 -Xa
  789. X#MACHINE = -DSYSV_UNIX -DUSL
  790. X
  791. X#>>>>> choose one compiler
  792. X### standard C compiler, with optimizer, debugger or vanilla
  793. XCC=cc -O
  794. X#CC=cc -g
  795. X#CC=cc
  796. X
  797. X### GCC on sun, Dynix
  798. X#CC=gcc -O -Wall -traditional
  799. X
  800. X### GCC 2.2.2d on Linux (works for Sun OS also)
  801. X#CC=gcc -O6 -Wall
  802. X
  803. X### GCC on SCO 3.2 and GCC 2.4.5 on NeXT
  804. X#CC=gcc -O -Wall
  805. X
  806. X### GCC on another SCO Unix
  807. X#CC=gcc -O6 -g -fpcc-struct-return -fwritable-strings
  808. X
  809. X### CenterLine cc
  810. X#CC=clcc -O
  811. X### Apollo Domain cc
  812. X#CC=cc -O -A systype,bsd4.3
  813. X
  814. X#>>>>> choose options for install
  815. X### Name of target
  816. XTARGET = vim
  817. X
  818. X### Prefix for location of files
  819. XPREFIX = /usr/local
  820. X
  821. X### Location of binary
  822. XBINLOC = $(PREFIX)/bin
  823. X
  824. X### Location of man page
  825. XMANLOC = $(PREFIX)/man/man1
  826. X
  827. X### Location of help file
  828. XHELPLOC = $(PREFIX)/lib
  829. X
  830. X### Permissions for vim binary
  831. XBINMOD = 755
  832. X
  833. X### Permissions for man page
  834. XMANMOD = 644
  835. X
  836. X### Permissions for help file
  837. XHELPMOD = 644
  838. X
  839. XMANFILE = ../doc/vim.1
  840. X
  841. XHELPFILE = ../doc/vim.hlp
  842. X
  843. X#>>>>> choose options:
  844. X### -DDIGRAPHS        digraph support
  845. X### -DNO_FREE_NULL    do not call free() with a null pointer
  846. X### -DCOMPATIBLE    start in vi-compatible mode
  847. X### -DNOBACKUP        default is no backup file
  848. X### -DDEBUG        output a lot of debugging garbage
  849. X### -DSTRNCASECMP    use strncasecmp() instead of internal function
  850. X### -DUSE_LOCALE    use setlocale() to change ctype() and others
  851. X### -DTERMCAP        full termcap file support
  852. X### -DTERMINFO        use terminfo entries for builtin termcaps
  853. X### -DNO_BUILTIN_TCAPS    do not include builtin termcap entries
  854. X###                (use only with -DTERMCAP)
  855. X### -DSOME_BUILTIN_TCAPS include most useful builtin termcap entries
  856. X###                (use only without -DNO_BUILTIN_TCAPS)
  857. X### -DALL_BUILTIN_TCAPS    include all builtin termcap entries
  858. X###                (use only without -DNO_BUILTIN_TCAPS)
  859. X### -DMAXNAMLEN 31    maximum length of a file name (if not defined in sys/dir.h)
  860. X### -Dconst=        for compilers that don't have type const
  861. X### -DVIMRC_FILE    name of the .vimrc file in current dir
  862. X### -DEXRC_FILE        name of the .exrc file in current dir
  863. X### -DSYSVIMRC_FILE    name of the global .vimrc file
  864. X### -DSYSEXRC_FILE    name of the global .exrc file
  865. X### -DDEFVIMRC_FILE    name of the system-wide .vimrc file
  866. X### -DVIM_HLP        name of the help file
  867. X### -DUSE_SYSTEM    use system() instead of fork/exec for starting a shell
  868. X### -DVIM_ISSPACE    use when isspace() can't handle meta chars
  869. X### -DSCO        SCO UNIX
  870. X### -UM_XENIX        needed on SCO UNIX when using gcc
  871. XDEFS = -DDIGRAPHS -DTERMCAP -DSOME_BUILTIN_TCAPS -DNO_FREE_NULL \
  872. X    -DSYSVIMRC_FILE=\"\$$HOME/.vimrc\" -DSYSEXRC_FILE=\"\$$HOME/.exrc\" \
  873. X    -DDEFVIMRC_FILE=\"/etc/vimrc\" -DVIM_HLP=\"$(HELPLOC)/vim.hlp\"
  874. X
  875. X#>>>>> link with termlib or termcap only if TERMCAP is defined
  876. X### default
  877. XLIBS = -ltermlib
  878. X
  879. X### termcap is for linux, HPUX, NeXT and others
  880. X#LIBS = -ltermcap
  881. X
  882. X### for IRIX (Silicon Graphics Indigo, __sgi will be defined)
  883. X#LIBS = -ltermlib -lmalloc -lc_s
  884. X
  885. X### UTS 2.1.6a (Amdahl UTS, _UTS will be defined)
  886. X#LIBS = -ltermlib -lsocket
  887. X
  888. X### for SCO UNIX 3.2
  889. X#LIBS = -ltinfo
  890. X
  891. X### for some SCO UNIX with gcc
  892. X#LIBS = -ltermlib -lmalloc
  893. X
  894. X### without TERMCAP defined
  895. X#LIBS = 
  896. X
  897. X#>>>>> end of choices
  898. X###########################################################################
  899. X
  900. XCFLAGS = -c $(MACHINE) $(DEFS)
  901. X
  902. XINCL = vim.h globals.h param.h keymap.h macros.h ascii.h term.h unix.h debug.h
  903. X
  904. XOBJ =    alloc.o unix.o buffers.o charset.o cmdline.o csearch.o digraph.o \
  905. X    edit.o fileio.o help.o linefunc.o main.o mark.o message.o misccmds.o \
  906. X    normal.o ops.o param.o quickfix.o regexp.o regsub.o screen.o \
  907. X    script.o search.o storage.o tag.o term.o undo.o
  908. X
  909. X$(TARGET): $(OBJ) version.c
  910. X    $(CC) $(CFLAGS) version.c
  911. X    $(CC) -o $(TARGET) $(OBJ) version.o $(LIBS)
  912. X
  913. Xdebug: $(OBJ) version.c
  914. X    $(CC) $(CFLAGS) version.c
  915. X    $(CC) -o $(TARGET) -g $(OBJ) version.o $(LIBS)
  916. X
  917. Xctags:
  918. X    csh -c ctags *.c *.h
  919. X
  920. Xinstall: $(TARGET)
  921. X    chmod $(BINMOD) $(TARGET)
  922. X    cp $(TARGET) $(BINLOC)
  923. X    chmod $(MANMOD) $(MANFILE)
  924. X    cp $(MANFILE) $(MANLOC)
  925. X    chmod $(HELPMOD) $(HELPFILE)
  926. X    cp $(HELPFILE) $(HELPLOC)
  927. X
  928. Xclean:
  929. X    -rm -f $(OBJ) mkcmdtab.o version.o core $(TARGET) mkcmdtab
  930. X    -rm -f *.bak
  931. X
  932. X#use this in case the files have been transported via an MSDOS system
  933. X
  934. XFILES = *.c *.h makefile makefile.* cmdtab.tab proto/*.pro tags
  935. X
  936. Xdos2unix:
  937. X    -mv arp_prot.h arp_proto.h
  938. X    -mv ptx_stdl.h ptx_stdlib.h
  939. X    -mv sun_stdl.h sun_stdlib.h
  940. X    -mv makefile.dic makefile.dice
  941. X    -mv makefile.uni makefile.unix
  942. X    -mv makefile.man makefile.manx
  943. X    -mv makefile.6sa makefile.6sas
  944. X    -mv makefile.5sa makefile.5sas
  945. X    for i in $(FILES); do tr -d '\r\032' < $$i > ~tmp~; mv ~tmp~ $$i; echo $$i; done
  946. X
  947. X###########################################################################
  948. X
  949. Xalloc.o:    alloc.c  $(INCL)
  950. X    $(CC) $(CFLAGS) alloc.c
  951. X
  952. Xunix.o:    unix.c  $(INCL) unix.h
  953. X    $(CC) $(CFLAGS) unix.c
  954. X
  955. Xbuffers.o:    buffers.c  $(INCL)
  956. X    $(CC) $(CFLAGS) buffers.c
  957. X
  958. Xcharset.o:    charset.c  $(INCL)
  959. X    $(CC) $(CFLAGS) charset.c
  960. X
  961. Xcmdline.o:    cmdline.c  $(INCL) cmdtab.h
  962. X    $(CC) $(CFLAGS) cmdline.c
  963. X
  964. Xcsearch.o:    csearch.c  $(INCL)
  965. X    $(CC) $(CFLAGS) csearch.c
  966. X
  967. Xdigraph.o:    digraph.c  $(INCL)
  968. X    $(CC) $(CFLAGS) digraph.c
  969. X
  970. Xedit.o:    edit.c  $(INCL)
  971. X    $(CC) $(CFLAGS) edit.c
  972. X
  973. Xfileio.o:    fileio.c  $(INCL)
  974. X    $(CC) $(CFLAGS) fileio.c
  975. X
  976. Xhelp.o:    help.c  $(INCL)
  977. X    $(CC) $(CFLAGS) help.c
  978. X
  979. Xlinefunc.o:    linefunc.c  $(INCL)
  980. X    $(CC) $(CFLAGS) linefunc.c
  981. X
  982. Xmain.o:    main.c  $(INCL)
  983. X    $(CC) $(CFLAGS) main.c
  984. X
  985. Xmark.o:    mark.c  $(INCL)
  986. X    $(CC) $(CFLAGS) mark.c
  987. X
  988. Xmessage.o:    message.c  $(INCL)
  989. X    $(CC) $(CFLAGS) message.c
  990. X
  991. Xmisccmds.o:    misccmds.c  $(INCL)
  992. X    $(CC) $(CFLAGS) misccmds.c
  993. X
  994. Xnormal.o:    normal.c  $(INCL) ops.h
  995. X    $(CC) $(CFLAGS) normal.c
  996. X
  997. Xops.o:    ops.c  $(INCL) ops.h
  998. X    $(CC) $(CFLAGS) ops.c
  999. X
  1000. Xparam.o:    param.c  $(INCL)
  1001. X    $(CC) $(CFLAGS) param.c
  1002. X
  1003. Xquickfix.o:    quickfix.c  $(INCL)
  1004. X    $(CC) $(CFLAGS) quickfix.c
  1005. X
  1006. Xregexp.o:    regexp.c  $(INCL)
  1007. X    $(CC) $(CFLAGS) regexp.c
  1008. X
  1009. Xregsub.o:    regsub.c  $(INCL)
  1010. X    $(CC) $(CFLAGS) regsub.c
  1011. X
  1012. Xscreen.o:    screen.c  $(INCL)
  1013. X    $(CC) $(CFLAGS) screen.c
  1014. X
  1015. Xscript.o:    script.c  $(INCL)
  1016. X    $(CC) $(CFLAGS) script.c
  1017. X
  1018. Xsearch.o:    search.c  $(INCL)
  1019. X    $(CC) $(CFLAGS) search.c
  1020. X
  1021. Xstorage.o:    storage.c  $(INCL)
  1022. X    $(CC) $(CFLAGS) storage.c
  1023. X
  1024. Xtag.o:    tag.c  $(INCL)
  1025. X    $(CC) $(CFLAGS) tag.c
  1026. X
  1027. Xterm.o:    term.c  $(INCL)
  1028. X    $(CC) $(CFLAGS) term.c
  1029. X
  1030. Xundo.o:    undo.c  $(INCL)
  1031. X    $(CC) $(CFLAGS) undo.c
  1032. X
  1033. Xcmdtab.h: cmdtab.tab mkcmdtab
  1034. X    ./mkcmdtab cmdtab.tab cmdtab.h
  1035. X
  1036. Xmkcmdtab: mkcmdtab.o
  1037. X    $(CC) -o mkcmdtab mkcmdtab.o
  1038. END_OF_FILE
  1039. if test 7083 -ne `wc -c <'vim/src/makefile.unix'`; then
  1040.     echo shar: \"'vim/src/makefile.unix'\" unpacked with wrong size!
  1041. fi
  1042. chmod +x 'vim/src/makefile.unix'
  1043. # end of 'vim/src/makefile.unix'
  1044. fi
  1045. if test -f 'vim/src/param.h' -a "${1}" != "-c" ; then 
  1046.   echo shar: Will not clobber existing file \"'vim/src/param.h'\"
  1047. else
  1048. echo shar: Extracting \"'vim/src/param.h'\" \(6735 characters\)
  1049. sed "s/^X//" >'vim/src/param.h' <<'END_OF_FILE'
  1050. X/* vi:ts=4:sw=4
  1051. X *
  1052. X * VIM - Vi IMproved
  1053. X *
  1054. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  1055. X *                            Tim Thompson            twitch!tjt
  1056. X *                            Tony Andrews            onecom!wldrdg!tony 
  1057. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  1058. X */
  1059. X
  1060. X/*
  1061. X * param.h: definition of global variables for settable parameters
  1062. X *
  1063. X * EXTERN is only defined in main.c (and vim.h)
  1064. X */
  1065. X
  1066. X#ifndef EXTERN
  1067. X# define EXTERN extern
  1068. X# define INIT(x)
  1069. X#else
  1070. X# ifndef INIT
  1071. X#  define INIT(x) x
  1072. X# endif
  1073. X#endif
  1074. X
  1075. X/*
  1076. X * The following are actual variabables for the parameters
  1077. X */
  1078. X
  1079. XEXTERN int    p_ai    INIT(= FALSE);        /* auto-indent */
  1080. XEXTERN int    p_aw    INIT(= FALSE);        /* auto-write */
  1081. XEXTERN long    p_bs    INIT(= 0);            /* backspace over newlines in insert mode */
  1082. X#if defined(COMPATIBLE) || defined(NOBACKUP)
  1083. XEXTERN int    p_bk    INIT(= FALSE);        /* make backups when writing out files */
  1084. X#else
  1085. XEXTERN int    p_bk    INIT(= TRUE);        /* make backups when writing out files */
  1086. X#endif
  1087. XEXTERN int    p_bin    INIT(= FALSE);        /* editing binary file */
  1088. X#ifdef MSDOS
  1089. XEXTERN int    p_biosk    INIT(= TRUE);        /* Use bioskey() instead of kbhit() */
  1090. X#endif
  1091. X#ifdef UNIX
  1092. XEXTERN char *p_bdir    INIT(= BACKUPDIR);    /* directory for backups */
  1093. X#endif
  1094. XEXTERN int    p_cp    INIT(= FALSE);        /* vi-compatible */
  1095. X#ifdef DIGRAPHS
  1096. XEXTERN int    p_dg    INIT(= FALSE);        /* enable digraphs */
  1097. X#endif /* DIGRAPHS */
  1098. XEXTERN char *p_dir    INIT(= "");            /* directory for autoscript file */
  1099. XEXTERN char *p_ep    INIT(= "indent");    /* program name for '=' command */
  1100. XEXTERN int    p_ed    INIT(= FALSE);        /* :s is ed compatible */
  1101. XEXTERN int    p_eb    INIT(= FALSE);        /* ring bell for errors */
  1102. X#ifdef AMIGA
  1103. XEXTERN char *p_ef    INIT(= "AztecC.Err");    /* name of errorfile */
  1104. X#else
  1105. XEXTERN char *p_ef    INIT(= "errors");            /* name of errorfile */
  1106. X#endif
  1107. X#ifdef AMIGA
  1108. XEXTERN char *p_efm    INIT(= "%f>%l:%c:%t:%n:%m");/* error format */
  1109. X#else
  1110. XEXTERN char *p_efm    INIT(= "\"%f\",%*[^0123456789]%l: %m");    /* error format */
  1111. X#endif
  1112. X#ifdef COMPATIBLE
  1113. XEXTERN int    p_ek    INIT(= FALSE);        /* function keys with ESC in insert mode */
  1114. X#else
  1115. XEXTERN int    p_ek    INIT(= TRUE);        /* function keys with ESC in insert mode */
  1116. X#endif
  1117. XEXTERN int    p_et    INIT(= FALSE);        /* expand tabs into spaces */
  1118. XEXTERN int    p_exrc    INIT(= FALSE);        /* read .exrc in current dir */
  1119. XEXTERN char *p_fp    INIT(= "");            /* name of format program */
  1120. X#ifdef MSDOS
  1121. XEXTERN int    p_gr    INIT(= TRUE);        /* display graphic characters */
  1122. X#else
  1123. XEXTERN int    p_gr    INIT(= FALSE);        /* display graphic characters */
  1124. X#endif
  1125. XEXTERN long p_hi    INIT(= 20);            /* command line history size */
  1126. XEXTERN char *p_hf    INIT(= VIM_HLP);    /* name of help file */
  1127. XEXTERN int    p_ic    INIT(= FALSE);        /* ignore case in searches */
  1128. XEXTERN int    p_im    INIT(= FALSE);        /* start editing in input mode */
  1129. XEXTERN char *p_kp    INIT(= "ref");        /* keyword program */
  1130. XEXTERN int    p_js    INIT(= TRUE);        /* use two spaces after period with Join */
  1131. XEXTERN int    p_list    INIT(= FALSE);        /* show tabs and newlines graphically */
  1132. XEXTERN int    p_magic INIT(= TRUE);        /* use some characters for reg exp */
  1133. XEXTERN char *p_mp    INIT(= "make");        /* program for :make command */
  1134. XEXTERN int    p_ml    INIT(= TRUE);        /* mode lines on/off */
  1135. XEXTERN long p_mls    INIT(= 5);            /* number of mode lines */
  1136. XEXTERN int    p_nu    INIT(= FALSE);        /* number lines on the screen */
  1137. XEXTERN int    p_paste    INIT(= FALSE);        /* paste mode */
  1138. XEXTERN char *p_para    INIT(= "IPLPPPQPP LIpplpipbp");        /* paragraphs */
  1139. XEXTERN int    p_ro    INIT(= FALSE);        /* readonly */
  1140. XEXTERN int    p_remap    INIT(= TRUE);        /* remap */
  1141. XEXTERN long    p_report    INIT(= 2);        /* minimum number of lines for report */
  1142. XEXTERN int    p_ru    INIT(= FALSE);        /* show column/line number */
  1143. XEXTERN int    p_ri    INIT(= FALSE);        /* reverse direction of insert */
  1144. XEXTERN int    p_secure    INIT(= FALSE);    /* do .exrc and .vimrc in secure mode */
  1145. XEXTERN long    p_scroll    INIT(= 12);        /* scroll size */
  1146. XEXTERN long    p_sj    INIT(= 1);            /* scroll jump size */
  1147. XEXTERN char *p_sections    INIT(= "SHNHH HUnhsh");        /* sections */
  1148. X#ifdef MSDOS
  1149. XEXTERN char *p_sh     INIT(= "command");        /* name of shell to use */
  1150. X#else
  1151. XEXTERN char *p_sh     INIT(= "sh");        /* name of shell to use */
  1152. X#endif
  1153. XEXTERN long    p_ss    INIT(= 0);            /* sideways scrolling offset */
  1154. XEXTERN long    p_st    INIT(= 0);            /* type of shell */
  1155. XEXTERN int    p_sr    INIT(= FALSE);        /* shift round off (for < and >) */
  1156. XEXTERN long    p_sw    INIT(= 8);            /* shiftwidth (for < and >) */
  1157. X#if defined(COMPATIBLE) || defined(UNIX)
  1158. XEXTERN int    p_sc    INIT(= FALSE);        /* show command in status line */
  1159. X#else
  1160. XEXTERN int    p_sc    INIT(= TRUE);        /* show command in status line */
  1161. X#endif
  1162. X#ifndef MSDOS
  1163. XEXTERN int    p_sn    INIT(= FALSE);        /* short names in file system */
  1164. X#endif
  1165. XEXTERN int    p_sm    INIT(= FALSE);        /* showmatch */
  1166. X#if defined(COMPATIBLE)
  1167. XEXTERN int    p_smd    INIT(= FALSE);        /* show mode */
  1168. X#else
  1169. XEXTERN int    p_smd    INIT(= TRUE);        /* show mode */
  1170. X#endif
  1171. XEXTERN int    p_si    INIT(= FALSE);        /* smart-indent for c programs */
  1172. XEXTERN char *p_su    INIT(= ".bak.o.h.info.vim");    /* suffixes for wildcard expansion */
  1173. XEXTERN long p_ts    INIT(= 8);            /* tab size in the file */
  1174. XEXTERN long p_tl    INIT(= 0);            /* used tag length */
  1175. XEXTERN char *p_tags    INIT(= "tags");        /* tags search path */
  1176. X#if defined(COMPATIBLE)
  1177. XEXTERN int    p_ta    INIT(= FALSE);        /* auto textmode detection */
  1178. X#else
  1179. XEXTERN int    p_ta    INIT(= TRUE);        /* auto textmode detection */
  1180. X#endif
  1181. X#ifdef MSDOS
  1182. XEXTERN int    p_tx    INIT(= TRUE);        /* textmode for file I/O */
  1183. X#else
  1184. XEXTERN int    p_tx    INIT(= FALSE);        /* textmode for file I/O */
  1185. X#endif
  1186. XEXTERN long p_tw    INIT(= 0);            /* textwidth */
  1187. XEXTERN int    p_to    INIT(= FALSE);        /* tilde is an operator */
  1188. XEXTERN int    p_timeout    INIT(= TRUE);    /* mappings entered within one second */
  1189. XEXTERN long p_tm    INIT(= 1000);        /* timeoutlen (msec) */
  1190. XEXTERN int    p_ttimeout    INIT(= FALSE);    /* key codes entered within one second */
  1191. X#ifdef COMPATIBLE
  1192. XEXTERN long p_ul    INIT(= 0);            /* number of Undo Levels */
  1193. XEXTERN long p_uc    INIT(= 0);            /* update count for auto script file */
  1194. X#else
  1195. XEXTERN long p_ul    INIT(= 100);        /* number of Undo Levels */
  1196. XEXTERN long p_uc    INIT(= 100);        /* update count for auto script file */
  1197. X#endif
  1198. XEXTERN long p_ut    INIT(= 2000);        /* update time for auto script file */
  1199. XEXTERN int    p_vb    INIT(= FALSE);        /* visual bell only (no beep) */
  1200. XEXTERN int    p_wrap    INIT(= TRUE);        /* wrap long lines */
  1201. XEXTERN int    p_warn    INIT(= TRUE);        /* warn for changes at shell command */
  1202. XEXTERN int    p_ws    INIT(= TRUE);        /* wrap scan */
  1203. X#ifdef COMPATIBLE
  1204. XEXTERN long    p_wc    INIT(= Ctrl('E'));    /* character for wildcard exapansion */
  1205. X#else
  1206. XEXTERN long    p_wc    INIT(= TAB);        /* character for wildcard exapansion */
  1207. X#endif
  1208. XEXTERN long p_wm    INIT(= 0);            /* wrapmargin */
  1209. XEXTERN int    p_wa    INIT(= FALSE);        /* write any */
  1210. X#if defined(COMPATIBLE) || defined(NOBACKUP)
  1211. XEXTERN int    p_wb    INIT(= FALSE);        /* write backup files */
  1212. X#else
  1213. XEXTERN int    p_wb    INIT(= TRUE);        /* write backup files */
  1214. X#endif
  1215. XEXTERN int    p_ye    INIT(= FALSE);        /* Y yanks to end of line */
  1216. END_OF_FILE
  1217. if test 6735 -ne `wc -c <'vim/src/param.h'`; then
  1218.     echo shar: \"'vim/src/param.h'\" unpacked with wrong size!
  1219. fi
  1220. chmod +x 'vim/src/param.h'
  1221. # end of 'vim/src/param.h'
  1222. fi
  1223. if test -f 'vim/src/regsub.c' -a "${1}" != "-c" ; then 
  1224.   echo shar: Will not clobber existing file \"'vim/src/regsub.c'\"
  1225. else
  1226. echo shar: Extracting \"'vim/src/regsub.c'\" \(7440 characters\)
  1227. sed "s/^X//" >'vim/src/regsub.c' <<'END_OF_FILE'
  1228. X/* vi:ts=4:sw=4
  1229. X * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
  1230. X *
  1231. X * This is NOT the original regular expression code as written by
  1232. X * Henry Spencer. This code has been modified specifically for use
  1233. X * with the VIM editor, and should not be used apart from compiling
  1234. X * VIM. If you want a good regular expression library, get the
  1235. X * original code. The copyright notice that follows is from the
  1236. X * original.
  1237. X *
  1238. X * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
  1239. X *
  1240. X * regsub
  1241. X *
  1242. X *        Copyright (c) 1986 by University of Toronto.
  1243. X *        Written by Henry Spencer.  Not derived from licensed software.
  1244. X *
  1245. X *        Permission is granted to anyone to use this software for any
  1246. X *        purpose on any computer system, and to redistribute it freely,
  1247. X *        subject to the following restrictions:
  1248. X *
  1249. X *        1. The author is not responsible for the consequences of use of
  1250. X *                this software, no matter how awful, even if they arise
  1251. X *                from defects in it.
  1252. X *
  1253. X *        2. The origin of this software must not be misrepresented, either
  1254. X *                by explicit claim or by omission.
  1255. X *
  1256. X *        3. Altered versions must be plainly marked as such, and must not
  1257. X *                be misrepresented as being the original software.
  1258. X *
  1259. X * $Log:        regsub.c,v $
  1260. X * Revision 1.2  88/04/28  08:11:25  tony
  1261. X * First modification of the regexp library. Added an external variable
  1262. X * 'reg_ic' which can be set to indicate that case should be ignored.
  1263. X * Added a new parameter to regexec() to indicate that the given string
  1264. X * comes from the beginning of a line and is thus eligible to match
  1265. X * 'beginning-of-line'.
  1266. X *
  1267. X * Revisions by Olaf 'Rhialto' Seibert, rhialto@cs.kun.nl:
  1268. X * Changes for vi: (the semantics of several things were rather different)
  1269. X * - Added lexical analyzer, because in vi magicness of characters
  1270. X *   is rather difficult, and may change over time.
  1271. X * - Added support for \< \> \1-\9 and ~
  1272. X * - Left some magic stuff in, but only backslashed: \| \+
  1273. X * - * and \+ still work after \) even though they shouldn't.
  1274. X */
  1275. X
  1276. X#include "vim.h"
  1277. X#include "globals.h"
  1278. X#include "proto.h"
  1279. X
  1280. X#ifdef MSDOS
  1281. X# define __ARGS(a)    a
  1282. X#endif
  1283. X
  1284. X#define CASECONVERT
  1285. X
  1286. X#include <stdio.h>
  1287. X#include "regexp.h"
  1288. X#include "regmagic.h"
  1289. X
  1290. X#ifdef LATTICE
  1291. X# include <sys/types.h>        /* for size_t */
  1292. X#endif
  1293. X
  1294. X#ifndef CHARBITS
  1295. X#define UCHARAT(p)      ((int)*(unsigned char *)(p))
  1296. X#else
  1297. X#define UCHARAT(p)      ((int)*(p)&CHARBITS)
  1298. X#endif
  1299. X
  1300. Xextern char        *reg_prev_sub;
  1301. X
  1302. X#ifdef CASECONVERT
  1303. X    /*
  1304. X     * We should define ftpr as a pointer to a function returning a pointer to
  1305. X     * a function returning a pointer to a function ...
  1306. X     * This is impossible, so we declare a pointer to a function returning a
  1307. X     * pointer to a function returning void. This should work for all compilers.
  1308. X     */
  1309. Xtypedef void (*(*fptr) __ARGS((char *, int)))();
  1310. Xstatic fptr strnfcpy __ARGS((fptr, char *, char *, int));
  1311. X
  1312. Xstatic fptr do_copy __ARGS((char *, int));
  1313. Xstatic fptr do_upper __ARGS((char *, int));
  1314. Xstatic fptr do_Upper __ARGS((char *, int));
  1315. Xstatic fptr do_lower __ARGS((char *, int));
  1316. Xstatic fptr do_Lower __ARGS((char *, int));
  1317. X
  1318. X    static fptr
  1319. Xdo_copy(d, c)
  1320. X    char *d;
  1321. X    int c;
  1322. X{
  1323. X    *d = c;
  1324. X
  1325. X    return (fptr)do_copy;
  1326. X}
  1327. X
  1328. X    static fptr
  1329. Xdo_upper(d, c)
  1330. X    char *d;
  1331. X    int c;
  1332. X{
  1333. X    *d = TO_UPPER(c);
  1334. X
  1335. X    return (fptr)do_copy;
  1336. X}
  1337. X
  1338. X    static fptr
  1339. Xdo_Upper(d, c)
  1340. X    char *d;
  1341. X    int c;
  1342. X{
  1343. X    *d = TO_UPPER(c);
  1344. X
  1345. X    return (fptr)do_Upper;
  1346. X}
  1347. X
  1348. X    static fptr
  1349. Xdo_lower(d, c)
  1350. X    char *d;
  1351. X    int c;
  1352. X{
  1353. X    *d = TO_LOWER(c);
  1354. X
  1355. X    return (fptr)do_copy;
  1356. X}
  1357. X
  1358. X    static fptr
  1359. Xdo_Lower(d, c)
  1360. X    char *d;
  1361. X    int c;
  1362. X{
  1363. X    *d = TO_LOWER(c);
  1364. X
  1365. X    return (fptr)do_Lower;
  1366. X}
  1367. X
  1368. X    static fptr
  1369. Xstrnfcpy(f, d, s, n)
  1370. X    fptr f;
  1371. X    char *d;
  1372. X    char *s;
  1373. X    int n;
  1374. X{
  1375. X    while (n-- > 0) {
  1376. X        f = (fptr)(f(d, *s));        /* Turbo C complains without the typecast */
  1377. X        if (!*s++)
  1378. X            break;
  1379. X        d++;
  1380. X    }
  1381. X
  1382. X    return f;
  1383. X}
  1384. X#endif
  1385. X
  1386. X/*
  1387. X * regtilde: replace tildes in the pattern by the old pattern
  1388. X *
  1389. X * Short explanation of the tilde: it stands for the previous replacement
  1390. X * pattern. If that previous pattern also contains a ~ we should go back
  1391. X * a step further... but we insert the previous pattern into the current one
  1392. X * and remember that.
  1393. X * This still does not handle the case where "magic" changes. TODO?
  1394. X *
  1395. X * New solution: The tilde's are parsed once before the first call to regsub().
  1396. X * In the old solution (tilde handled in regsub()) is was possible to get an
  1397. X * endless loop.
  1398. X */
  1399. X    char *
  1400. Xregtilde(source, magic)
  1401. X    char    *source;
  1402. X    int        magic;
  1403. X{
  1404. X    char    *newsub = NULL;
  1405. X    char    *tmpsub;
  1406. X    char    *p;
  1407. X    int        len;
  1408. X    int        prevlen;
  1409. X
  1410. X    for (p = source; *p; ++p)
  1411. X    {
  1412. X        if ((*p == '~' && magic) || (*p == '\\' && *(p + 1) == '~' && !magic))
  1413. X        {
  1414. X            if (reg_prev_sub)
  1415. X            {
  1416. X                    /* length = len(current) - 1 + len(previous) + 1 */
  1417. X                prevlen = strlen(reg_prev_sub);
  1418. X                tmpsub = alloc((unsigned)(strlen(source) + prevlen));
  1419. X                if (tmpsub)
  1420. X                {
  1421. X                        /* copy prefix */
  1422. X                    len = (int)(p - source);    /* not including ~ */
  1423. X                    strncpy(tmpsub, source, (size_t)len);
  1424. X                        /* interpretate tilde */
  1425. X                    strcpy(tmpsub + len, reg_prev_sub);
  1426. X                        /* copy postfix */
  1427. X                    if (!magic)
  1428. X                        ++p;                    /* back off \ */
  1429. X                    strcat(tmpsub + len, p + 1);
  1430. X
  1431. X                    free(newsub);
  1432. X                    newsub = tmpsub;
  1433. X                    p = newsub + len + prevlen;
  1434. X                }
  1435. X            }
  1436. X            else if (magic)
  1437. X                strcpy(p, p + 1);                /* remove '~' */
  1438. X            else
  1439. X                strcpy(p, p + 2);                /* remove '\~' */
  1440. X        }
  1441. X        else if (*p == '\\' && p[1])            /* skip escaped characters */
  1442. X            ++p;
  1443. X    }
  1444. X
  1445. X    free(reg_prev_sub);
  1446. X    if (newsub)
  1447. X    {
  1448. X        source = newsub;
  1449. X        reg_prev_sub = newsub;
  1450. X    }
  1451. X    else
  1452. X        reg_prev_sub = strsave(source);
  1453. X    return source;
  1454. X}
  1455. X
  1456. X/*
  1457. X - regsub - perform substitutions after a regexp match
  1458. X *
  1459. X * Returns the size of the replacement, including terminating \0.
  1460. X */
  1461. X    int
  1462. Xregsub(prog, source, dest, copy, magic)
  1463. X    regexp           *prog;
  1464. X    char           *source;
  1465. X    char           *dest;
  1466. X    int             copy;
  1467. X    int             magic;
  1468. X{
  1469. X    register char  *src;
  1470. X    register char  *dst;
  1471. X    register char    c;
  1472. X    register int    no;
  1473. X    register int    len;
  1474. X#ifdef CASECONVERT
  1475. X    fptr            func = (fptr)do_copy;
  1476. X#endif
  1477. X
  1478. X    if (prog == NULL || source == NULL || dest == NULL)
  1479. X    {
  1480. X        emsg(e_null);
  1481. X        return 0;
  1482. X    }
  1483. X    if (UCHARAT(prog->program) != MAGIC)
  1484. X    {
  1485. X        emsg(e_re_corr);
  1486. X        return 0;
  1487. X    }
  1488. X    src = source;
  1489. X    dst = dest;
  1490. X
  1491. X    while ((c = *src++) != '\0')
  1492. X    {
  1493. X        no = -1;
  1494. X        if (c == '&' && magic)
  1495. X            no = 0;
  1496. X        else if (c == '\\')
  1497. X        {
  1498. X            if (*src == '&' && !magic)
  1499. X            {
  1500. X                ++src;
  1501. X                no = 0;
  1502. X            }
  1503. X            else if ('0' <= *src && *src <= '9')
  1504. X            {
  1505. X                no = *src++ - '0';
  1506. X            }
  1507. X#ifdef CASECONVERT
  1508. X            else if (strchr("uUlLeE", *src))
  1509. X            {
  1510. X                switch (*src++)
  1511. X                {
  1512. X                case 'u':    func = (fptr)do_upper;
  1513. X                            continue;
  1514. X                case 'U':    func = (fptr)do_Upper;
  1515. X                            continue;
  1516. X                case 'l':    func = (fptr)do_lower;
  1517. X                            continue;
  1518. X                case 'L':    func = (fptr)do_Lower;
  1519. X                            continue;
  1520. X                case 'e':
  1521. X                case 'E':    func = (fptr)do_copy;
  1522. X                            continue;
  1523. X                }
  1524. X            }
  1525. X#endif
  1526. X        }
  1527. X        if (no < 0)           /* Ordinary character. */
  1528. X        {
  1529. X            if (c == '\\')
  1530. X                c = *src++;
  1531. X            if (copy)
  1532. X            {
  1533. X#ifdef CASECONVERT
  1534. X                func = (fptr)(func(dst, c));
  1535. X                            /* Turbo C complains without the typecast */
  1536. X#else
  1537. X                *dst = c;
  1538. X#endif
  1539. X            }
  1540. X            dst++;
  1541. X        }
  1542. X        else if (prog->startp[no] != NULL && prog->endp[no] != NULL)
  1543. X        {
  1544. X            len = (int)(prog->endp[no] - prog->startp[no]);
  1545. X            if (copy)
  1546. X            {
  1547. X#ifdef CASECONVERT
  1548. X                func = strnfcpy(func, dst, prog->startp[no], len);
  1549. X#else
  1550. X                (void) strncpy(dst, prog->startp[no], len);
  1551. X#endif
  1552. X            }
  1553. X            dst += len;
  1554. X            if (copy && len != 0 && *(dst - 1) == '\0') { /* strncpy hit NUL. */
  1555. X                emsg(e_re_damg);
  1556. X                goto exit;
  1557. X            }
  1558. X        }
  1559. X    }
  1560. X    if (copy)
  1561. X        *dst = '\0';
  1562. X
  1563. Xexit:
  1564. X    return (int)((dst - dest) + 1);
  1565. X}
  1566. END_OF_FILE
  1567. if test 7440 -ne `wc -c <'vim/src/regsub.c'`; then
  1568.     echo shar: \"'vim/src/regsub.c'\" unpacked with wrong size!
  1569. fi
  1570. chmod +x 'vim/src/regsub.c'
  1571. # end of 'vim/src/regsub.c'
  1572. fi
  1573. if test -f 'vim/todo' -a "${1}" != "-c" ; then 
  1574.   echo shar: Will not clobber existing file \"'vim/todo'\"
  1575. else
  1576. echo shar: Extracting \"'vim/todo'\" \(6733 characters\)
  1577. sed "s/^X//" >'vim/todo' <<'END_OF_FILE'
  1578. XKnown problems:
  1579. X
  1580. XNone at the moment!
  1581. X
  1582. X
  1583. XProblems that will probably not be solved:
  1584. X
  1585. XSetting the size of the window with ":win" does not always work as expected.
  1586. XAmiga: When using quickfix with the Manx compiler we only get the first 25
  1587. X    errors. How do we get the rest?
  1588. XAmiga: The ":cq" command does not always abort the Manx compiler. Why?
  1589. X
  1590. X
  1591. XFurther extentions:
  1592. X
  1593. XIn visual select mode: Inclusion or exclusion of char under cursor depends
  1594. X    on movement command. "vwd" and "dw" do the same.
  1595. XFind out why macros of Stephen Riehm are working strange.
  1596. X:s///p prints the line after a substitution.
  1597. XWhen using the up/down cursor keys in insertmode keep the same column.
  1598. XMake CTRL-R (insert register contents) also work in command line mode.
  1599. XUpdatescript() can be done faster with a string instead of a char.
  1600. XWith :args, when there is only one line, don't call wait_return().
  1601. XAdd arguments to ":args", like ":next".
  1602. XWhen 'wrapscan' off give message "search hit BOTTOM without matching pattern".
  1603. XWhen 'wrapscan' on give message "search hit BOTTOM, continuing at TOP".
  1604. XAdd \! to search patterns: matches string that does not match previous atom.
  1605. XScreen updating is inefficient with CTRL-F and CTRL-B when there are long lines.
  1606. XAdd last inserted text to :display.
  1607. XMake z<nr><CR> more useful: put ruler and command on bottom line, reserve
  1608. X    more space for command line and messages (less need for hitreturn).
  1609. XUse 'backupdir' for all backup files? (Caughey)
  1610. XUse CTRL-E and CTRL-Y in insert mode for scroll up/down?
  1611. XWhen undone all changes reset the Changed flag.
  1612. XUppercase characters in ex commands can be made lowercase?
  1613. XAdd t_del, code for delete key (termcap 'kD') and maybe some other keys:
  1614. X    'kI' insert key, 'kL' delete line, etc.
  1615. XCTRL-V > should move the block, not whole lines.
  1616. XFiltering a block should only apply to the block, not to the whole lines. When
  1617. X    the number of lines is increased, add lines. When decreased, padd with
  1618. X    spaces or delete?
  1619. XIn out-of-memory situations: Free allocated space in undo (after asking).
  1620. XWith '#' and '*' commands: search whole words only (using \< and \>)?
  1621. X8-bit codes between 0x80 and 0xa0 cannot be typed directly (mostly msdos
  1622. X    problem). Need more codes for delete key and more function keys. Use
  1623. X    2-byte code?
  1624. XInsert octal numbers with CTRL-V o, hexadecimal with CTRL-V x and binary
  1625. X    with CTRL-V b.
  1626. XList mappings: Once with and without ^ and ~ (meta keys)
  1627. XIf ':' hit after "hit return to continue" no screen redraw required.
  1628. XAdd option that tells which characters to display directly, e.g.
  1629. X    ":set gr=32-126,140-244", others are displayed with ^ and ~ and +
  1630. XAdd option to show character value in octal, decimal, hex and screen code.
  1631. XHow does vi detect whether a filter has messed up the screen? Check source.
  1632. X    After ":w !command" a wait_return?
  1633. XWith 'p' command on last line: scroll screen up (also for terminals without
  1634. X    insert line command).
  1635. XAmiga: ExpandWildCards in amiga.c: don't expand if there are no wildcards.
  1636. Xunix: Speedup wildcard expansion of "*", "~" and "$": do it internally, more
  1637. X    complicated things can still be done with the shell.
  1638. XOnly do wildcard expansion with 'wildchar' when entering a command that has a
  1639. X    file name as argument (:r :w :! :e :f :n)?
  1640. XIn regexp.c: "\^" after "\|" or "\(" is start of line, and "\$" before "\|"
  1641. X    and "\)" is end of line.
  1642. XRemember the "last changed" time of the edited file and check it before
  1643. X    overwriting; another user may have changed it.
  1644. XSupport for command lines longer than 256 characters (for EXINIT).
  1645. XOption for filter when reading/writing a file for compression or crypting.
  1646. XOption to set time for emsg() sleep.
  1647. XMake adjustmark() faster (sorted list of pointers? Hash list?)
  1648. XAdd "next tag" command for tags that have multiple hits.
  1649. XSupport static tags: first search for tags with current filename: "foo.c:bar",
  1650. X    then for global tags (without a filename).
  1651. XHistory stack for . command?
  1652. XWith CTRL-^ command swap the two entries at the top of the file list. Put filename
  1653. X    in the list only if it is not already there???
  1654. XUse insert/delete char when terminal supports it.
  1655. XWith undo with simple line delete/insert: optimize screen updating.
  1656. XOptimize screen redraw for slow terminals.
  1657. X"edit" option: when off changing the buffer is not possible.
  1658. XAdd "-d null" for editing from a script file without displaying.
  1659. XMSDOS: search for _exrc in the directory where the binary is, instead
  1660. X    of using $VIM\_exrc.
  1661. XIn insert mode: Remember the characters that were removed with backspace and
  1662. X    re-insert them one at a time with <key1>, all together with <key2>.
  1663. XAmiga: Add possibility to set a keymap. The code in amiga.c does not work yet.
  1664. XImplement 'redraw' option.
  1665. XAdd possibility to put the value of an option into the text: "'lines'p
  1666. XAdd 'crown' option to 'Q' command: preserve indent of second line.
  1667. XUnix: WildExpand: Without csh file name with embedded space will be split in two.
  1668. XAdd special code to 'sections' option to define something else but '{' or '}'
  1669. X    as the start of a section (e.g. one shiftwidth to the right).
  1670. XNopaste option: Mappings with non-printable characters are OK.
  1671. XAdd 'indent' option: Always use this amount of indent when starting a new line
  1672. X    and when formatting text.
  1673. XAdd option 'comment', initally "/*,*,*/,#", giving the characters at start of
  1674. X    a line that should be left alone by the internal formatting.
  1675. XAdd 'scrolloff': scroll when cursor is less then 'scrolloff' lines from top/bottom.
  1676. XAdd option to switch off ignoring braces inside quotes for "%" command??
  1677. XUse pipes for filtering on unix.
  1678. XAllow for +command and -option on any position in argv[].
  1679. XWith CTRL-O commands in insert mode: Allow to go to after last char in line.
  1680. XAdd commands like ]] and [[ that do not include the line jumped to.
  1681. X
  1682. XFrom Elvis:
  1683. Xfontchanges recognized "\\fB" etc.
  1684. X:color command
  1685. X:if and friends, conditional statements
  1686. XChange cursor shape in command/insert mode.
  1687. X
  1688. X
  1689. XFar future extentions:
  1690. X
  1691. XMSdos: use extended or expanded memory.
  1692. XUse disk swap file when editing very large files.
  1693. XWhen executing macro's: Save each line for undo only once.
  1694. XSmart cut/paste: recognize words and adjust spaces before/after them.
  1695. XAdd 'notwsuffixes' option: suffixes for files where 'tw' should be 0.
  1696. XKeyword completion: first look in the file for a match, then in a dictionary.
  1697. XSupport mouse control.
  1698. XSupport multiple windows (like xvi or emacs)
  1699. XOption verbose; when on keep the screen uptodate, when off only redisplay when
  1700. X    input needed.
  1701. XRemember message line for redraw. Integrate the command line in updateScreen().
  1702. XMode to keep text formatted while inserting/deleting.
  1703. XMode to keep C-code formatted (sort of on-line indent). Use colors for
  1704. X    keywords, comments, etc.
  1705. XKorn-shell like command line editing (like editing a single line with vi). Use
  1706. X    :cmap! for mappings.
  1707. END_OF_FILE
  1708. if test 6733 -ne `wc -c <'vim/todo'`; then
  1709.     echo shar: \"'vim/todo'\" unpacked with wrong size!
  1710. fi
  1711. chmod +x 'vim/todo'
  1712. # end of 'vim/todo'
  1713. fi
  1714. echo shar: End of archive 3 \(of 25\).
  1715. cp /dev/null ark3isdone
  1716. MISSING=""
  1717. 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 24 25 ; do
  1718.     if test ! -f ark${I}isdone ; then
  1719.     MISSING="${MISSING} ${I}"
  1720.     fi
  1721. done
  1722. if test "${MISSING}" = "" ; then
  1723.     echo You have unpacked all 25 archives.
  1724.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1725. else
  1726.     echo You still need to unpack the following archives:
  1727.     echo "        " ${MISSING}
  1728. fi
  1729. ##  End of shell archive.
  1730. exit 0
  1731.  
  1732. ===============================================================================
  1733. Bram Moolenaar                             | DISCLAIMER:  This  note  does  not
  1734. Oce Nederland B.V., Research & Development | necessarily represent the position
  1735. p.o. box 101, 5900 MA  Venlo               | of  Oce-Nederland  B.V.  Therefore
  1736. The Netherlands        phone +31 77 594077 | no liability or responsibility for
  1737. UUCP: mool@oce.nl        fax +31 77 595473 | whatever will be accepted.
  1738.  
  1739. exit 0 # Just in case...
  1740.