home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / elvis184.zip / os2 / Elvisman.txt < prev    next >
Text File  |  1995-05-26  |  210KB  |  6,601 lines

  1.  
  2.  
  3.   ::      #######                                      ::
  4.   :::     #        #       #    #     #     ####      :::
  5.   ::::    #        #       #    #     #    #         ::::
  6.   :::::   #####    #       #    #     #     ####    :::::
  7.   ::::    #        #       #    #     #         #    ::::
  8.   :::     #        #        #  #      #    #    #     :::
  9.   ::      #######  ######    ##       #     ####       ::
  10.  
  11.                     - a clone of vi/ex -
  12.                        version 1.8pl3
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.    Hurry down doomsday, the bugs are taking over! - E.C.
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43. Author:  Steve Kirkendall
  44.          1500 SW Park #326
  45.          Portland OR, 97201
  46.  
  47. E-Mail:  kirkenda@cs.pdx.edu
  48.  
  49. Phone:   (503) 643-6980
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. TABLE OF CONTENTS
  70.  
  71. INTRODUCTION                                               1
  72.    What  Elvis  does,  Copyright, How to compile Elvis,
  73.    Overview
  74.  
  75. VISUAL MODE COMMANDS                                       2
  76.    Normal interactive editing, Input mode, Arrow  keys,
  77.    Digraphs, Abbreviations, Auto-indentation
  78.  
  79. COLON MODE COMMANDS                                        3
  80.    Line  specifiers,  Text  entry, Cut & paste, Display
  81.    text, Global operations, Line editing, Undo, Config-
  82.    uration  &  status, Multiple files, Switching files,
  83.    Working with a compiler, Exiting, File  I/O,  Direc-
  84.    tory & shell, Debugging
  85.  
  86. REGULAR EXPRESSIONS                                        4
  87.    Syntax, Options, Substitutions, Examples
  88.  
  89. OPTIONS                                                    5
  90.    Autoindent, Autoprint, etc.
  91.  
  92. INITIALIZATION                                             6
  93.    Start-up  initialization,  File  initialization, The
  94.    :mkexrc command, Other techniques
  95.  
  96. CUT BUFFERS                                                7
  97.    Putting text into a cut buffer, Pasting from  a  cut
  98.    buffer, Macros, The effect of switching files
  99.  
  100. DIFFERENCES BETWEEN Elvis AND THE REAL VI/EX               8
  101.  
  102. INTERNAL                                                   9
  103.    For  programmers only, The temporary file, Implemen-
  104.    tation of editing, Marks and the cursor, Colon  com-
  105.    mand interpretation, Screen control, Portability
  106.  
  107. MAKEFILE                                                  10
  108.  
  109. CFLAGS                                                    11
  110.  
  111. TERMCAP                                                   12
  112.  
  113. ENVIRONMENT VARIABLES                                     13
  114.  
  115. VERSIONS                                                  14
  116.  
  117. QUESTIONS & ANSWERS                                       15
  118.  
  119.  
  120.    UNIX-style "man" pages appear at the end of this manual.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135. 1.  INTRODUCTION
  136.  
  137.      Elvis  is  a  clone of vi/ex, the standard UNIX editor.
  138. Elvis supports nearly all of the  vi/ex  commands,  in  both
  139. visual mode and colon mode.
  140.  
  141.      Like  vi/ex,  Elvis stores most of the text in a tempo-
  142. rary file, instead of RAM.  This allows  it  to  edit  files
  143. that  are  too large to fit in a single process' data space.
  144. Also, the edit buffer can survive a power failure or  crash.
  145.  
  146.      Elvis  runs  under BSD UNIX, AT&T SysV UNIX, Minix, MS-
  147. DOS, Atari TOS,  Coherent,  OS9/68000,  VMS,  AmigaDos,  and
  148. OS/2.   The  next version is also expected to add MS-Windows
  149. and MacOS.  Contact me before you start porting it  to  some
  150. other OS, because somebody else may have already done it for
  151. you.
  152.  
  153.      Elvis is freely redistributable, in either source  form
  154. or  executable  form.   There are no restrictions on how you
  155. may use it.
  156.  
  157. 1.1.  Compiling
  158.  
  159.      See the "Versions" section of this manual for  instruc-
  160. tions on how to compile Elvis.
  161.  
  162.      If  you want to port Elvis to another O.S. or compiler,
  163. then you should start by reading the "Portability"  part  of
  164. the "Internal" section.
  165.  
  166. 1.2.  Overview of Elvis
  167.  
  168.      The  user interface of Elvis/vi/ex is weird.  There are
  169. two major command modes in Elvis, and a few text input modes
  170. as  well.   Each command mode has a command which allows you
  171. to switch to the other mode.
  172.  
  173.      You will probably use the visual command mode  most  of
  174. the  time.   This  is the mode that Elvis normally starts up
  175. in.
  176.  
  177.      In visual command mode, the  entire  screen  is  filled
  178. with lines of text from your file.  Each keystroke is inter-
  179. preted as part of a visual command.   If  you  start  typing
  180. text, it will not be inserted, it will be treated as part of
  181. a command.  To insert text, you must first give  an  "insert
  182. text"  command.   This  will take some getting used to.  (An
  183. alternative exists.  Lookup the "inputmode" option.)
  184.  
  185.      The colon mode is quite different.   Elvis  displays  a
  186. ":" character on the bottom line of the screen, as a prompt.
  187. You are then expected to type in a command line and hit  the
  188. <Return>  key.   The set of commands recognized in the colon
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198. 1-2                     INTRODUCTION                     1-2
  199.  
  200.  
  201. mode is different from visual mode's.
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267. 2.  VISUAL MODE COMMANDS
  268.  
  269.      Most  visual mode commands are one keystroke long.  The
  270. following  table  lists  the  operation  performed  by  each
  271. keystroke, and also denotes any options or arguments that it
  272. accepts.  Notes at the end of the table describe  the  nota-
  273. tion used in this table.
  274.  
  275.      In  addition  to  the keys listed here, your keyboard's
  276. "arrow" keys will be interpreted as the  appropriate  cursor
  277. movement  commands.  The same goes for <PgUp> and <PgDn>, if
  278. your keyboard  has  them.   The  <Insert>  key  will  toggle
  279. between insert mode and replace mode.  There is a colon mode
  280. command (":map", to be described later) which will allow you
  281. to define other keys, such as function keys.
  282.  
  283.      A  tip: visual command mode looks a lot like text input
  284. mode.  If you forget which mode  you're  in,  just  hit  the
  285. <Esc>  key.   If  Elvis beeps, then you're in visual command
  286. mode.  If Elvis does not beep, then you were in input  mode,
  287. but  by  hitting <Esc> you will have switched to visual com-
  288. mand mode.  So, one way or another, after <Esc>  Elvis  will
  289. be ready for a command.
  290.  
  291. COMMAND      DESCRIPTION
  292.        ^A    Search for next occurrence of word at cursor (MOVE)(EXT)
  293.        ^B    Move toward the top of the file by 1 screenful
  294.        ^C    --- (usually sends SIGINT, to interrupt a command)
  295. count  ^D    Scroll down <count> lines (default 1/2 screen)
  296. count  ^E    Scroll up <count> lines
  297.        ^F    Move toward the bottom of the file by 1 screenful
  298.        ^G    Show file status, and the current line #
  299. count  ^H    Move left, like h (MOVE)
  300.        ^I    ---
  301. count  ^J    Move down (MOVE)
  302.        ^K    ---
  303.        ^L    Redraw the screen
  304. count  ^M    Move to the front of the next line (MOVE)
  305. count  ^N    Move down (MOVE)
  306.        ^O    ---
  307. count  ^P    Move up (MOVE)
  308.        ^Q    --- (typically XON, which restarts screen updates)
  309.        ^R    Redraw the screen
  310.        ^S    --- (typically XOFF, which stops screen updates)
  311.        ^T    Return to source of previous :tag or ^] command.
  312. count  ^U    Scroll up <count> lines (default 1/2 screen)
  313.        ^V    ---
  314.        ^W    ---
  315. count  ^X    Move to a physical column number on the screen (MOVE) (EXT)
  316. count  ^Y    Scroll down <count> lines
  317.        ^Z    --- (sometimes sends SIGSUSP, to suspend execution)
  318.        ESC   ---
  319.        ^\    --- (usually sends SIGQUIT, which is ignored)
  320.        ^]    If the cursor is on a tag name, go to that tag
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330. 2-2                 VISUAL MODE COMMANDS                 2-2
  331.  
  332.  
  333.        ^^    Switch to the previous file, like ":e #"
  334. count  ^_    Move to a given screen-relative row (MOVE) (EXT)
  335. count  SPC   Move right,like l (MOVE)
  336.        ! mv  Run the selected lines thru an external filter program
  337.        " key Select which cut buffer to use next
  338. count  # +   Increment a number (EDIT) (EXT)
  339.        $     Move to the rear of the current line (MOVE)
  340. count  %     Move to matching (){}[] or to a given % of file (MOVE) (EXT)
  341. count  &     Repeat the previous ":s//" command here (EDIT)
  342.        ' key Move to a marked line (MOVE)
  343. count  (     Move backward <count> sentences (MOVE)
  344. count  )     Move forward <count> sentences (MOVE)
  345.        *     Go to the next error in the errlist (EXT)
  346. count  +     Move to the front of the next line (MOVE)
  347. count  ,     Repeat the previous [fFtT] but in the other direction (MOVE)
  348. count  -     Move to the front of the preceding line (MOVE)
  349. count  .     Repeat the previous "edit" command
  350.        / textSearch forward for a given regular expression (MOVE)
  351.        0     If not part of count, move to 1st char of this line (MOVE)
  352.        1     Part of count
  353.        2     Part of count
  354.        3     Part of count
  355.        4     Part of count
  356.        5     Part of count
  357.        6     Part of count
  358.        7     Part of count
  359.        8     Part of count
  360.        9     Part of count
  361.        : textRun single EX cmd
  362. count  ;     Repeat the previous [fFtT] cmd (MOVE)
  363.        < mv  Shift text left (EDIT)
  364.        = mv  Reformat
  365.        > mv  Shift text right (EDIT)
  366.        ? textSearch backward for a given regular expression (MOVE)
  367.        @ key Execute the contents of a cut-buffer as VI commands
  368. count  A inp Append at end of the line (EDIT)
  369. count  B     Move back Word (MOVE)
  370.        C inp Change text from the cursor through the end of the line (EDIT)
  371.        D     Delete text from the cursor through the end of the line (EDIT)
  372. count  E     Move end of Word (MOVE)
  373. count  F key Move leftward to a given character (MOVE)
  374. count  G     Move to line #<count> (default is the bottom line) (MOVE)
  375. count  H     Move to home row (the line at the top of the screen)
  376. count  I inp Insert at the front of the line (after indents) (EDIT)
  377. count  J     Join lines, to form one big line (EDIT)
  378.        K     Look up keyword (EXT)
  379. count  L     Move to last row (the line at the bottom of the screen)
  380.        M     Move to middle row
  381.        N     Repeat previous search, but in the opposite direction (MOVE)
  382. count  O inp Open up a new line above the current line (EDIT)
  383.        P     Paste text before the cursor (EDIT)
  384.        Q     Quit to EX mode
  385.        R inp Overtype (EDIT)
  386. count  S inp Change lines, like <count>cc
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396. 2-3                 VISUAL MODE COMMANDS                 2-3
  397.  
  398.  
  399. count  T key Move leftward *almost* to a given character (MOVE)
  400.        U     Undo all recent changes to the current line
  401.        V     Start marking lines for c/d/y/</>/!/\ (EXT)
  402. count  W     Move forward <count> Words (MOVE)
  403. count  X     Delete the character(s) to the left of the cursor (EDIT)
  404. count  Y     Yank text line(s) (copy them into a cut buffer)
  405.        Z Z   Save the file & exit
  406.        [ [   Move back 1 section (MOVE)
  407.        \ mv  Pop-up menu for modifying text (EXT)
  408.        ] ]   Move forward 1 section (MOVE)
  409.        ^     Move to the front of the current line (after indent) (MOVE)
  410. count  _     Move to the current line
  411.        ` key Move to a marked character (MOVE)
  412. count  a inp Insert text after the cursor (EDIT)
  413. count  b     Move back <count> words (MOVE)
  414.        c mv  Change text (EDIT)
  415.        d mv  Delete text (EDIT)
  416. count  e     Move forward to the end of the current word (MOVE)
  417. count  f key Move rightward to a given character (MOVE)
  418.        g     ---
  419. count  h     Move left (MOVE)
  420. count  i inp Insert text at the cursor (EDIT)
  421. count  j     Move down (MOVE)
  422. count  k     Move up (MOVE)
  423. count  l     Move right (MOVE)
  424.        m key Mark a line or character
  425.        n     Repeat the previous search (MOVE)
  426. count  o inp Open a new line below the current line (EDIT)
  427.        p     Paste text after the cursor (EDIT)
  428.        q     ---
  429. count  r key Replace <count> chars by a given character (EDIT)
  430. count  s inp Replace <count> chars with text from the user (EDIT)
  431. count  t key Move rightward *almost* to a given character (MOVE)
  432.        u     Undo the previous edit command
  433.        v     Start marking characters for c/d/y/</>/!/\ (EXT)
  434. count  w     Move forward <count> words (MOVE)
  435. count  x     Delete the character that the cursor's on (EDIT)
  436.        y mv  Yank text (copy it into a cut buffer)
  437.        z key Scroll current line to the screen's +=top -=bottom .=middle
  438. count  {     Move back <count> paragraphs (MOVE)
  439. count  |     Move to column <count> (the leftmost column is 1)
  440. count  }     Move forward <count> paragraphs (MOVE)
  441. count  ~     Switch a character between uppercase & lowercase (EDIT)
  442.        DEL   --- (usually mapped to shift-X, so it deletes one character)
  443.  
  444.  
  445. count  Many  commands may be preceded by a count.  This is a
  446.        sequence of digits  representing  a  decimal  number.
  447.        For  most  commands  that use a count, the command is
  448.        repeated  <count>  times.   The   count   is   always
  449.        optional, and usually defaults to 1.
  450.  
  451. key    Some  commands require two keystrokes.  The first key
  452.        always determines which command is  to  be  executed.
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462. 2-4                 VISUAL MODE COMMANDS                 2-4
  463.  
  464.  
  465.        The second key is used as a parameter to the command.
  466.  
  467. mv     Some commands (! < > c d  y  \  =)  operate  on  text
  468.        between  the  cursor  and some other position.  There
  469.        are three ways that you can specify that other  posi-
  470.        tion.
  471.  
  472.        The first way is to follow the command keystroke with
  473.        a movement command.  For example, "dw" deletes a sin-
  474.        gle word.  "d3w" and "3dw" both delete three words.
  475.  
  476.        The  second  way  is  to  type  the command keystroke
  477.        twice.  This causes whole lines  to  be  acted  upon.
  478.        For  example,  ">>"  indents the current line.  "3>>"
  479.        indents the current line and the following two lines.
  480.  
  481.        The  last way is to move the cursor to one end of the
  482.        text, type 'v' or 'V' to start marking, move the cur-
  483.        sor  to the other end, and then type the desired com-
  484.        mand key.
  485.  
  486. inp    Many commands allow the user to  interactively  enter
  487.        text.  See the discussion of "input mode" in the fol-
  488.        lowing section.
  489.  
  490. (EXT)  These commands are extensions -- the real vi  doesn't
  491.        have them.
  492.  
  493. (EDIT) These  commands  affect  text, and may be repeated by
  494.        the "." command.
  495.  
  496. (MOVE) These commands move the cursor, and may  be  used  to
  497.        specify  the  extent of a member of the "mv" class of
  498.        commands.
  499.  
  500. 2.1.  Input Mode
  501.  
  502.      You can't type text into your file directly from visual
  503. command  mode.  Instead, you must first give a command which
  504. will put you into input mode.  The commands to do  this  are
  505. A/C/I/O/R/S/a/i/o/s.
  506.  
  507.      The  S/s/C/c  commands temporarily place a $ at the end
  508. of the text that they are going to change.
  509.  
  510.      In input mode, all keystrokes  are  inserted  into  the
  511. text at the cursor's position, except for the following:
  512.  
  513.      ^A   insert a copy of the last input text
  514.      ^D   delete one indent character
  515.      ^H   (backspace) erase the character before the cursor
  516.      ^L   redraw the screen
  517.      ^M   (carriage return) insert a newline (^J, linefeed)
  518.      ^O   execute next key as a visual command (limited!)
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528. 2-5                 VISUAL MODE COMMANDS                 2-5
  529.  
  530.  
  531.      ^P   insert the contents of the cut buffer
  532.      ^R   redraw the screen, like ^L
  533.      ^T   insert an indent character
  534.      ^U   backspace to the beginning of the line
  535.      ^V   insert the following keystroke, even if special
  536.      ^W   backspace to the beginning of the current word
  537.      ^Z^Z write the file & exit Elvis
  538.      ^[   (ESCape) exit from input mode, back to command mode
  539.  
  540.  
  541.      Also,  on  some  systems,  ^S  may  stop output, ^Q may
  542. restart output, and ^C may interrupt execution.  ^@ (the NUL
  543. character) cannot be inserted.
  544.  
  545.      The  R  visual command puts you in overtype mode, which
  546. is a slightly different form of  input  mode.   In  overtype
  547. mode, each time you insert a character, one of the old char-
  548. acters is deleted from the file.
  549.  
  550. 2.2.  Arrow keys in Input Mode
  551.  
  552.      The arrow keys can be used to move the cursor in  input
  553. mode.   (This  is  an extension; the real Vi doesn't support
  554. arrow keys in input mode.)  The <PgUp>, <PgDn>, <Home>,  and
  555. <End>  keys  work  in  input  mode,  too.   The <Delete> key
  556. deletes a single character in input mode.  The <Insert>  key
  557. toggles between input mode and replace mode.
  558.  
  559.      The  best  thing  about  allowing arrow keys to work in
  560. input mode is that as long as you're in  input  mode,  Elvis
  561. seems  to  have a fairly ordinary user interface.  With most
  562. other text editors, you are always in either insert mode  or
  563. replace  mode, and you can use the arrow keys at any time to
  564. move the cursor.  Now, Elvis can act  like  that,  too.   In
  565. fact,  with  the  new  "inputmode" option and the "control-Z
  566. control-Z" input command, you may  never  have  to  go  into
  567. visual command mode for simple edit sessions.
  568.  
  569. 2.3.  Digraphs
  570.  
  571.      Elvis  supports  digraphs  as  a way to enter non-ASCII
  572. characters.  A digraph is a character which is  composed  of
  573. two  other  characters.   For example, an apostrophe and the
  574. letter i could be defined as a digraph which is to be stored
  575. & displayed as an accented i.
  576.  
  577.      There  is no single standard for extended ASCII charac-
  578. ter sets.  Elvis can be compiled to fill  the  digraph  with
  579. values  appropriate  for either the IBM PC character set, or
  580. the LATIN-1 character set used by  X  windows,  or  neither.
  581. (See  the  discussions  of -DCS_IBMPC and -DCS_LATIN1 in the
  582. CFLAGS section of this manual.)  You can view  or  edit  the
  583. digraph table via the ":digraph" colon command.
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594. 2-6                 VISUAL MODE COMMANDS                 2-6
  595.  
  596.  
  597.      Digraphs  will  not  be recognized until you've entered
  598. ":set digraph".
  599.  
  600.      To actually use a digraph  type  the  first  character,
  601. then  hit  <Backspace>,  and then type the second character.
  602. Elvis will then substitute the non-ASCII character in  their
  603. place.
  604.  
  605. 2.4.  Abbreviations
  606.  
  607.      Elvis  can expand abbreviations for you.  You define an
  608. abbreviation with the :abbr command, and then  whenever  you
  609. type in the abbreviated form while in input mode, Elvis will
  610. immediately replace it with the long form.   COBOL  program-
  611. mers should find this useful. :-)
  612.  
  613.      Elvis doesn't perform the substitution until you type a
  614. non-alphanumeric character to mark the end of the word.   If
  615. you type a control-V before that non-alphanumeric character,
  616. then Elvis will not perform the substitution.
  617.  
  618. 2.5.  Auto-Indent
  619.  
  620.      With the ":set autoindent" option turned on, Elvis will
  621. automatically  insert leading whitespace at the beginning of
  622. each new line that you type in.  The leading  whitespace  is
  623. copied from the preceding line.
  624.  
  625.      To  add  more  leading  whitespace, type control-T.  To
  626. remove some whitespace, type control-D.
  627.  
  628.      If you ":set noautotab", then the whitespace  generated
  629. by  control-T  will  always consist of spaces -- never tabs.
  630. Some people seem to prefer this.
  631.  
  632.      Elvis' autoindent mode isn't 100% compatible with vi's.
  633. In  Elvis, 0^D and ^^D don't work, ^U can wipeout all inden-
  634. tation, and sometimes Elvis will use a different  amount  of
  635. indentation than vi would.
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663. 3.  COLON MODE COMMANDS
  664.  
  665.      To use colon mode commands, you must switch from visual
  666. command mode to colon command mode.  The  visual  mode  com-
  667. mands  to do this are ":" for a single colon command, or "Q"
  668. for many colon mode commands.
  669.  
  670.      In general, command lines begin with 0, 1,  or  2  line
  671. specifiers,  followed  by  a  command name, and perhaps some
  672. arguments after that.
  673.  
  674.      Lines which don't access the  text,  such  as  ":quit",
  675. don't  allow  any  line specifiers.  Other commands, such as
  676. ":mark", only allow a single line specifier.  Most commands,
  677. though, allow two line specifiers; the command is applied to
  678. all lines between the two specified lines,  inclusive.   The
  679. table  below indicates how many line specifiers each command
  680. allows.
  681.  
  682.      Command names can usually be abbreviated; in the  table
  683. below,  the  extra  part of command names has is enclosed in
  684. square brackets.  Square brackets are also used to  indicate
  685. which arguments are optional.
  686.  
  687.         LINES               COMMAND   ARGUMENTS
  688.                             ab[br]    [short] [expanded form]
  689.                             an[d]     condition
  690.         [line]              a[ppend][!]
  691.                             ar[gs]    [files]
  692.                             cc        [files]
  693.                             cd[!]     [directory]
  694.         [line][,line]       c[hange]
  695.                             chd[ir][!][directory]
  696.         [line][,line]       co[py]    line
  697.                             col[or]   [when] [[light] color] [on color]
  698.         [line][,line]       d[elete]  [x]
  699.                             dig[raph][!][XX [Y]]
  700.                             e[dit][!] [file]
  701.                             el[se]    commands
  702.                             er[rlist][!][errlist]
  703.                             f[ile]    [file]
  704.         [line][,line]       g[lobal]  /regexp/ command
  705.                             if        condition
  706.         [line]              i[nsert]
  707.         [line][,line]       j[oin][!]
  708.         [line][,line]       l[ist]
  709.                             mak[e]    [target]
  710.                             map[!]    key mapped_to
  711.         [line]              ma[rk]    x
  712.                             mk[exrc]
  713.         [line][,line]       m[ove]    line
  714.                             n[ext][!] [files]
  715.                             N[ext][!]
  716.         [line][,line]       nu[mber]
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726. 3-2                  COLON MODE COMMANDS                 3-2
  727.  
  728.  
  729.                             o[r]      condition
  730.                             po[p][!]
  731.         [line][,line]       p[rint]
  732.         [line]              pu[t]     [x]
  733.                             q[uit][!]
  734.         [line]              r[ead]    file
  735.                             rew[ind][!]
  736.                             se[t]     [options]
  737.                             so[urce]  file
  738.         [line][,line]       s[ubstitute]/regexp/replacement/[p][g][c]
  739.         [line][,line]       t         line
  740.                             ta[g][!]  tagname
  741.                             th[en]    commands
  742.                             una[bbr]  [short]
  743.                             u[ndo]
  744.                             unm[ap][!]key
  745.                             ve[rsion]
  746.         [line][,line]       v[global] /regexp/ command
  747.                             vi[sual]  [filename]
  748.                             wq
  749.         [line][,line]       w[rite][!][[>>]file]
  750.                             x[it][!]
  751.         [line][,line]       y[ank]    [x]
  752.         [line][,line]       !         command
  753.         [line][,line]       <
  754.         [line][,line]       =
  755.         [line][,line]       >
  756.         [line][,line]       &
  757.                             @          x
  758.  
  759.  
  760. 3.1.  Line Specifiers
  761.  
  762.      Line  specifiers  are  always optional.  The first line
  763. specifier of most commands usually defaults to  the  current
  764. line.   The second line specifier usually defaults to be the
  765. same as the first line specifier.   Exceptions  are  :write,
  766. :global, and :vglobal, which act on all lines of the file by
  767. default, and :!, which acts on no lines by default.
  768.  
  769.      If you use the visual V command  to  mark  a  range  of
  770. lines, and then use the visual : command to execute a single
  771. ex command, then the default range affected by the  ex  com-
  772. mand will be the visibly marked text.
  773.  
  774.      Line specifiers consist of an absolute part and a rela-
  775. tive part.  The absolute part of a  line  specifier  may  be
  776. either  an explicit line number, a mark, a dot to denote the
  777. current line, a dollar sign to denote the last line  of  the
  778. file, or a forward or backward search.
  779.  
  780.      An  explicit  line  number  is simply a decimal number,
  781. expressed as a string of digits.
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792. 3-3                  COLON MODE COMMANDS                 3-3
  793.  
  794.  
  795.      A mark is typed in as an apostrophe followed by a  let-
  796. ter.   Marks  must  be set before they can be used.  You can
  797. set a mark in visual command mode by typing "m" and  a  let-
  798. ter,  or you can set it in colon command mode via the "mark"
  799. command.
  800.  
  801.      A forward search is typed in as  a  regular  expression
  802. surrounded  by  slash  characters;  searching  begins at the
  803. default line.  A backward search is typed in  as  a  regular
  804. expression surrounded by question marks; searching begins at
  805. the line before the default line.
  806.  
  807.      If you omit the absolute part, then the default line is
  808. used.
  809.  
  810.      The relative part of a line specifier is typed as a "+"
  811. or "-" character followed by a decimal number.   The  number
  812. is added to or subtracted from the absolute part of the line
  813. specifier to produce the final line number.
  814.  
  815.      As a special case, the % character may be used to spec-
  816. ify all lines of the file.  It is roughly equivalent to say-
  817. ing 1,$.  This can be a handy shortcut.
  818.  
  819.      Some examples:
  820.  
  821.      :p           print the current line
  822.      :37p         print line 37
  823.      :'gp         print the line which contains mark g
  824.      :/foo/p      print the next line that contains "foo"
  825.      :$p          print the last line of the file
  826.      :20,30p      print lines 20 through 30
  827.      :1,$p        print all lines of the file
  828.      :%p          print all lines of the file
  829.      :/foo/-2,+4p print 5 lines around the next "foo"
  830.  
  831.  
  832. 3.2.  Text Entry Commands
  833.  
  834.      [line] append
  835.      [line][,line] change ["x]
  836.      [line] insert
  837.  
  838.  
  839.      The append command inserts  text  after  the  specified
  840. line.
  841.  
  842.      The  insert  command  inserts text before the specified
  843. line.
  844.  
  845.      The change command copies the range of lines into a cut
  846. buffer,  deletes  them,  and  inserts new text where the old
  847. text used to be.
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858. 3-4                  COLON MODE COMMANDS                 3-4
  859.  
  860.  
  861.      For all of these commands, you indicate the end of  the
  862. text  you're  inserting  by hitting ^D or by entering a line
  863. which contains only a period.
  864.  
  865. 3.3.  Cut & Paste Commands
  866.  
  867.      [line][,line] delete ["x]
  868.      [line][,line] yank ["x]
  869.      [line] put ["x]
  870.      [line][,line] copy line
  871.      [line][,line] to line
  872.      [line][,line] move line
  873.  
  874.  
  875.      The delete command copies the specified range of  lines
  876. into a cut buffer, and then deletes them.
  877.  
  878.      The  yank  command  copies the specified range of lines
  879. into a cut buffer, but does *not* delete them.
  880.  
  881.      The put command inserts text from a  cut  buffer  after
  882. the specified line.
  883.  
  884.      The  copy  and  to commands yank the specified range of
  885. lines and then immediately paste them after some other line.
  886.  
  887.      The  move  command deletes the specified range of lines
  888. and then immediately pastes them after some other line.   If
  889. the  destination  line comes after the deleted text, then it
  890. will be adjusted automatically to account  for  the  deleted
  891. lines.
  892.  
  893. 3.4.  Display Text Commands
  894.  
  895.      [line][,line] print
  896.      [line][,line] list
  897.      [line][,line] number
  898.  
  899.  
  900.      The  print  command  displays  the  specified  range of
  901. lines.
  902.  
  903.      The number command displays the lines, with  line  num-
  904. bers.
  905.  
  906.      The  list command also displays them, but it is careful
  907. to make control characters visible.
  908.  
  909. 3.5.  Global Operations Commands
  910.  
  911.      [line][,line] global /regexp/ command
  912.      [line][,line] vglobal /regexp/ command
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924. 3-5                  COLON MODE COMMANDS                 3-5
  925.  
  926.  
  927.      The global command searches through the  lines  of  the
  928. specified  range  (or  through the whole file if no range is
  929. specified) for lines that contain a  given  regular  expres-
  930. sion.   It  then moves the cursor to each of these lines and
  931. runs some other command on them.
  932.  
  933.      The vglobal command is similar,  but  it  searches  for
  934. lines that don't contain the regular expression.
  935.  
  936. 3.6.  Line Editing Commands
  937.  
  938.      [line][,line] join[!]
  939.      [line][,line] ! program
  940.      [line][,line] <
  941.      [line][,line] >
  942.      [line][,line] substitute /regexp/replacement/[p][g][c]
  943.      [line][,line] &
  944.  
  945.  
  946.      The  join  command catenates all lines in the specified
  947. range together to form one big line.  If only a single  line
  948. is  specified, then the following line is catenated onto it.
  949. The normal ":join" inserts one or  two  spaces  between  the
  950. lines;  the  ":join!"  variation (with a '!') doesn't insert
  951. spaces.
  952.  
  953.      The ! command runs  an  external  filter  program,  and
  954. feeds the specified range of lines to it's stdin.  The lines
  955. are then replaced by the output of the  filter.   A  typical
  956. example would be ":'a,'z!sort" to sort the lines 'a,'z.
  957.  
  958.      The < and > commands shift the specified range of lines
  959. left or right, normally by the width  of  1  tab  character.
  960. The "shiftwidth" option determines the shifting amount.
  961.  
  962.      The  substitute command finds the regular expression in
  963. each line, and replaces it with the replacement  text.   The
  964. "p"  option causes the altered lines to be printed.  The "g"
  965. option permits all instances of the regular expression to be
  966. found  &  replaced.  (Without "g", only the first occurrence
  967. in each line is replaced.)  The "c" option asks for  confir-
  968. mation before each substitution.
  969.  
  970.      The  &  command  repeats the previous substitution com-
  971. mand.  Actually, "&" is equivalent to "s//~/" with the  same
  972. options  as  last  time.   It  searches for the last regular
  973. expression that you specified for any purpose, and  replaces
  974. it with the the same text that was used in the previous sub-
  975. stitution.
  976.  
  977. 3.7.  Undo Command
  978.  
  979.      undo
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990. 3-6                  COLON MODE COMMANDS                 3-6
  991.  
  992.  
  993.      The undo command restores the file to the state it  was
  994. in before your most recent command which changed text.
  995.  
  996. 3.8.  Configuration & Status Commands
  997.  
  998.      map[!] [key mapped_to]
  999.      unmap[!] key
  1000.      abbr [word expanded_form_of_word]
  1001.      unabbr word
  1002.      digraph[!] [XX [Y]]
  1003.      set [options]
  1004.      mkexrc
  1005.      [line] mark "x
  1006.      visual
  1007.      version
  1008.      [line][,line] =
  1009.      file [file]
  1010.      source file
  1011.      @ "x
  1012.      color [when] [["light"] color] ["on" color]
  1013.  
  1014.  
  1015.      The map command allows you to configure Elvis to recog-
  1016. nize your function keys,  and  treat  them  as  though  they
  1017. transmitted  some  other  sequence  of characters.  Normally
  1018. this mapping is done only when in the visual  command  mode,
  1019. but  with  the  [!] present it will map keys under input and
  1020. replace modes as well.  When this command is given  with  no
  1021. arguments,  it prints a table showing all mappings currently
  1022. in effect.  When called with two arguments, the first is the
  1023. sequence that your function key really sends, and the second
  1024. is the sequence that you want Elvis to treat  it  as  having
  1025. sent.   As  a  special  case, if the first argument is a '#'
  1026. sign followed by a number then Elvis  will  map  the  corre-
  1027. sponding  function key; for example, ":map #7 dd" will cause
  1028. the <F7> key to delete a line.  Also, on some systems, ":map
  1029. #7s  ..."  may  map <Shift-F7>, ":map #7c ..." may map <Con-
  1030. trol-F7>, and ":map #7a ..." may map <Alt-F7>.
  1031.  
  1032.      The unmap command removes  key  definitions  that  were
  1033. made via the map command.
  1034.  
  1035.      The  abbr  command  is  used  to define/list a table of
  1036. abbreviations.  The table contains both the abbreviated form
  1037. and the fully spelled-out form.  When you're in visual input
  1038. mode, and you type  in  the  abbreviated  form,  Elvis  will
  1039. replace  the  abbreviated  form  with  the fully spelled-out
  1040. form.  When this command is  called  without  arguments,  it
  1041. lists the table; with two or more arguments, the first argu-
  1042. ment is taken as the abbreviated form, and the rest  of  the
  1043. command line is the fully-spelled out form.
  1044.  
  1045.      The unabbr command deletes entries from the abbr table.
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056. 3-7                  COLON MODE COMMANDS                 3-7
  1057.  
  1058.  
  1059.      The digraph command allows you to display  the  set  of
  1060. digraphs  that  Elvis is using, or add/remove a digraph.  To
  1061. list the set of digraphs, use the digraph  command  with  no
  1062. arguments.   To  add  a digraph, you should give the digraph
  1063. command two arguments.  The first argument is the two  ASCII
  1064. characters  that  are to be combined; the second is the non-
  1065. ASCII character that they represent.  The non-ASCII  charac-
  1066. ter's  most  significant  bit  is  automatically  set by the
  1067. digraph command, unless to append a ! to the  command  name.
  1068. Removal  of a digraph is similar to adding a digraph, except
  1069. that you should leave off the second argument.
  1070.  
  1071.      The set command  allows  you  examine  or  set  various
  1072. options.   With  no  arguments,  it  displays  the values of
  1073. options that have been changed.  With  the  single  argument
  1074. "all"  it  displays the values of all options, regardless of
  1075. whether they've been explicitly set or not.  Otherwise,  the
  1076. arguments are treated as options to be set.
  1077.  
  1078.      The mkexrc command saves the current configuration to a
  1079. file called ".exrc" in the current directory.
  1080.  
  1081.      The mark command defines a named mark  to  refer  to  a
  1082. specific  place in the file.  This mark may be used later to
  1083. specify lines for other commands.
  1084.  
  1085.      The visual command puts the editor  into  visual  mode.
  1086. Instead of emulating ex, Elvis will start emulating vi.
  1087.  
  1088.      The  version  command  tells  you  that what version of
  1089. Elvis this is.
  1090.  
  1091.      The = command tells you what line you specified, or, if
  1092. you  specified  a range of lines, it will tell you both end-
  1093. points and the number of lines included in the range.
  1094.  
  1095.      The file command  tells  you  the  name  of  the  file,
  1096. whether  it  has  been  modified, the number of lines in the
  1097. file, and the current line number.  You can also use  it  to
  1098. change the name of the current file.
  1099.  
  1100.      The  source command reads a sequence of colon mode com-
  1101. mands from a file, and interprets them.
  1102.  
  1103.      The @ command executes the contents of a cut-buffer  as
  1104. EX commands.
  1105.  
  1106.      The  color  command  only works under MS-DOS, or if you
  1107. have an ANSI-compatible color terminal.  It  allows  you  to
  1108. set the foreground and background colors for different types
  1109. of text: normal, bold, italic, underlined, standout,  pop-up
  1110. menu,  and  visible  selection.   By default, it changes the
  1111. "normal" colors; to change other colors, the first  argument
  1112. to the :color command should be the first letter of the type
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122. 3-8                  COLON MODE COMMANDS                 3-8
  1123.  
  1124.  
  1125. of text you want.  The syntax for the colors  themselves  is
  1126. fairly  intuitive.  For example, ":color light cyan on blue"
  1127. causes normal text to be displayed in light cyan on  a  blue
  1128. background,  and ":color b bright white" causes bold text to
  1129. be displayed in bright white  on  a  blue  background.   The
  1130. background  color  always defaults to the current background
  1131. color of normal text.  Your first :color command must  spec-
  1132. ify both the foreground and background for normal text.
  1133.  
  1134. 3.9.  Conditional Commands
  1135.  
  1136.      if condition
  1137.      and condition
  1138.      or condition
  1139.      then commands
  1140.      else commands
  1141.  
  1142.  
  1143.      These commands allow Elvis to execute a set of commands
  1144. only if a given condition is valid.  The  if,  and,  and  or
  1145. commands set or clear a flag, and the then and else commands
  1146. test that flag to decide whether to execute their  arguments
  1147. as commands.  This can be handy in .exrc files.
  1148.  
  1149.      A condition can test the following types of values:
  1150.  
  1151.  
  1152.      filetype - asterisk, followed by filename extension
  1153.      constants - either a number or a quoted string
  1154.      options - the name of a :set option
  1155.      termcap fields - a two letter name, enclosed in colons
  1156.      environment variables - the name, preceded by a dollar sign
  1157.  
  1158.  
  1159.      The condition can involve either one boolean value, two
  1160. strings compared for equality ("="  or  "==")  or  inquality
  1161. ("!="),  or  two numbers compared with any comparison opera-
  1162. tor.
  1163.  
  1164.      The if command sets the conditional flag equal  to  the
  1165. results  of the condition.  The and command performs a logi-
  1166. cal AND of the conditional flag and the new condition.   The
  1167. or command performs a logical OR of the conditional flag and
  1168. the new condition.
  1169.  
  1170.      The then command's arguments are one or more  commands.
  1171. (Commands  can  be  delimited  by  placing  a  '|' character
  1172. between them.)  The commands are executed if the conditional
  1173. flag  is  true,  or skipped if it is false.  Similarly, else
  1174. executes its arguments  only  if  the  conditional  flag  is
  1175. false.
  1176.  
  1177.      For  example, on my Linux system the console can handle
  1178. color commands, but xterms can't.  To have colors set on the
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188. 3-9                  COLON MODE COMMANDS                 3-9
  1189.  
  1190.  
  1191. console  but  not  on  an xterm, I added the following to my
  1192. .exrc file...
  1193.  
  1194.  
  1195.      if term="console"
  1196.      then color yellow on blue | color quit white on blue
  1197.  
  1198.  
  1199.      Note: The .exrc file is executed before elvis loads the
  1200. first file, so you can't test for a specific filename there,
  1201. or modify text, or adjust cut buffers.  A new initialization
  1202. file,  ".exfilerc",  is now supported to fill this need.  It
  1203. resides in your home directory.  The .exfilerc file is  exe-
  1204. cuted  after  each file is loaded.  A typical .exfilerc file
  1205. might look like...
  1206.  
  1207.  
  1208.      if *.c
  1209.      or *.h
  1210.      and newfile
  1211.      then 1!mkskel %
  1212.  
  1213.  
  1214. 3.10.  Multiple File Commands
  1215.  
  1216.      args [files]
  1217.      next[!] [files]
  1218.      Next[!]
  1219.      previous[!]
  1220.      rewind[!]
  1221.  
  1222.  
  1223.      When you invoke Elvis from your shell's  command  line,
  1224. any filenames that you give to Elvis as arguments are stored
  1225. in the args list.  The args command will display this  list,
  1226. or define a new one.
  1227.  
  1228.      The  next command switches from the current file to the
  1229. next one in the args list.  You may specify a new args  list
  1230. here, too.
  1231.  
  1232.      The  Next and previous commands (they're really aliases
  1233. for the same command) switch from the current  file  to  the
  1234. preceding file in the args list.
  1235.  
  1236.      The  rewind  command  switches from the current file to
  1237. the first file in the args list.
  1238.  
  1239. 3.11.  Switching Files
  1240.  
  1241.      edit[!] [file]
  1242.      tag[!] tagname
  1243.      pop[!]
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254. 3-10                 COLON MODE COMMANDS                3-10
  1255.  
  1256.  
  1257.      The edit command allows to switch from the current file
  1258. to  some  other  file.  This has nothing to do with the args
  1259. list, by the way.
  1260.  
  1261.      The tag command looks up a  given  tagname  in  a  file
  1262. called  "tags".  This tells it which file the tag is in, and
  1263. how to find it in that file.  Elvis  then  switches  to  the
  1264. tag's file and finds the tag.
  1265.  
  1266.      The  pop  command  reverses a tag command.  It switches
  1267. back to the file and line number from which you invoked  the
  1268. tag  command.   Up  to  15 tag commands can be reversed; the
  1269. filenames and line numbers are saved on a stack, so you  can
  1270. perform  multiple  tag  commands, and then reverse them with
  1271. multiple pop commands.
  1272.  
  1273. 3.12.  Working with a Compiler
  1274.  
  1275.      cc [files]
  1276.      make [target]
  1277.      errlist[!] [errlist]
  1278.  
  1279.  
  1280.      The cc and  make  commands  execute  your  compiler  or
  1281. "make"  utility  and redirect any error messages into a file
  1282. called "errlist".  By default, cc  is  run  on  the  current
  1283. file.   (You  should  write it before running cc.)  The con-
  1284. tents of the "errlist" file are then scanned for error  mes-
  1285. sages.   If  an  error  message is found, then the cursor is
  1286. moved to the line where the  error  was  detected,  and  the
  1287. description of the error is displayed on the status line.
  1288.  
  1289.      After  you've fixed one error, the errlist command will
  1290. move the cursor to the next error.  In visual command  mode,
  1291. hitting `*' will do this, too.
  1292.  
  1293.      You  can  also create an "errlist" file from outside of
  1294. Elvis, and use "elvis -m" to start Elvis and have the cursor
  1295. moved  to the first error.  Note that you don't need to sup-
  1296. ply a filename with "elvis -m" because  the  error  messages
  1297. always say which source file an error is in.
  1298.  
  1299.      Note:  When  you  use errlist repeatedly to fix several
  1300. errors in a single file,  it  will  attempt  to  adjust  the
  1301. reported  line  numbers  to  allow  for  lines that you have
  1302. inserted or deleted.  These adjustments are  made  with  the
  1303. assumption  that  you  will  work  though  the file from the
  1304. beginning to the end.
  1305.  
  1306. 3.13.  Exit Commands
  1307.  
  1308.      quit[!]
  1309.      wq
  1310.      xit
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320. 3-11                 COLON MODE COMMANDS                3-11
  1321.  
  1322.  
  1323.      The quit command exits from the editor  without  saving
  1324. your file.
  1325.  
  1326.      The wq command writes your file out, then then exits.
  1327.  
  1328.      The  xit  command  is similar to the wq command, except
  1329. that xit won't bother to write your file if you haven't mod-
  1330. ified it.
  1331.  
  1332. 3.14.  File I/O Commands
  1333.  
  1334.      [line] read file
  1335.      [line][,line] write[!] [[>>]file]
  1336.  
  1337.  
  1338.      The  read  command  gets  text  from  another  file and
  1339. inserts it after the specified line.  It can also  read  the
  1340. output  of  a  program; simply precede the program name by a
  1341. '!' and use it in place of the file name.
  1342.  
  1343.      The write command writes the whole file, or  just  part
  1344. of  it,  to some other file.  The !, if present, will permit
  1345. the lines to be written even  if  you've  set  the  readonly
  1346. option.   If  you  precede the filename by >> then the lines
  1347. will be appended to the file.  You can send the lines to the
  1348. standard input of a program by replacing the filename with a
  1349. '!' followed by the command and its arguments.
  1350.  
  1351.      Note: Be careful not to confuse ":w!filename"  and  ":w
  1352. !command".   To  write  to a program, you must have at least
  1353. one blank before the '!'.
  1354.  
  1355. 3.15.  Directory Commands
  1356.  
  1357.      cd [directory]
  1358.      chdir [directory]
  1359.      shell
  1360.  
  1361.  
  1362.      The cd and chdir commands (really  two  names  for  one
  1363. command) switch the current working directory.
  1364.  
  1365.      The shell command starts an interactive shell.
  1366.  
  1367. 3.16.  Debugging Commands
  1368.  
  1369.      [line][,line] debug[!]
  1370.      validate[!]
  1371.  
  1372.  
  1373.      These  commands are only available if you compile Elvis
  1374. with the -DDEBUG flag.
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386. 3-12                 COLON MODE COMMANDS                3-12
  1387.  
  1388.  
  1389.      The debug command lists statistics for the blocks which
  1390. contain  the specified range of lines.  If the ! is present,
  1391. then the contents of those blocks is displayed, too.
  1392.  
  1393.      The  validate  command  checks  certain  variables  for
  1394. internal  consistency.   Normally it doesn't output anything
  1395. unless it detects a problem.  With the !,  though,  it  will
  1396. always produce *some* output.
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455. 4.  REGULAR EXPRESSIONS
  1456.  
  1457.  
  1458.      Elvis  uses  regular expressions for searching and sub-
  1459. stitutions.  A regular expression is a text string in  which
  1460. some  characters  have  special meanings.  This is much more
  1461. powerful than simple text matching.
  1462.  
  1463.  
  1464. Syntax
  1465.  
  1466.      Elvis' regexp package treats the following one- or two-
  1467. character strings (called meta-characters) in special ways:
  1468.  
  1469.  
  1470. \(subexpression\)
  1471.         The  \(  and  \)  metacharacters are used to delimit
  1472.         subexpressions.  When the regular expression matches
  1473.         a  particular  chunk  of  text,  Elvis will remember
  1474.         which portion of that chunk matched  the  subexpres-
  1475.         sion.   The  :s/regexp/newtext/ command makes use of
  1476.         this feature.
  1477.  
  1478. ^       The ^ metacharacter matches the beginning of a line.
  1479.         If,  for  example,  you  wanted to find "foo" at the
  1480.         beginning of a line, you would use a regular expres-
  1481.         sion  such  as  /^foo/.   Note  that  ^  is  only  a
  1482.         metacharacter if it occurs at  the  beginning  of  a
  1483.         regular  expression; anyplace else, it is treated as
  1484.         a normal character.
  1485.  
  1486. $       The $ metacharacter matches the end of a  line.   It
  1487.         is only a metacharacter when it occurs at the end of
  1488.         a regular expression; elsewhere, it is treated as  a
  1489.         normal  character.  For example, the regular expres-
  1490.         sion /$$/ will search for a dollar sign at  the  end
  1491.         of a line.
  1492.  
  1493. \<      The \< metacharacter matches a zero-length string at
  1494.         the beginning of a word.  A word is considered to be
  1495.         a  string  of  1 or more letters and digits.  A word
  1496.         can begin at the beginning of a line or after  1  or
  1497.         more non-alphanumeric characters.
  1498.  
  1499. \>      The \> metacharacter matches a zero-length string at
  1500.         the end of a word.  A word can end at the end of the
  1501.         line  or  before  1 or more non-alphanumeric charac-
  1502.         ters.   For  example,  /\<end\>/  would   find   any
  1503.         instance  of  the  word  "end", but would ignore any
  1504.         instances of e-n-d inside another word such as "cal-
  1505.         endar".
  1506.  
  1507. \=      This matches any zero-length string; i.e., it has no
  1508.         effect on the text that a  regular  expression  will
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518. 4-2                  REGULAR EXPRESSIONS                 4-2
  1519.  
  1520.  
  1521.         match.  However, it has a useful side-effect for the
  1522.         forward visual search command:  Instead  of  leaving
  1523.         the  cursor  at  the  front of the matching text, it
  1524.         will leave the cursor at the position  that  matched
  1525.         the  \= metacharacter.  For example, "/zo\=t^M" will
  1526.         locate the next "zot" and leave the  cursor  on  the
  1527.         't' instead of the 'z'.
  1528.  
  1529. .       The . metacharacter matches any single character.
  1530.  
  1531. [character-list]
  1532.         This  matches  any single character from the charac-
  1533.         ter-list.  Inside the character-list, you can denote
  1534.         a  span  of characters by writing only the first and
  1535.         last characters, with a hyphen between them.  If the
  1536.         character-list  is  preceded  by a ^ character, then
  1537.         the list is inverted -- it will match character that
  1538.         isn't  mentioned  in the list.  For example, /[a-zA-
  1539.         Z]/ matches any letter, and /[^ ]/ matches  anything
  1540.         other than a blank.
  1541.  
  1542. \@      If  you  are  in visual mode, and the cursor is on a
  1543.         word in the edit buffer before you start typing  the
  1544.         regular  expression,  then \@ will match the word at
  1545.         the cursor.  For example, ":map #1  /\<\@\>^M"  will
  1546.         cause the <F1> key to search for the next occurrence
  1547.         of the word under the cursor.
  1548.  
  1549. \{n\}   This is a closure operator, which means that it  can
  1550.         only be placed after something that matches a single
  1551.         character.  It controls the number of times that the
  1552.         single-character expression should be repeated.
  1553.  
  1554.         The  \{n\}  operator,  in particular, means that the
  1555.         preceding expression should be  repeated  exactly  n
  1556.         times.   For  example, /^-\{80\}$/ matches a line of
  1557.         eighty hyphens, and /\<[a-zA-Z]\{4\}\>/ matches  any
  1558.         four-letter word.
  1559.  
  1560. \{n,m\} This is a closure operator which means that the pre-
  1561.         ceding   single-character   expression   should   be
  1562.         repeated between n and m times, inclusive.  If the m
  1563.         is omitted (but the comma  is  present)  then  m  is
  1564.         taken  to be infinity.  For example, /"[^"]\{3,5\}"/
  1565.         matches any pair of  quotes  which  contains  three,
  1566.         four, or five non-quote characters.
  1567.  
  1568. *       The  *  metacharacter  is  a  closure operator which
  1569.         means that the preceding single-character expression
  1570.         can  be  repeated zero or more times.  It is equiva-
  1571.         lent to \{0,\}.  For example, /.*/ matches  a  whole
  1572.         line.
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584. 4-3                  REGULAR EXPRESSIONS                 4-3
  1585.  
  1586.  
  1587. \+      The  \+  metacharacter  is  a closure operator which
  1588.         means that the preceding single-character expression
  1589.         can be repeated one or more times.  It is equivalent
  1590.         to \{1,\}.  For example, /.\+/ matches a whole line,
  1591.         but  only  if the line contains at least one charac-
  1592.         ter.  It doesn't match empty lines.
  1593.  
  1594. \?      The \? metacharacter is  a  closure  operator  which
  1595.         indicates   that   the   preceding  single-character
  1596.         expression is optional -- that is, that it can occur
  1597.         0  or  1  times.   It is equivalent to \{0,1\}.  For
  1598.         example, /no[ -]\?one/ matches "no  one",  "no-one",
  1599.         or "noone".
  1600.  
  1601.      Anything  else  is  treated as a normal character which
  1602. must exactly match a character from the scanned  text.   The
  1603. special  strings may all be preceded by a backslash to force
  1604. them to be treated normally.
  1605.  
  1606.  
  1607. Substitutions
  1608.  
  1609.      The :s command has at least two  arguments:  a  regular
  1610. expression,  and  a  substitution  string.   The  text  that
  1611. matched the regular expression is replaced by text which  is
  1612. derived from the substitution string.
  1613.  
  1614.      Most  characters  in the substitution string are copied
  1615. into the text literally but a few have special meaning:
  1616.  
  1617.        &     Insert a copy of the original text
  1618.        ~     Insert a copy of the previous replacement text
  1619.        \1    Insert a copy of that portion of the original text which
  1620.              matched the first set of \( \) parentheses
  1621.        \2-\9 Do the same for the second (etc.) pair of \( \)
  1622.        \U    Convert all chars of any later & or \# to uppercase
  1623.        \L    Convert all chars of any later & or \# to lowercase
  1624.        \E    End the effect of \U or \L
  1625.        \u    Convert the first char of the next & or \# to uppercase
  1626.        \l    Convert the first char of the next & or \# to lowercase
  1627.  
  1628.  
  1629.      These may be preceded by a backslash to force  them  to
  1630. be treated normally.  If "nomagic" mode is in effect, then &
  1631. and ~ will be treated normally, and you must write  them  as
  1632. \& and \~ for them to have special meaning.
  1633.  
  1634.  
  1635. Options
  1636.  
  1637.      Elvis  has  two  options  which  affect the way regular
  1638. expressions are used.  These options may be examined or  set
  1639. via the :set command.
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650. 4-4                  REGULAR EXPRESSIONS                 4-4
  1651.  
  1652.  
  1653.      The  first  option  is  called  "[no]magic".  This is a
  1654. boolean option, and it is "magic" (TRUE) by default.   While
  1655. in   magic  mode,  all  of  the  meta-characters  behave  as
  1656. described above.  In nomagic mode, only ^ and $ retain their
  1657. special meaning.
  1658.  
  1659.      The  second option is called "[no]ignorecase".  This is
  1660. a boolean  option,  and  it  is  "noignorecase"  (FALSE)  by
  1661. default.   While in ignorecase mode, the searching mechanism
  1662. will not distinguish between an  uppercase  letter  and  its
  1663. lowercase  form.  In noignorecase mode, uppercase and lower-
  1664. case are treated as being different.
  1665.  
  1666.      Also, the "[no]wrapscan" option affects searches.
  1667.  
  1668.  
  1669. Examples
  1670.  
  1671.      This example changes every occurrence of  "utilize"  to
  1672. "use":
  1673.  
  1674.           :%s/utilize/use/g
  1675.  
  1676.      This  example deletes all whitespace that occurs at the
  1677. end of a line anywhere in the file.  (The brackets contain a
  1678. single space and a single tab.):
  1679.  
  1680.           :%s/[   ]\+$//
  1681.  
  1682.      This example converts the current line to uppercase:
  1683.  
  1684.           :s/.*/\U&/
  1685.  
  1686.      This  example  underlines  each  letter  in the current
  1687. line, by changing it into an "underscore  backspace  letter"
  1688. sequence.  (The ^H is entered as "control-V backspace".):
  1689.  
  1690.           :s/[a-zA-Z]/_^H&/g
  1691.  
  1692.      This  example  locates  the  last  colon in a line, and
  1693. swaps the text before the colon  with  the  text  after  the
  1694. colon.   The  first  \( \) pair is used to delimit the stuff
  1695. before the colon, and the  second  pair  delimit  the  stuff
  1696. after.   In  the  substitution  text, \1 and \2 are given in
  1697. reverse order to perform the swap:
  1698.  
  1699.           :s/\(.*\):\(.*\)/\2:\1/
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719. 5.  OPTIONS
  1720.  
  1721.      Options  may  be  set or examined via the colon command
  1722. "set".  The values of options will affect the  operation  of
  1723. later commands.
  1724.  
  1725.      For  convenience,  options have both a long descriptive
  1726. name and a short name which is easy to type.   You  may  use
  1727. either  name  interchangeably.   I  like  the  short  names,
  1728. myself.
  1729.  
  1730.      There are three types of options: Boolean, string,  and
  1731. numeric.   Boolean  options are made TRUE by giving the name
  1732. of the option as an argument to the "set" command; they  are
  1733. made  FALSE  by  prefixing the name with "no".  For example,
  1734. "set autoindent" makes the autoindent option TRUE, and  "set
  1735. noautoindent"  makes  it  FALSE.   Elvis also allows boolean
  1736. options to be toggled by prefixing the name with "neg".  So,
  1737. ":map  g  :set  neglist^M"  will cause the <g> key to alter-
  1738. nately toggle the "list" option on and off.  (The "neg" pre-
  1739. fix is an extension; the real vi doesn't support it.)
  1740.  
  1741.      To change the value of a string or numeric option, pass
  1742. the "set" command the name of the option, followed by an "="
  1743. sign  and  the  option's  new value.  For example, "set tab-
  1744. stop=8" will give the tabstop option  a  value  of  8.   For
  1745. string options, you may enclose the new value in quotes.
  1746.  
  1747. NAMES              TYPE DEFAULT       MEANING
  1748. autoindent, ai     Bool noai          auto-indent during input
  1749. autoprint, ap      Bool ap            in EX, print the current line
  1750. autotab, at        Bool at            auto-indent allowed to use tabs?
  1751. autowrite, aw      Bool noaw          auto-write when switching files
  1752. beautify,  bf      Bool nobf          strip control chars from file?
  1753. charattr, ca       Bool noca          interpret \fX sequences?
  1754. cc, cc             Str  cc="cc -c"    name of the C compiler
  1755. columns, co        Num  co=80         width of the screen
  1756. digraph, dig       Bool nodig         recognize digraphs?
  1757. directory, dir     Str  dir="/usr/tmp"where tmp files are kept
  1758. edcompatible, ed   Bool noed          remember ":s//" options
  1759. equalprg, ep       Bool ep="fmt"      program to run for = operator
  1760. errorbells, eb     Bool eb            ring bell on error
  1761. exrc, exrc         Bool noexrc        read "./.exrc" file?
  1762. exrefresh, er      Bool er            write lines individually in EX
  1763. flash, vbell       Bool flash         use visible alternative to bell
  1764. flipcase, fc       Str  fc=""         non-ASCII chars flipped by ~
  1765. hideformat, hf     Bool hf            hide text formatter commands
  1766. ignorecase, ic     Bool noic          upper/lowercase match in search
  1767. inputmode, im      Bool noim          start vi in insert mode?
  1768. keepanon, ka       Bool noka          keep anonymous buffers?
  1769. keytime, kt        Num  kt=2          timeout for mapped key entry
  1770. keywordprg, kp     Str  kp="ref"      full pathname of shift-K prog
  1771. lines, ln          Num  ln=25         number of lines on the screen
  1772. list, li           Bool noli          display lines in "list" mode
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782. 5-2                        OPTIONS                       5-2
  1783.  
  1784.  
  1785. magic, ma          Bool ma            use regular expression in search
  1786. make, mk           Str  mk="make"     name of the "make" program
  1787. mesg, ms           Bool ms            allow messages from other users?
  1788. modelines, ml      Bool noml          are modelines processed?
  1789. more, more         Bool more          pause between messages?
  1790. nearscroll, ns     Num  ns=15         when to scroll vs. redraw
  1791. newfile, new       BOOL nonew         is current file new?
  1792. novice, nov        Bool nonovice      set options for ease of use
  1793. number, nu         Bool nonumber      show line numbers
  1794. paragraphs, para   Str  para="PPppIPLPQP"names of "paragraph" nroff cmd
  1795. prompt, pr         Bool pr            show ':' prompt in ex mode
  1796. readonly, ro       Bool noro          prevent overwriting of orig file
  1797. remap, rem         Bool remap         allow key maps to call key maps
  1798. report, re         Num  re=5          report when 5 or more changes
  1799. ruler, ru          Bool noru          display line/column numbers
  1800. scroll, sc         Num  sc=12         scroll amount for ^U and ^D
  1801. sections, sect     Str  sect="NHSHSSSEse"names of "section" nroff cmd
  1802. shell, sh          Str  sh="/bin/sh"  full pathname of the shell
  1803. showmatch, sm      Bool nosm          show matching ()[]{}
  1804. showmode, smd      Bool nosmd         say when we're in input mode
  1805. shiftwidth, sw     Num  sw=8          shift amount for < and >
  1806. sidescroll, ss     Num  ss=8          amount of sideways scrolling
  1807. sync, sy           Bool nosy          call sync() often
  1808. tabstop, ts        Num  ts=8          width of tab characters
  1809. taglength, tl      Num  tl=0          significant chars in tag name
  1810. tags, tag          Str  tags="tags" list of tags files
  1811. tagstack, tgs      Bool tgs           enable tagstack?
  1812. term, te           Str  te="$TERM"    name of the termcap entry
  1813. terse, tr          Bool notr          give shorter error messages
  1814. timeout, to        Bool to            distinguish <esc> from <arrow>?
  1815. warn, wa           Bool wa            warn for ! if file modified
  1816. window, wi         Num  wi=24         lines to redraw after long move
  1817. wrapmargin, wm     Num  wm=0          wrap long lines in input mode
  1818. wrapscan, ws       Bool ws            at EOF, searches wrap to line 1
  1819. writeany, wr       Bool nowr          allow :w to clobber files
  1820.  
  1821.  
  1822. autoindent, ai
  1823.      During  input  mode,  the  autoindent option will cause
  1824.      each added line to begin with the same amount of  lead-
  1825.      ing  whitespace  as the line above it.  Without autoin-
  1826.      dent, added lines are initially empty.
  1827.  
  1828. autoprint, ap
  1829.      This option only affects EX  mode.   If  the  autoprint
  1830.      option on, and either the cursor has moved to a differ-
  1831.      ent line or the previous  command  modified  the  file,
  1832.      then Elvis will print the current line.
  1833.  
  1834. autotab, at
  1835.      This  option  affects  the  behavior  of the autoindent
  1836.      mode.  If autoindent is turned off, then autotab has no
  1837.      effect.
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848. 5-3                        OPTIONS                       5-3
  1849.  
  1850.  
  1851.      When  autotab is turned on, elvis will use a mixture of
  1852.      spaces and tabs to create the proper amount of indenta-
  1853.      tion.  This is the default.
  1854.  
  1855.      When  autotab is turned off, elvis will only use spaces
  1856.      for auto-indent.  Elvis will still insert  a  real  tab
  1857.      character  when  you  hit  the  <Tab>  key, though; the
  1858.      autotab option only affects automatic indentation.
  1859.  
  1860. autowrite, aw
  1861.      When you're editing one file and decide  to  switch  to
  1862.      another  - via the :tag command, or :next command, per-
  1863.      haps - if your current file  has  been  modified,  then
  1864.      Elvis  will  normally print an error message and refuse
  1865.      to switch.
  1866.  
  1867.      However, if the autowrite option is on, then Elvis will
  1868.      write the modified version of the current file and suc-
  1869.      cessfully switch to the new file.
  1870.  
  1871. beautify, bf
  1872.      This option causes all control characters to be deleted
  1873.      from  the text file, at the time when you start editing
  1874.      it.  If you're already editing a file when you turn  on
  1875.      the  beautify option, then that file won't be affected.
  1876.  
  1877. cc   The :cc command  runs  the  C  compiler.   This  option
  1878.      should be set to the name of your compiler.
  1879.  
  1880. charattr, ca
  1881.      Many  text  formatting  programs allow you to designate
  1882.      portions of your text to be underlined, italicized,  or
  1883.      boldface by embedding the special strings \fU, \fI, and
  1884.      \fB in your text.  The special string \fP marks the end
  1885.      of underlined or boldface text.
  1886.  
  1887.      Elvis  normally  treats those special strings just like
  1888.      any other text.
  1889.  
  1890.      However, if the charattr option is on, then Elvis  will
  1891.      interpret  those  special strings correctly, to display
  1892.      underlined or boldface text on the screen.  (This  only
  1893.      works,  of  course, if your terminal can display under-
  1894.      lined and boldface, and if the TERMCAP entry  says  how
  1895.      to do it.)
  1896.  
  1897. columns, co
  1898.      This option shows how wide your screen is.
  1899.  
  1900. digraph, dig
  1901.      This  option  is  used to enable/disable recognition of
  1902.      digraphs.  The default value is nodigraph, which  means
  1903.      that digraphs will not be recognized.
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914. 5-4                        OPTIONS                       5-4
  1915.  
  1916.  
  1917. directory, dir
  1918.      Elvis  stores  text  in  temporary  files.  This option
  1919.      allows you to control which directory  those  temporary
  1920.      files will appear in.  The default is /usr/tmp.
  1921.  
  1922.      This  option  can  only  be  set in a .exrc file; after
  1923.      that, Elvis will have already started making  temporary
  1924.      files in some other directory, so it would be too late.
  1925.  
  1926. edcompatible, ed
  1927.      This   option   affects    the    behavior    of    the
  1928.      ":s/regexp/text/options"  command.   It is normally off
  1929.      (:se noed) which causes all of the substitution options
  1930.      to be off unless explicitly given.
  1931.  
  1932.      However,  with  edcompatible on (:se ed), the substitu-
  1933.      tion command remembers  which  options  you  used  last
  1934.      time.   Those  same  options  will  continue to be used
  1935.      until you change them.  In edcompatible mode, when  you
  1936.      explicitly  give the name of a substitution option, you
  1937.      will toggle the state of that option.
  1938.  
  1939.      This all seems very strange to me, but its  implementa-
  1940.      tion  was  almost free when I added the ":&" command to
  1941.      repeat the previous substitution, so there it is.
  1942.  
  1943. equalprg, ep
  1944.      This holds the name & arguments of the external  filter
  1945.      program  used  the  the visual = operator.  The default
  1946.      value is "fmt", so the  =  operator  will  adjust  line
  1947.      breaks in text.
  1948.  
  1949. errorbells, eb
  1950.      Elvis  normally  rings  a  bell  when  you do something
  1951.      wrong.  This option lets you disable the bell.
  1952.  
  1953. exrc This option specifies whether a .exrc file in the  cur-
  1954.      rent  directory  should  be executed.  By default, this
  1955.      option is off (":set noexrc") which prevents elvis from
  1956.      executing .exrc in the current directory.  If the .exrc
  1957.      file in your home directory turns this option on (":set
  1958.      exrc") then the Elvis will attempt to execute the .exrc
  1959.      file in the current directory.
  1960.  
  1961.      This option exist mainly for security reasons.  A mean-
  1962.      spirited person could do something like
  1963.           echo >/tmp/.exrc '!rm -rf $HOME'
  1964.      and  then  anybody who attempted to edit or view a file
  1965.      in the /tmp directory would lose most of  their  files.
  1966.      With  the  exrc option turned off, this couldn't happen
  1967.      to you.
  1968.  
  1969. exrefresh, er
  1970.      The EX mode of Elvis writes many lines to  the  screen.
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980. 5-5                        OPTIONS                       5-5
  1981.  
  1982.  
  1983.      You can make Elvis either write each line to the screen
  1984.      separately, or save up many lines and write them all at
  1985.      once.
  1986.  
  1987.      The  exrefresh  option  is normally on, so each line is
  1988.      written to the screen separately.
  1989.  
  1990.      You may wish to turn  the  exrefresh  option  off  (:se
  1991.      noer)  if  the  "write"  system  call is costly on your
  1992.      machine, or if you're using  a  windowing  environment.
  1993.      (Windowing  environments  scroll text a lot faster when
  1994.      you write many lines at once.)
  1995.  
  1996.      This option has no effect in  visual  command  mode  or
  1997.      input mode.
  1998.  
  1999. flash, vbell
  2000.      If  your  termcap entry describes a visible alternative
  2001.      to ringing your terminal's bell, then this option  will
  2002.      say whether the visible version gets used or not.  Nor-
  2003.      mally it will be.
  2004.  
  2005.      If your termcap does NOT include a visible  bell  capa-
  2006.      bility,  then  the  flash  option  will be off, and you
  2007.      can't turn it on.
  2008.  
  2009. flipcase, fc
  2010.      The flipcase option allows you to control how the  non-
  2011.      ASCII characters are altered by the "~" command.
  2012.  
  2013.      The  string  is divided into pairs of characters.  When
  2014.      "~" is applied to a non-ASCII character, Elvis looks up
  2015.      the  character in the flipcase string to see which pair
  2016.      it's in, and replaces it by the other character of  the
  2017.      pair.
  2018.  
  2019. hideformat, hf
  2020.      Many  text  formatters require you to embed format com-
  2021.      mands in your text, on lines  that  start  with  a  "."
  2022.      character.   Elvis  normally  displays these lines like
  2023.      any other text, but if the  hideformat  option  is  on,
  2024.      then format lines are displayed as blank lines.
  2025.  
  2026. ignorecase, ic
  2027.      Normally,  when  Elvis  searches  for  text,  it treats
  2028.      uppercase letters as being different for lowercase let-
  2029.      ters.
  2030.  
  2031.      When  the ignorecase option is on, uppercase and lower-
  2032.      case are treated as equal.
  2033.  
  2034. inputmode, im
  2035.      This option allows you to have Elvis start up in insert
  2036.      mode.   You  can  still exit insert mode at any time by
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046. 5-6                        OPTIONS                       5-6
  2047.  
  2048.  
  2049.      hitting the ESC key, as usual.   Usually,  this  option
  2050.      would be set in your ".exrc" file.
  2051.  
  2052. keytime, kt
  2053.      The arrow keys of most terminals send a multi-character
  2054.      sequence.  It takes a measurable  amount  of  time  for
  2055.      these  sequences to be transmitted.  The keytime option
  2056.      allows you to control the maximum  amount  of  time  to
  2057.      allow  for  an  arrow  key  (or other mapped key) to be
  2058.      received in full.
  2059.  
  2060.      On most systems, the setting is the number of tenths of
  2061.      a  second  to  allow between characters.  On some other
  2062.      systems, the setting is in whole seconds.
  2063.  
  2064.      Try to avoid  setting  keytime=1.   Most  systems  just
  2065.      count  clock beats, so if you tried to read a character
  2066.      shortly before a clock beat, you could allow almost  no
  2067.      time  at  all  for  reading the characters.  For higher
  2068.      keytime settings, the difference is less critical.
  2069.  
  2070.      If your system's response time is poor, you might  want
  2071.      to  increase  the  keytime.   In particular, I've found
  2072.      that when keystrokes must be  sent  through  a  network
  2073.      (via  X  windows,  rlogin,  or telnet, for example) the
  2074.      keytime should be set to at least 1 second.
  2075.  
  2076.      As a special case, you can set keytime to 0 to  disable
  2077.      this time limit stuff altogether.  The big problem here
  2078.      is: If your arrow keys' sequences start  with  an  ESC,
  2079.      then every time you hit your ESC key Elvis will wait...
  2080.      and wait...  to see if maybe that ESC was  part  of  an
  2081.      arrow key's sequence.
  2082.  
  2083.      NOTE:  this  option  is a generalization of the timeout
  2084.      option of the real vi.
  2085.  
  2086. keepanon, ka
  2087.      Normally, Elvis (and the real vi) discard the  contents
  2088.      of  the  anonymous cut buffers whenever you switch from
  2089.      one file to another, but retain  the  contents  of  the
  2090.      named  cut  buffers.   Setting  this  option will cause
  2091.      Elvis to keep all cut buffers when you switch files.
  2092.  
  2093. keywordprg, kp
  2094.      Elvis has a special keyword lookup feature.   You  move
  2095.      the cursor onto a word, and hit shift-K, and Elvis uses
  2096.      another program to look up the word and display  infor-
  2097.      mation about it.
  2098.  
  2099.      This option says which program gets run.
  2100.  
  2101.      The  default  value of this option is "ref", which is a
  2102.      program that looks up the definition of a  function  in
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112. 5-7                        OPTIONS                       5-7
  2113.  
  2114.  
  2115.      C.   It  looks  up  the  function name in a file called
  2116.      "refs" which is created by ctags.
  2117.  
  2118.      You can substitute other programs, such as  an  English
  2119.      dictionary  program  or  the online manual.  Elvis runs
  2120.      the program, using the keyword as  its  only  argument.
  2121.      The  program  should  write information to stdout.  The
  2122.      program's exit status should  be  0,  unless  you  want
  2123.      Elvis to print "<<< failed >>>".
  2124.  
  2125. lines, ln
  2126.      This option says how many lines you screen has.
  2127.  
  2128. list, li
  2129.      In  nolist mode (the default), Elvis displays text in a
  2130.      "normal" manner -- with tabs expanded to an appropriate
  2131.      number of spaces, etc.
  2132.  
  2133.      However,  sometimes it is useful to have tab characters
  2134.      displayed differently.  In list  mode,  tabs  are  dis-
  2135.      played  as  "^I",  and a "$" is displayed at the end of
  2136.      each line.
  2137.  
  2138. magic, ma
  2139.      The search  mechanism  in  Elvis  can  accept  "regular
  2140.      expressions"  --  strings  in  which certain characters
  2141.      have special meaning.
  2142.  
  2143.      The magic option is normally  on,  which  causes  these
  2144.      characters to be treated specially.
  2145.  
  2146.      If  you  turn the magic option off (:se noma), then all
  2147.      characters except ^ and $ are treated literally.  ^ and
  2148.      $  retain their special meanings regardless of the set-
  2149.      ting of magic.
  2150.  
  2151. make, mk
  2152.      The :make  command  runs  your  "make"  program.   This
  2153.      option defines the name of your "make" program.
  2154.  
  2155. mesg With  the  real  vi,  running  under  real  UNIX, ":set
  2156.      nomesg" would prevent other users from sending you mes-
  2157.      sages.  Elvis ignores it, though.
  2158.  
  2159. modelines, ml
  2160.      Elvis supports modelines.  Modelines are lines near the
  2161.      beginning or  end  of  your  text  file  which  contain
  2162.      "ex:yowza:",  where "yowza" is any EX command.  A typi-
  2163.      cal "yowza"  would  be  something  like  "set  ts=5  ca
  2164.      kp=spell wm=15".  Other text may also appear on a mode-
  2165.      line, so you can place the "ex:yowza:" in a comment:
  2166.  
  2167.           /* ex:set sw=4 ai: */
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178. 5-8                        OPTIONS                       5-8
  2179.  
  2180.  
  2181.      Normally these lines are ignored, for security reasons,
  2182.      but if you have "set modelines" in your .exrc file then
  2183.      "yowza" is executed.
  2184.  
  2185. nearscroll, ns
  2186.      The line that contains the cursor will always be on the
  2187.      screen.  If you move the cursor to a line that isn't on
  2188.      the screen, then elvis will either scroll (if the  cur-
  2189.      sor's  line  is nearly on the screen already) or redraw
  2190.      the screen completely with the cursor's  line  centered
  2191.      (if the cursor line is not near the screen already).
  2192.  
  2193.      This  option  allows  you  to  control  elvis'  idea of
  2194.      "near".  A value of 15 is typical.  A value of 1  would
  2195.      cause  elvis  to scroll no more that one line.  A value
  2196.      of 0 disables scrolling.
  2197.  
  2198. newfile, new
  2199.      The "newfile" option is an unsettable  boolean  option.
  2200.      Its  value is automatically set to FALSE when you start
  2201.      editing a file that already exists, or TRUE if the file
  2202.      doesn't  exist  yet.   This can be handy in ".exfilerc"
  2203.      initialization files.
  2204.  
  2205. novice, nov
  2206.      The  command  ":set  novice"  is  equivalent  to  ":set
  2207.      nomagic report=1 showmode".
  2208.  
  2209. number, nu
  2210.      The  "number"  option causes Elvis to display line num-
  2211.      bers at the start of each line.  The  numbers  are  not
  2212.      actually  part  of  the  text; when the file is written
  2213.      out, it will be written without line numbers.
  2214.  
  2215. paragraphs, pa
  2216.      The { and } commands move the cursor forward  or  back-
  2217.      ward in increments of one paragraph.  Paragraphs may be
  2218.      separated by blank lines, or by a "dot"  command  of  a
  2219.      text  formatter.  Different text formatters use differ-
  2220.      ent "dot" commands.  This option allows you to  config-
  2221.      ure Elvis to work with your text formatter.
  2222.  
  2223.      It  is  assumed  that your formatter uses commands that
  2224.      start with a "." character at the front of a line,  and
  2225.      then have a one- or two-character command name.
  2226.  
  2227.      The value of the paragraphs option is a string in which
  2228.      each pair of characters is one possible  form  of  your
  2229.      text formatter's paragraph command.
  2230.  
  2231. more When  Elvis  must display a sequence of messages at the
  2232.      bottom line of the screen in visual mode,  it  normally
  2233.      pauses  after all but the last one, so you have time to
  2234.      read them all.
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244. 5-9                        OPTIONS                       5-9
  2245.  
  2246.  
  2247.      If you turn off the "more" option, then Elvis will  not
  2248.      pause.   This means you can only read the last message,
  2249.      but it is usually the most important one anyway.
  2250.  
  2251. prompt, pr
  2252.      If you ":set noprompt", then Elvis will no longer  emit
  2253.      a  ':'  when  it  expects you to type in an ex command.
  2254.      This is slightly useful if you're  using  an  astonish-
  2255.      ingly  slow  UNIX  machine, but the rest of us can just
  2256.      ignore this one.
  2257.  
  2258. readonly, ro
  2259.      Normally, Elvis will let you write  back  any  file  to
  2260.      which  you  have  write  permission.  If you don't have
  2261.      write permission, then you can only write  the  changed
  2262.      version of the file to a different file.
  2263.  
  2264.      If you set the readonly option, then Elvis will pretend
  2265.      you don't have write permission to any file  you  edit.
  2266.      It  is useful when you really only mean to use Elvis to
  2267.      look at a file, not to change it.  This way  you  can't
  2268.      change it accidentally.
  2269.  
  2270.      This  option is normally off, unless you use the "view"
  2271.      alias of Elvis.  "View" is like "vi"  except  that  the
  2272.      readonly option is on.
  2273.  
  2274. remap
  2275.      The  ":map"  command  allows  you  to  convert  one key
  2276.      sequence into another.  The remap option allows you  to
  2277.      specify  what  should  happen if portions of that other
  2278.      sequence are also in the map table.  If  remap  is  on,
  2279.      then  those  portions  will  also be mapped, just as if
  2280.      they had been typed on the keyboard.  If remap is  off,
  2281.      then the matching portions will not be mapped.
  2282.  
  2283.      For  example,  if you enter the commands ":map A B" and
  2284.      ":map B C", then when remap is on, A will be  converted
  2285.      to  C.  But when remap is off, A will be converted only
  2286.      to B.
  2287.  
  2288. report, re
  2289.      Commands in Elvis may affect many lines.  For  commands
  2290.      that affect a lot of lines, Elvis will output a message
  2291.      saying what was done and how many lines were  affected.
  2292.      This  option allows you to define what "a lot of lines"
  2293.      means.  The default is 5, so any command which  affects
  2294.      5 or more lines will cause a message to be shown.
  2295.  
  2296. ruler, ru
  2297.      This  option  is normally off.  If you turn it on, then
  2298.      Elvis will constantly display the  line/column  numbers
  2299.      of the cursor, at the bottom of the screen.
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310. 5-10                       OPTIONS                      5-10
  2311.  
  2312.  
  2313. scroll, sc
  2314.      The  ^U and ^D keys normally scroll backward or forward
  2315.      by half a screenful, but this is adjustable.  The value
  2316.      of  this  option  says how many lines those keys should
  2317.      scroll by.  If you invoke ^U or ^D with a  count  argu-
  2318.      ment  (for example, "33^D") then this option's value is
  2319.      set to the count.
  2320.  
  2321. sections, se
  2322.      The [[ and ]] commands move the cursor backward or for-
  2323.      ward  in  increments  of  1  section.   Sections may be
  2324.      delimited by a { character in column 1 (which is useful
  2325.      for  C  source  code) or by means of a text formatter's
  2326.      "dot" commands.
  2327.  
  2328.      This option allows you to configure Elvis to work  with
  2329.      your text formatter's "section" command, in exactly the
  2330.      same way that the paragraphs option makes it work  with
  2331.      the formatter's "paragraphs" command.
  2332.  
  2333. shell, sh
  2334.      When  Elvis forks a shell (perhaps for the :! or :shell
  2335.      commands) this is the program that is uses as a  shell.
  2336.      This  is  "/bin/sh" by default, unless you have set the
  2337.      SHELL (or COMSPEC, for MS-DOS) environment variable, it
  2338.      which  case  the default value is copied from the envi-
  2339.      ronment.
  2340.  
  2341. shiftwidth, sw
  2342.      The < and > commands shift text left or right  by  some
  2343.      uniform  number  of  columns.   The  shiftwidth  option
  2344.      defines that "uniform number".  The default is 8.
  2345.  
  2346. showmatch, sm
  2347.      With showmatch set, in input mode every  time  you  hit
  2348.      one  of  )}], Elvis will momentarily move the cursor to
  2349.      the matching ({[.
  2350.  
  2351. showmode, smd
  2352.      In visual mode, it is easy to forget whether you're  in
  2353.      the  visual  command  mode or input/replace mode.  Nor-
  2354.      mally, the showmode option is off, and  you  haven't  a
  2355.      clue as to which mode you're in.  If you turn the show-
  2356.      mode option on, though, a little message will appear in
  2357.      the lower right-hand corner of your screen, telling you
  2358.      which mode you're in.
  2359.  
  2360. sidescroll, ss
  2361.      For long lines, Elvis scrolls sideways.  (This is  dif-
  2362.      ferent from the real vi, which wraps a single long line
  2363.      onto several rows of the screen.)
  2364.  
  2365.      To minimize the number of scrolls needed,  Elvis  moves
  2366.      the  screen  sideways  by several characters at a time.
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376. 5-11                       OPTIONS                      5-11
  2377.  
  2378.  
  2379.      The value of this  option  says  how  many  characters'
  2380.      widths to scroll at a time.
  2381.  
  2382.      Generally,  the  faster your screen can be redrawn, the
  2383.      lower the value you will want in this option.
  2384.  
  2385. sync, sy
  2386.      If the system crashes during an edit session, then most
  2387.      of  your  work can be recovered from the temporary file
  2388.      that Elvis uses to store changes.   However,  sometimes
  2389.      the  OS  will not copy changes to the hard disk immedi-
  2390.      ately, so recovery might not be possible.  The [no]sync
  2391.      option lets you control this.
  2392.  
  2393.      In  nosync mode (which is the default, for UNIX), Elvis
  2394.      lets the operating system control when data is  written
  2395.      to the disk.  This is generally faster.
  2396.  
  2397.      In  sync  mode (which is the default for MS-DOS, Amiga-
  2398.      Dos, and Atari TOS), Elvis forces all  changes  out  to
  2399.      disk  every  time you make a change.  This is generally
  2400.      safer, but slower.  It can also be a rather rude  thing
  2401.      to do on a multi-user system.
  2402.  
  2403. tabstop, ts
  2404.      Tab  characters are normally 8 characters wide, but you
  2405.      can change their widths by means of this option.
  2406.  
  2407. taglength, tl
  2408.      This option allows you to specify how  many  characters
  2409.      of  a tag's name must match when performing tag lookup.
  2410.      As a special case, ":set taglength=0"  means  that  all
  2411.      characters of a tag's name must match.
  2412.  
  2413.      Note:  some  configurations of Elvis don't support this
  2414.      option.
  2415.  
  2416. tags, tag
  2417.      If your version of  elvis  is  compiled  with  -DINTER-
  2418.      NAL_TAGS,  then  this is a space-delimited list of tags
  2419.      files.  When you tell  elvis  to  look  up  a  tag,  it
  2420.      searches  though  each  file in turn until it finds the
  2421.      tag.
  2422.  
  2423.      If your version of elvis is compiled  without  -DINTER-
  2424.      NAL_TAGS,  then  you can achieve the same effect via an
  2425.      environment variable called TAGPATH.   TAGPATH's  value
  2426.      is  a  colon-delimited list of file or directory names.
  2427.      (For some operating systems, including MS-DOS, the list
  2428.      is delimited by semicolons instead of colons.)
  2429.  
  2430. tagstack
  2431.      This  option  allows  you  to  disable the tagstack.  I
  2432.      can't think of any reason why  you  would  want  to  do
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442. 5-12                       OPTIONS                      5-12
  2443.  
  2444.  
  2445.      that.
  2446.  
  2447. term, te
  2448.      This  read-only  option  shows  the name of the termcap
  2449.      entry that Elvis is using for your terminal.
  2450.  
  2451. terse, tr
  2452.      The real vi uses  this  option  to  select  longer  vs.
  2453.      shorter  error  messages.   Elvis  has  only one set of
  2454.      error messages, though, so this option has no effect.
  2455.  
  2456. timeout, to
  2457.      The command ":set notimeout"  is  equivalent  to  ":set
  2458.      keytime=0",  and  ":set timeout" is equivalent to ":set
  2459.      keytime=1".  This affects the  behavior  of  the  <Esc>
  2460.      key.   See  the  discussion of the "keytime" option for
  2461.      more information.
  2462.  
  2463. warn, wa
  2464.      If you have modified a file but not yet written it back
  2465.      to  disk,  then  Elvis  will  normally  print a warning
  2466.      before executing a ":!cmd" command.  However, in nowarn
  2467.      mode, this warning is not given.
  2468.  
  2469.      Elvis also normally prints a message after a successful
  2470.      search that wrapped at EOF.  The  [no]warn  option  can
  2471.      also disable this warning.
  2472.  
  2473. window, wi
  2474.      This option controls how many lines are redrawn after a
  2475.      long move.
  2476.  
  2477.      On fast terminals, this is usually set to the number of
  2478.      rows  that  the  terminal can display, minus one.  This
  2479.      causes the entire screen to be filled with text  around
  2480.      the cursor.
  2481.  
  2482.      On slow terminals, you may wish to reduce this value to
  2483.      about 7 or so.  That way,  if  you're  doing  something
  2484.      like  repeatedly  hitting 'n' to search for each occur-
  2485.      rence of some string and trying to  find  a  particular
  2486.      occurrence,  then  you  don't  need to wait as long for
  2487.      Elvis to redraw the screen after each search.
  2488.  
  2489. wrapmargin, wm
  2490.      Normally (with wrapmargin=0) Elvis will let you type in
  2491.      extremely long lines, if you wish.
  2492.  
  2493.      However,  with warpmargin set to something other that 0
  2494.      (wrapmargin=10 is nice), Elvis will automatically cause
  2495.      long  lines  to  be "wrapped" on a word break for lines
  2496.      come too close to the right-hand margin.  For  example:
  2497.      On  an  80-column screen, ":set wm=10" will cause lines
  2498.      to wrap when their length exceeds 70 columns.
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508. 5-13                       OPTIONS                      5-13
  2509.  
  2510.  
  2511. wrapscan, ws
  2512.      Normally, when you search  for  something,  Elvis  will
  2513.      find  it  no  matter  where  it  is in the file.  Elvis
  2514.      starts at the cursor position,  and  searches  forward.
  2515.      If  Elvis  hits EOF without finding what you're looking
  2516.      for, then it wraps around to  continue  searching  from
  2517.      line  1.   If  you  turn  off  the wrapscan option (:se
  2518.      nows), then when Elvis hits EOF  during  a  search,  it
  2519.      will stop and say so.
  2520.  
  2521. writeany, wr
  2522.      With "writeany" turned off, elvis will prevent you from
  2523.      accidentally overwriting a file.  For example, if "foo"
  2524.      exists  then  ":w  foo"  will fail.  If you turn on the
  2525.      "writeany" option, then ":w foo" will work.
  2526.  
  2527.      Regardless of the setting of "writeany",  though,  ":w!
  2528.      foo"  will  work.   The  '!' forces the ":w" command to
  2529.      write the file unless the operating system won't  allow
  2530.      it.
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577. 6.  INITIALIZATION
  2578.  
  2579.      Many  features  of  Elvis  are configurable at runtime.
  2580. There are commands for assigning  actions  to  keys  (:map),
  2581. defining  abbreviations  (:abbr), non-ASCII keying sequences
  2582. (:digraph), setting screen colors  (:color),  and  miscella-
  2583. neous other options (:set).
  2584.  
  2585.      All  of  these  commands  can  be issued interactively.
  2586. Experienced vi users generally prefer to have  some  options
  2587. set  every  time  they run they execute Elvis, and Elvis has
  2588. ways to support this.
  2589.  
  2590.  
  2591. Start-up Initialization
  2592.  
  2593.      When Elvis starts, it executes the following  algorithm
  2594. in an attempt to locate initialization commands:
  2595.  
  2596.  
  2597.      If this version of Elvis supports a system-wide initialization
  2598.      file and that file exists,
  2599.          Interpret that file's contents as a series of "ex" commands
  2600.  
  2601.      If the EXINIT environment variable is set
  2602.          Interpret the value of EXINIT as an "ex" command line.
  2603.      Else if the home directory contains a file named ".exrc"
  2604.          Interpret that file's contents as a series of "ex" commands
  2605.  
  2606.      If the "exrc" option is set, and the current directory contains
  2607.      a file named ".exrc"
  2608.          Interpret that file's contents as a series of "ex" commands
  2609.  
  2610.      If a tag was specified via a "-t" command line argument,
  2611.          Execute a tag look-up, and load file if successful
  2612.  
  2613.      If no tag was specified, or the specified tag wasn't found,
  2614.          Load the first file named on the command line, or
  2615.          start empty buffer.
  2616.  
  2617.      If a command was specified via "+command" or "-c command"
  2618.          Execute the given command.
  2619.  
  2620.  
  2621.      Note that most of this initialization occurs before the
  2622. first file is loaded.  Consequently, commands which  examine
  2623. or  change the edit buffer can't be used there.  Only "+com-
  2624. mand" or "-c command" is executed after the  text  file  has
  2625. been loaded.
  2626.  
  2627.      On  non-UNIX  systems,  ".exrc"  is  usually an invalid
  2628. filename so the file is called  "ELVIS.RC"  instead.   Also,
  2629. the  home directory is the directory named by the HOME envi-
  2630. ronment variable; on DOS and a few other systems, if HOME is
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640. 6-2                    INITIALIZATION                    6-2
  2641.  
  2642.  
  2643. unset  then  Elvis will use the directory which contains the
  2644. executable file (ELVIS.EXE) as your home directory.
  2645.  
  2646.  
  2647. File Initialization
  2648.  
  2649.      Loading a file, too, can cause commands to be executed.
  2650. Each  time any file is loaded into the edit buffer, the fol-
  2651. lowing algorithm is used to locate file-specific initializa-
  2652. tion commands.
  2653.  
  2654.  
  2655.      Fill the edit buffer with the file's contents, and set various options
  2656.      and variables accordingly.
  2657.  
  2658.      If the home directory contains a file involves  named ".exfilerc"
  2659.          Interpret the contents of that file as a series of "ex" commands.
  2660.  
  2661.      If the "modelines" option is set,
  2662.          Search the first 5 & last 5 lines of the text for lines which
  2663.          contain "ex:<command>:" or "vi:<command>:", and interpret any
  2664.          <command> as an "ex" command line.
  2665.  
  2666.  
  2667.      On  non-UNIX systems, ".exfilerc" is usually an invalid
  2668. filename, so the file is called "EXFILE.RC" instead.
  2669.  
  2670.  
  2671. The :mkexrc Command
  2672.  
  2673.      Elvis has a special command, ":mkexrc  [filename]",  to
  2674. help you create ".exrc" files.  It creates a file which sets
  2675. all nonstandard options, maps, and so on.
  2676.  
  2677.      By default, the created file's name will be ".exrc"  in
  2678. the  current  directory.   You can either add ":set exrc" to
  2679. the .exrc file in your home directory to force Elvis to read
  2680. this  new  .exrc  in your current directory, or you can move
  2681. this new .exrc file into your home directory.
  2682.  
  2683.      Alternatively, you can supply an explicit  filename  as
  2684. an argument to :mkexrc.
  2685.  
  2686.      Afterward,  you may wish to edit the created file.  For
  2687. example, some options may be conditional; the  :mkexrc  file
  2688. doesn't  distinguish between options which were set uncondi-
  2689. tionally from those that were set in a text file's modelines
  2690. or other conditional context.
  2691.  
  2692.      Warning: the :mkexrc command will happily overwrite any
  2693. file that you tell it to, if your operating system  permits.
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706. 6-3                    INITIALIZATION                    6-3
  2707.  
  2708.  
  2709. Other Techniques
  2710.  
  2711.      Elvis  has  commands for conditional execution, but the
  2712. standard vi doesn't.  If you often use the real vi, you  may
  2713. want  to  avoid  Elvis's  extensions.   To  have a terminal-
  2714. dependent   initialization   file,   you   can   add    ":so
  2715. $HOME/.exrc.$TERM"  to  the end of your .exrc file, and then
  2716. create files with names like ".exrc.vt100" and  ".exrc.ansi"
  2717. in  your home directory which contain the terminal-dependent
  2718. commands.
  2719.  
  2720.      Another good  technique  is  to  write  a  shell-script
  2721. "wrapper"  around Elvis/vi.  Here's one of my favorites.  It
  2722. uses "grep" to  locate  files  containing  a  given  regular
  2723. expression,  and then starts vi on those files with the cur-
  2724. sor positioned on the first occurrence in the first file.  I
  2725. call this script "vg".
  2726.  
  2727.  
  2728.      #!/bin/sh
  2729.      case "$#" in
  2730.        0) echo "usage: vg regexp [files]..." >&2; exit;;
  2731.        1) set -- "$1" *.[ch];;
  2732.      esac
  2733.  
  2734.      regexp="$1"
  2735.      shift
  2736.  
  2737.      vi +/"$regexp" `grep -l "$regexp" "$@"`
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775. 7.  CUT BUFFERS
  2776.  
  2777.      When  Elvis  deletes text, it stores that text in a cut
  2778. buffer.  This happens in  both  visual  mode  and  EX  mode.
  2779. There  is  no  practical limit to how much text a cut buffer
  2780. can hold.
  2781.  
  2782.      There are 36 cut buffers: 26 named buffers ("a  through
  2783. "z),  9  anonymous  buffers ("1 through "9), and 1 extra cut
  2784. buffer (".).
  2785.  
  2786.      In EX mode, the :move and  :copy  commands  use  a  cut
  2787. buffer to temporarily hold the text to be moved/copied.
  2788.  
  2789. 7.1.  Putting text into a Cut Buffer
  2790.  
  2791.      In  visual  mode, text is copied into a cut buffer when
  2792. you use the d, y, c, C, s, or x commands.  There are also  a
  2793. few others.
  2794.  
  2795.      By default, the text goes into the "1 buffer.  The text
  2796. that used to be in "1 gets shifted into "2, "2 gets  shifted
  2797. into "3, and so on.  The text that used to be in "9 is lost.
  2798. This way, the last 9 things you deleted are  still  accessi-
  2799. ble.
  2800.  
  2801.      You  can  also  put  the text into a named buffer -- "a
  2802. through "z.  To do this, you should type the  buffer's  name
  2803. (two  keystrokes:  a  double-quote  and  a lowercase letter)
  2804. before the command that will cut  the  text.   When  you  do
  2805. this, "1 through "9 are not affected by the cut.
  2806.  
  2807.      You can append text to one of the named buffers.  To do
  2808. this, type the buffer's name in  uppercase  (a  double-quote
  2809. and an uppercase letter) before the d/y/c/C/s/x command.
  2810.  
  2811.      The  ".  buffer  is  special.  It isn't affected by the
  2812. d/y/c/C/s/x command.  Instead, it stores the text  that  you
  2813. typed  in  the last time you were in input mode.  It is used
  2814. to implement the . visual command, and ^A in input mode.
  2815.  
  2816.      In EX mode (also known as  colon  mode),  the  :delete,
  2817. :change, and :yank commands all copy text into a cut buffer.
  2818. Like the visual commands, these EX commands normally use the
  2819. "1  buffer, but you can use one of the named buffers by giv-
  2820. ing its name after the command.  For example,
  2821.  
  2822.      :20,30y a
  2823.  
  2824.  
  2825. will copy lines 20 through 30 into cut buffer "a.
  2826.  
  2827.      You can't directly put text into the ". buffer, or  the
  2828. "2 through "9 buffers.
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838. 7-2                      CUT BUFFERS                     7-2
  2839.  
  2840.  
  2841. 7.2.  Pasting from a Cut Buffer
  2842.  
  2843.      There  are two styles of pasting: line-mode and charac-
  2844. ter-mode.  If a cut buffer contains whole lines (from a com-
  2845. mand  like  "dd") then line-mode pasting is used; if it con-
  2846. tains partial lines (from a command like "dw") then  charac-
  2847. ter-mode  pasting is used.  The EX commands always cut whole
  2848. lines.
  2849.  
  2850.      Character-mode pasting causes the text to  be  inserted
  2851. into the line that the cursor is on.
  2852.  
  2853.      Line-mode  pasting inserts the text on a new line above
  2854. or below the line that the cursor is on.  It doesn't  affect
  2855. the cursor's line at all.
  2856.  
  2857.      In visual mode, the p and P commands insert text from a
  2858. cut buffer.  Uppercase P will insert it before  the  cursor,
  2859. and  lowercase p will insert it after the cursor.  Normally,
  2860. these commands will paste from the "1 buffer,  but  you  can
  2861. specify  any other buffer to paste from.  Just type its name
  2862. (a double-quote and another character) before you type the P
  2863. or p.
  2864.  
  2865.      In EX mode, the (pu)t command pastes text after a given
  2866. line.  To paste from a buffer other that "1, enter its  name
  2867. after the command.
  2868.  
  2869. 7.3.  Macros
  2870.  
  2871.      The contents of a named cut buffer can be executed as a
  2872. series of ex/vi commands.
  2873.  
  2874.      To put the instructions into the cut buffer,  you  must
  2875. first insert them into the file, and then delete them into a
  2876. named cut buffer.
  2877.  
  2878.      To execute a cut buffer's contents as EX commands,  you
  2879. should  give  the EX command "@" and the name of the buffer.
  2880. For example, :@z will execute "z as a series of EX commands.
  2881.  
  2882.      To  execute a cut buffer's contents as visual commands,
  2883. you should give the visual command "@" and the letter of the
  2884. buffer's name.  The visual "@" command is different from the
  2885. EX "@" command.  They interpret the  cut  buffer's  contents
  2886. differently.
  2887.  
  2888.      The visual @ command can be rather finicky.  Each char-
  2889. acter in the buffer is interpreted as a keystroke.   If  you
  2890. load  the  instructions  into the cut buffer via a "zdd com-
  2891. mand, then the newline character at the end of the line will
  2892. be  executed  just  like  any other character, so the cursor
  2893. would be moved down 1 line.  If you don't want the cursor to
  2894. move  down  1  line  at the end of each @z command, then you
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904. 7-3                      CUT BUFFERS                     7-3
  2905.  
  2906.  
  2907. should load the cut buffer by saying 0"zD instead.
  2908.  
  2909.      Although cut buffers can hold any amount of text, Elvis
  2910. can  only  execute small buffers.  The size limit is roughly
  2911. 1000 characters, for either EX macros or VI  macros.   If  a
  2912. buffer  is  too  large  to execute, an error message is dis-
  2913. played.
  2914.  
  2915.      You can't nest :@ commands.  You can't run :@  commands
  2916. from  your  .exrc  file,  or  any other :source file either.
  2917. Similarly, you can't run a :source command from within an  @
  2918. command.   Hopefully, these restrictions will be lifted in a
  2919. later version.
  2920.  
  2921. 7.4.  The Effect of Switching Files
  2922.  
  2923.      When Elvis first starts up, all cut buffers are  empty.
  2924. When  you  switch to a different file (via the :n or :e com-
  2925. mands perhaps) the 27 named buffers ("a through "z, and  ".)
  2926. retain  their text.  By default, the 9 anonymous cut buffers
  2927. ("1 through "9) are emptied, but the ":set keepanon"  option
  2928. allows you to cause them to be retained, too.
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973. 8.  DIFFERENCES BETWEEN Elvis & BSD VI/EX
  2974.  
  2975.      Elvis  is  not  100%  compatible  with  the real vi/ex.
  2976. Elvis has many small extensions, some omissions, and  a  few
  2977. features  which are implemented in a slightly different man-
  2978. ner.
  2979.  
  2980. 8.1.  Extensions
  2981.  
  2982. Save Configuration
  2983.           The :mkexrc command saves the current :set,  :map,
  2984.           :ab,  :color,  and  :digraph configurations in the
  2985.           ".exrc" file in your current directory.
  2986.  
  2987. Previous File
  2988.           The :N or :prev command  moves  backwards  through
  2989.           the args list.
  2990.  
  2991. Center Current Row
  2992.           In  visual command mode, the (lowercase) "zz" com-
  2993.           mand will center the current line on  the  screen,
  2994.           like "z=".
  2995.  
  2996. Changing Repeat Count
  2997.           The  default  count value for . is the same as the
  2998.           previous command which . is meant to repeat.  How-
  2999.           ever, you can supply a new count if you wish.  For
  3000.           example, after "3dw", "." will delete 3 words, but
  3001.           "5." will delete 5 words.
  3002.  
  3003. Previous Text
  3004.           The text which was most recently input (via a "cw"
  3005.           command, or something similar) is saved in  a  cut
  3006.           buffer  called  ". (which is a pretty hard name to
  3007.           write in an English sentence).
  3008.  
  3009. Keyword Lookup
  3010.           In visual command mode, you can  move  the  cursor
  3011.           onto  a word and press shift-K to have Elvis run a
  3012.           reference program to look that word up.  This com-
  3013.           mand  alone  is worth the price of admission!  See
  3014.           the ctags and ref programs.
  3015.  
  3016. Increment/Decrement
  3017.           In visual command mode, you can  move  the  cursor
  3018.           onto  a  number and then hit ## or #+ to increment
  3019.           that number by 1.  To increment  it  by  a  larger
  3020.           amount, type in the increment value before hitting
  3021.           the initial #.  The number can also be decremented
  3022.           or set by hitting #- or #=, respectively.
  3023.  
  3024. Input Mode
  3025.           You  can backspace past the beginning of the line.
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036. 8-2         DIFFERENCES BETWEEN Elvis & BSD VI/EX        8-2
  3037.  
  3038.  
  3039.           The arrow keys work in input mode.
  3040.  
  3041.           If you type control-A,  then  the  text  that  you
  3042.           input  last  time is inserted.  You will remain in
  3043.           input mode, so you can backspace over part of  it,
  3044.           or  add  more  to  it.  (This is sort of like con-
  3045.           trol-@ on  the  real  vi,  except  that  control-A
  3046.           really works.)
  3047.  
  3048.           Control-P  will  insert  the  contents  of the cut
  3049.           buffer.
  3050.  
  3051.           Real vi can only remember up to 128 characters  of
  3052.           input, but Elvis can remember any amount.
  3053.  
  3054.           The ^T and ^D keys can adjust the indent of a line
  3055.           no matter where the cursor happens to be  in  that
  3056.           line.
  3057.  
  3058.           You  can  save  your  file and exit Elvis directly
  3059.           from input mode by hitting control-Z twice.
  3060.  
  3061.           Elvis supports digraphs as a  way  to  enter  non-
  3062.           ASCII characters.
  3063.  
  3064. Start in Input Mode
  3065.           If  you  ":set inputmode" in your .exrc file, then
  3066.           Elvis will start  up  in  input  mode  instead  of
  3067.           visual command mode.
  3068.  
  3069. Visible Fonts
  3070.           With  ":set  charattr",  Elvis  can display "back-
  3071.           slash-f" style character attributes on the  screen
  3072.           as you edit.  The following example shows the rec-
  3073.           ognized attributes:
  3074.  
  3075.                normal \fBboldface\fR \fIitalics\fR \fUunder-
  3076.           lined\fR normal
  3077.  
  3078.           NOTE:   you   must   compile   Elvis  without  the
  3079.           -DNO_CHARATTR flag for this to work.
  3080.  
  3081. File Syncing
  3082.           After a crash, you can usually recover the altered
  3083.           form  of  the  file  from  the temporary file that
  3084.           Elvis uses -- unless the temporary file  was  cor-
  3085.           rupted.
  3086.  
  3087.           UNIX  systems  use  a  delayed-write  cache, which
  3088.           means that when Elvis tries to write to the tempo-
  3089.           rary  file,  the information might still be in RAM
  3090.           instead of on the disk.  A power failure  at  that
  3091.           time  would  cause  the  in-RAM  information to be
  3092.           lost.  UNIX's sync()  call  will  force  all  such
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102. 8-3         DIFFERENCES BETWEEN Elvis & BSD VI/EX        8-3
  3103.  
  3104.  
  3105.           information to disk.
  3106.  
  3107.           MS-DOS  and  Atari TOS don't write a file's length
  3108.           to disk until that file is closed.   Consequently,
  3109.           the temporary file would appear to be 0 bytes long
  3110.           if power failed when we were  editing.   To  avoid
  3111.           this  problem,  a sync() function has been written
  3112.           which will close the temporary file and then imme-
  3113.           diately reopen it.
  3114.  
  3115. Cursor Shape
  3116.           Elvis  changes the shape of the cursor to indicate
  3117.           which mode you're in, if your  terminal's  termcap
  3118.           entry includes the necessary capabilities.
  3119.  
  3120. Hide nroff Lines
  3121.           The  ":set  hideformat"  option hides nroff format
  3122.           control lines.  (They are displayed on the  screen
  3123.           as blank lines.)
  3124.  
  3125. Compiler Interface
  3126.           Elvis is clever enough to parse the error messages
  3127.           emitted by many compilers.  To use  this  feature,
  3128.           you  should collect your compiler's error messages
  3129.           into a file called "errlist"; Elvis will read this
  3130.           file, determine which source file caused the error
  3131.           messages, start editing that file, move the cursor
  3132.           to the line where the error was detected, and dis-
  3133.           play the error message on the status line.  Nifty!
  3134.  
  3135. Visible Text Selection
  3136.           In visual command mode, 'v' starts visibly select-
  3137.           ing characters and 'V'  starts  visibly  selecting
  3138.           whole lines.  The character or line where the cur-
  3139.           sor is located becomes one endpoint of the  selec-
  3140.           tion.   You can then use the standard cursor move-
  3141.           ment commands to move the cursor to the other end-
  3142.           point, and then press one of the operator commands
  3143.           (c/d/y/</>/!/=/\).  The operator will then immedi-
  3144.           ately be applied to the selected text.
  3145.  
  3146. Pop-up Menu Operator
  3147.           The  '\'  key is a new operator, similar in opera-
  3148.           tion to the c/d/y/</>/! operators.  It conjures up
  3149.           a menu, from which you can select any of the other
  3150.           operators plus a few other common commands.
  3151.  
  3152. Preset Filter Operator
  3153.           The '=' key is another new operator.  It is  simi-
  3154.           lar  to  the  '!'  operator, except that while '!'
  3155.           asks you to type in a filter  command  each  time,
  3156.           '='  assumes  it  should  always  run  the command
  3157.           stored in the equalprg option.
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168. 8-4         DIFFERENCES BETWEEN Elvis & BSD VI/EX        8-4
  3169.  
  3170.  
  3171. keepanon  Normally Elvis discards the anonymous cut  buffers
  3172.           when you switch files, just like the real vi.  The
  3173.           keepanon option allows anonymous cut buffers to be
  3174.           retained.
  3175.  
  3176. Move to a Given Percentage
  3177.           The  '%'  movement  key can now accept an optional
  3178.           count.  Without a count, the '%' key  still  moves
  3179.           to  a  matching  parenthesis  like  it always did.
  3180.           With a count somewhere between 1 and 100,  though,
  3181.           it  moves the cursor to approximately a given per-
  3182.           centage of the way through the file.  For example,
  3183.           typing "50%" will move the cursor to the middle of
  3184.           the file.
  3185.  
  3186. Regular Expressions
  3187.           In regular expressions, several new forms of  clo-
  3188.           sure  operators  are  supported: \{n}, \{n,m}, \+,
  3189.           and \?.  Also, '\@' matches the word at  the  cur-
  3190.           sor,  and  '\=' causes the cursor to be left some-
  3191.           place other than the start of the matching text.
  3192.  
  3193. 8.2.  Omissions
  3194.  
  3195.      The replace mode is a hack.  It doesn't save  the  text
  3196. that it overwrites.
  3197.  
  3198.      Long  lines are displayed differently -- where the real
  3199. vi would wrap a long line onto several rows of  the  screen,
  3200. Elvis  simply  displays  part of the line, and allows you to
  3201. scroll the screen sideways to see the rest of it.
  3202.  
  3203.      The ":preserve" and ":recover"  commands  are  missing.
  3204. So  is  the  -r  flag.   I've never had a good reason to use
  3205. ":preserve", and  since  ":recover"  is  used  so  rarely  I
  3206. decided  to  implement it as a separate program.  There's no
  3207. need to load the recovery code into memory  every  time  you
  3208. edit a file, I figured.
  3209.  
  3210.      LISP  support  is missing.  However, the = key is still
  3211. an operator that reformats lines of text.   By  default,  it
  3212. reformats  lines by sending them through the fmt filter, but
  3213. you could write your own LISP beautifier and configure elvis
  3214. to  use it.  Key mappings could take care of most other dif-
  3215. ferences.  Auto-indent is the only thing that is  irrecover-
  3216. ably lost.
  3217.  
  3218.      Autoindent  mode  acts a little different from the real
  3219. vi, anyway.  It doesn't handle ^^D or 0^D correctly.  On the
  3220. other  hand,  it does allow ^D and ^T to be used anywhere in
  3221. the line, to adjust the indentation for the whole line.
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237. 9.  INTERNAL
  3238.  
  3239.      You  don't need to know the material in this section to
  3240. use Elvis.  You only need it if you intend to modify  Elvis.
  3241.  
  3242.      You should also check out the CFLAGS, TERMCAP, ENVIRON-
  3243. MENT VARIABLES, VERSIONS, and QUIESTIONS & ANSWERS  sections
  3244. of this manual.
  3245.  
  3246. 9.1.  The temporary file
  3247.  
  3248.      The temporary file is divided into blocks of 1024 bytes
  3249. each.  The functions in "blk.c" maintain a cache of the five
  3250. most recently used blocks, to minimize file I/O.
  3251.  
  3252.      When  Elvis starts up, the file is copied into the tem-
  3253. porary file by the function tmpstart()  in  "tmp.c".   Small
  3254. amounts  of extra space are inserted into the temporary file
  3255. to insure that no text lines cross block  boundaries.   This
  3256. speeds up processing and simplifies storage management.  The
  3257. extra space is filled with NUL characters.  the  input  file
  3258. must  not  contain  any NULs, to avoid confusion.  This also
  3259. limits lines to a length of 1023 characters or less.
  3260.  
  3261.      The data blocks aren't necessarily stored in  sequence.
  3262. For  example,  it  is  entirely possible that the data block
  3263. containing the first lines of text will be stored after  the
  3264. block containing the last lines of text.
  3265.  
  3266.      In  RAM,  Elvis maintains two lists: one that describes
  3267. the "proper" order of the  disk  blocks,  and  another  that
  3268. records  the  line  number  of  the last line in each block.
  3269. When Elvis needs to fetch a given  line  of  text,  it  uses
  3270. these  tables  to  locate the data block which contains that
  3271. line.
  3272.  
  3273.      Before each change is made to the file, these lists are
  3274. copied.  The copies can be used to "undo" the change.  Also,
  3275. the first list -- the one that  lists  the  data  blocks  in
  3276. their  proper order -- is written to the first data block of
  3277. the temp file.  This list can be used during file  recovery.
  3278.  
  3279.      When  blocks  are altered, they are rewritten to a dif-
  3280. ferent block in the file, and  the  order  list  is  updated
  3281. accordingly.   The  original  block  is left intact, so that
  3282. "undo" can  be  performed  easily.   Elvis  will  eventually
  3283. reclaim the original block, when it is no longer needed.
  3284.  
  3285. 9.2.  Implementation of Editing
  3286.  
  3287.      There are three basic operations which affect text:
  3288.  
  3289.      o delete text  - delete(from, to)
  3290.      o add text     - add(at, text)
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300. 9-2                       INTERNAL                       9-2
  3301.  
  3302.  
  3303.      o yank text    - cut(from, to)
  3304.  
  3305.  
  3306.      To  yank  text,  all text between two text positions is
  3307. copied into a cut buffer.  The original text is not changed.
  3308. To  copy  the text into a cut buffer, you need only remember
  3309. which physical blocks that contain the cut text, the  offset
  3310. into  the  first  block  of the start of the cut, the offset
  3311. into the last block of the end of the cut, and what kind  of
  3312. cut  it  was.   (Cuts  may  be either character cuts or line
  3313. cuts; the kind of a cut affects the way it is later  "put".)
  3314. Yanking is implemented in the function cut(), and pasting is
  3315. implemented in the function paste().   These  functions  are
  3316. defined in "cut.c".
  3317.  
  3318.      To  delete  text,  you  must  modify the first and last
  3319. blocks, and remove any reference to the  intervening  blocks
  3320. in  the  header's list.  The text to be deleted is specified
  3321. by two marks.  This is implemented in the function delete().
  3322.  
  3323.      To  add text, you must specify the text to insert (as a
  3324. NUL-terminated string) and the place  to  insert  it  (as  a
  3325. mark).   The block into which the text is to be inserted may
  3326. need to be split into as  many  as  four  blocks,  with  new
  3327. intervening blocks needed as well...  or it could be as sim-
  3328. ple as modifying a single block.  This is implemented in the
  3329. function add().
  3330.  
  3331.      There is also a change() function, which generally just
  3332. calls delete() and add().  For the special case where a sin-
  3333. gle character is being replaced by another single character,
  3334. though, change() will optimize things somewhat.  The  add(),
  3335. delete(),  and  change()  functions are all defined in "mod-
  3336. ify.c".
  3337.  
  3338.      The input() function reads text from a user and inserts
  3339. it  into  the  file.   It  makes  heavy  use  of  the add(),
  3340. delete(), and change() functions.  It inserts characters one
  3341. at a time, as they are typed.
  3342.  
  3343.      When   text  is  modified,  an  internal  file-revision
  3344. counter, called changes, is incremented.   This  counter  is
  3345. used  to  detect  when certain caches are out of date.  (The
  3346. "changes" counter is also incremented when we  switch  to  a
  3347. different file, and also in one or two similar situations --
  3348. all related to invalidating caches.)
  3349.  
  3350. 9.3.  Marks and the Cursor
  3351.  
  3352.      Marks are places within the text.  They are represented
  3353. internally  as  32-bit  values which are split into two bit-
  3354. fields: a line number and a character index.   Line  numbers
  3355. start with 1, and character indexes start with 0.  Lines can
  3356. be up to 1023 characters long, so the character index is  10
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366. 9-3                       INTERNAL                       9-3
  3367.  
  3368.  
  3369. bits wide and the line number fills the remaining 22 bits in
  3370. the long int.
  3371.  
  3372.      Since line numbers start with 1, it is impossible for a
  3373. valid  mark  to have a value of 0L.  0L is therefore used to
  3374. represent unset marks.
  3375.  
  3376.      When you do the "delete text" change,  any  marks  that
  3377. were  part of the deleted text are unset, and any marks that
  3378. were set  to  points  after  it  are  adjusted.   Marks  are
  3379. adjusted similarly after new text is inserted.
  3380.  
  3381.      The cursor is represented as a mark.
  3382.  
  3383. 9.4.  Colon Command Interpretation
  3384.  
  3385.      Colon  commands  are  parsed,  and  the command name is
  3386. looked up in an array of structures  which  also  contain  a
  3387. pointer  to  the function that implements the command, and a
  3388. description of the arguments that the command can take.   If
  3389. the  command is recognized and its arguments are legal, then
  3390. the function is called.
  3391.  
  3392.      Each function performs its task;  this  may  cause  the
  3393. cursor to be moved to a different line, or whatever.
  3394.  
  3395. 9.5.  Screen Control
  3396.  
  3397.      In  input  mode  or  visual command mode, the screen is
  3398. redrawn by a function called  redraw().   This  function  is
  3399. called  in  the  getkey()  function before each keystroke is
  3400. read in, if necessary.
  3401.  
  3402.      Redraw() writes to the screen via a package which looks
  3403. like  the  "curses" library, but isn't.  It is actually much
  3404. simpler.  Most curses operations are implemented  as  macros
  3405. which copy characters into a large I/O buffer, which is then
  3406. written with a single large write()  call  as  part  of  the
  3407. refresh() operation.
  3408.  
  3409.      (Note:  Under MS-DOS, the pseudo-curses macros check to
  3410. see whether you're using the pcbios interface.  If you  are,
  3411. then the macros call functions in "pc.c" to implement screen
  3412. updates.)
  3413.  
  3414.      The  low-level  functions  which  modify  text  (namely
  3415. add(), delete(), and change()) supply redraw() with clues to
  3416. help redraw() decide which  parts  of  the  screen  must  be
  3417. redrawn.    The  clues  are  given  via  a  function  called
  3418. redrawrange().
  3419.  
  3420.      Most EX commands use the pseudo-curses package to  per-
  3421. form their output, like redraw().
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432. 9-4                       INTERNAL                       9-4
  3433.  
  3434.  
  3435.      There  is  also  a function called msg() which uses the
  3436. same syntax as printf().  In EX mode, msg()  writes  message
  3437. to the screen and automatically adds a newline.  In VI mode,
  3438. msg() writes the message on the bottom line  of  the  screen
  3439. with the "standout" character attribute turned on.
  3440.  
  3441. 9.6.  Options
  3442.  
  3443.      For  each  option available through the ":set" command,
  3444. Elvis contains a character array variable, named "o_option".
  3445. For  example,  the  "lines"  option  uses  a variable called
  3446. "o_lines".
  3447.  
  3448.      For boolean options, the array has a  dimension  of  1.
  3449. The  first  (and only) character of the array will be NUL if
  3450. the variable's value is FALSE, and some other value if it is
  3451. TRUE.   To  check  the  value, just by dereference the array
  3452. name, as in "if (*o_autoindent)".
  3453.  
  3454.      For number options, the array has  a  dimension  of  3.
  3455. The  array  is  treated as three unsigned one-byte integers.
  3456. The first byte is the current value of the option.  The sec-
  3457. ond  and  third bytes are the lower and upper bounds of that
  3458. option.
  3459.  
  3460.      For string options, the array usually has  a  dimension
  3461. of about 60 but this may vary.  The option's value is stored
  3462. as a normal NUL-terminated string.
  3463.  
  3464.      All of the options are declared in "opts.c".  Most  are
  3465. initialized to their default values; the initopts() function
  3466. is used to perform any environment-specific  initialization.
  3467.  
  3468. 9.7.  Portability
  3469.  
  3470.      To  improve  portability, Elvis collects as many of the
  3471. system-dependent definitions as possible into the "config.h"
  3472. file.   This file begins with some preprocessor instructions
  3473. which attempt to determine which compiler and operating sys-
  3474. tem  you  have.   After  that, it conditionally defines some
  3475. macros and constants for your system.
  3476.  
  3477.      One of the more significant macros is ttyread().   This
  3478. macro is used to read raw characters from the keyboard, pos-
  3479. sibly with timeout.  For UNIX systems, this basically  reads
  3480. bytes  from  stdin.  For MSDOS, TOS, and OS9, ttyread() is a
  3481. function defined in curses.c.  There is  also  a  ttywrite()
  3482. macro.
  3483.  
  3484.      The  tread() and twrite() macros are versions of read()
  3485. and write() that are used for text files.  On UNIX  systems,
  3486. these  are  equivalent  to  read()  and write().  On MS-DOS,
  3487. these are also equivalent to read() and write(),  since  DOS
  3488. libraries  are  generally  clever  enough to convert newline
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498. 9-5                       INTERNAL                       9-5
  3499.  
  3500.  
  3501. characters automatically.  For Atari TOS,  though,  the  MWC
  3502. library  is  too stupid to do this, so we had to do the con-
  3503. version explicitly.
  3504.  
  3505.      Other macros may substitute index()  for  strchr(),  or
  3506. bcopy()  for memcpy(), or map the "void" data type to "int",
  3507. or whatever.
  3508.  
  3509.      The file "tinytcap.c" contains a set of functions  that
  3510. emulate  the  termcap  library  for  a small set of terminal
  3511. types.  The terminal-specific info is hard-coded  into  this
  3512. file.   It  is only used for systems that don't support real
  3513. termcap.  Another alternative for screen control can be seen
  3514. in  the  "curses.h"  and  "pc.c"  files.  Here, macros named
  3515. VOIDBIOS and CHECKBIOS are used to indirectly call functions
  3516. which  perform low-level screen manipulation via BIOS calls.
  3517.  
  3518.      The stat() function must be able to come up with  UNIX-
  3519. style  major/minor/inode  numbers  that  uniquely identify a
  3520. file or directory.
  3521.  
  3522.      Please try to keep you changes localized, and wrap them
  3523. in  #if/#endif pairs, so that Elvis can still be compiled on
  3524. other systems.  And PLEASE let me know about it,  so  I  can
  3525. incorporate your changes into my latest-and-greatest version
  3526. of Elvis.
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567. 10.  MAKEFILE
  3568.  
  3569.      On most Operating Systems, and with most compilers, the
  3570. "Makefile.mix" file  is  used  to  control  compilation  and
  3571. installation of Elvis.  This section of the manual describes
  3572. the overall structure of  "Makefile.mix",  and  the  various
  3573. configuration options in it.
  3574.  
  3575. 10.1.  Configuring the Makefile
  3576.  
  3577.      Begin  by  copying "Makefile.mix" to "Makefile".  Never
  3578. alter the original "Makefile.mix".
  3579.  
  3580.      Most of the configuration options are controlled via  a
  3581. group  of  macros.   Makefile.mix  begins  with several pre-
  3582. configured sets of macro definitions - one group for each of
  3583. the most common supported systems.  As shipped, all of these
  3584. macro definitions are commented out; you must either  uncom-
  3585. ment  out  one  of  the groups, or (for less common systems)
  3586. construct an entirely new group.
  3587.  
  3588. 10.2.  Using the Makefile
  3589.  
  3590.      After configuring the Makefile, you can run  "make"  to
  3591. compile  the  programs.   There  are  also some other useful
  3592. things that the Makefile can do...
  3593.  
  3594.  
  3595.      COMMAND         RESULT
  3596.      make            compile all programs
  3597.      make install    copy the programs to the BIN directory
  3598.      make clean      remove all object files
  3599.      make clobber    remove everything except source & documentation
  3600.  
  3601.  
  3602.      Note that the last two will probably  work  only  under
  3603. UNIX.
  3604.  
  3605. 10.3.  What "make install" does
  3606.  
  3607.      To install elvis, we should copy all of the executables
  3608. into a directory where users can find them; copy  the  docu-
  3609. mentation  into a directory where the on-line manual program
  3610. can find them; and arrange for edit buffers to be  preserved
  3611. after  a  system crash.  The "make install" command tries to
  3612. do this automatically, but there are problems.
  3613.  
  3614.      Practically all operating systems allow programs to  be
  3615. installed  different  directories.  As shipped, Makefile.mix
  3616. contains somebody's best guess as to where you'd  like  them
  3617. to  go.   You should double check it, though.  The BIN macro
  3618. controls where the programs will be installed.
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630. 10-2                      MAKEFILE                      10-2
  3631.  
  3632.  
  3633.      On UNIX systems the  "elvprsv"  and  "elvrec"  programs
  3634. need  to  be installed as SUID-root programs.  Consequently,
  3635. you must run "make install" as root; then they will automat-
  3636. ically be installed as SUID-root.
  3637.  
  3638.      For  text  to  be  recovered after a crash, you need to
  3639. arrange for the "elvprsv" program to be run before the  /tmp
  3640. file is cleaned.  This means that the /etc/rc file (or what-
  3641. ever) needs to be edited.  If you have a  SysV  UNIX  system
  3642. which  uses a /etc/rc2.d directory for storing start-up com-
  3643. mands, then you're lucky.  "make install" will  detect  that
  3644. /etc/rc2.d exists and attempt to automatically create a file
  3645. called "/etc/rc2.d/S03elvis" which runs  elvprsv.   However,
  3646. for  non-UNIX  systems,  or  UNIX systems which don't have a
  3647. /etc/rc2.d directory, you'll need to do this by  hand.   See
  3648. the  "Versions"  section of the manual for hints about doing
  3649. this on your particular system.
  3650.  
  3651.      Non-UNIX systems don't  have  a  standard  place  where
  3652. UNIX-style  man-pages  go, so "make install" doesn't attempt
  3653. to install documentation on those systems.
  3654.  
  3655.      On UNIX systems, there is no standard place either, but
  3656. you  can  be pretty sure that your system has a non-standard
  3657. one.  There is a  shell  script  called  "instman.sh"  which
  3658. attempts  to  figure  out where the man-pages belong on your
  3659. system, and then copies them there.  You might need to  edit
  3660. "instman.sh"  to  make  it  work,  but  try  it as-is first.
  3661. "instman.sh" is automatically run by "make install".
  3662.  
  3663.      Note: It is safe to run "make install" more than  once.
  3664.  
  3665. 10.4.  Summary of Macros
  3666.  
  3667.      The following describes the configuration macros.  With
  3668. most versions of make, a blank  macro  can  simply  be  left
  3669. undefined.
  3670.  
  3671. OBJ  This  is  the  filename  extension  for unlinked object
  3672.      files - usually .o, but MS-DOS uses .obj.
  3673.  
  3674. EXE  This is the filename  extension  for  elvis  executable
  3675.      file - usually nothing, but MS-DOS uses .exe, and other
  3676.      operating systems may use something else.
  3677.  
  3678. COM  This is the filename extension for the  executables  of
  3679.      elvis'  support  programs - usually the same as the EXE
  3680.      macro, but since the  support  programs  are  all  much
  3681.      smaller that elvis, MS-DOS can use the .com format.
  3682.  
  3683. EXTRA
  3684.      This  is  a  space-delimited  list  of version-specific
  3685.      object files to be linked into elvis.  Typically,  this
  3686.      list  will  contain  at least one object file which was
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696. 10-3                      MAKEFILE                      10-3
  3697.  
  3698.  
  3699.      written specifically for a given operating system.   It
  3700.      may  also contain "tinytcap$(OBJ)" or "tinyprnt$(OBJ)".
  3701.  
  3702. EXTRA2
  3703.      This is  a  space-delimited  list  of  version-specific
  3704.      object  files  used  in  elvis and a few of the support
  3705.      programs.  For UNIX-like systems, this is typically  an
  3706.      empty  list.   For  non-UNIX  systems,  it will usually
  3707.      either be empty, or it will  contain  the  name  of  an
  3708.      object file which contains functions which emulate cer-
  3709.      tain UNIX system calls.  (Not all non-UNIX systems need
  3710.      any   special   emulation   functions,  because  all  C
  3711.      libraries try to emulate UNIX.  You only need an EXTRA2
  3712.      list  if the library doesn't emulate UNIX well enough.)
  3713.  
  3714. LIBS This is a list of  library  flags  used  while  linking
  3715.      elvis.  UNIX systems need "-ltermcap" or something sim-
  3716.      ilar, unless the EXTRA macro includes "tinytcap$(OBJ)".
  3717.      Most  other  operating systems use "tinytcap$(OBJ)" and
  3718.      don't need anything else, so they leave the  LIBS  list
  3719.      empty.
  3720.  
  3721. BIN  This  is  the  directory  where  executables  should be
  3722.      installed by "make install".
  3723.  
  3724. CC   This is the C compiler command, possibly  with  "memory
  3725.      model" flags.
  3726.  
  3727. CFLAGS
  3728.      This  lists  the compiler flags used to select compile-
  3729.      time options.  The  "CFLAGS"  section  of  this  manual
  3730.      describes this in detail.
  3731.  
  3732. LNK  This  is  the  name  of the linker.  If you want to use
  3733.      $(CC) as your linker, then you can leave LNK undefined.
  3734.  
  3735. LFLAGS
  3736.      This is a list of linker flags used to select link-time
  3737.      options.  It is almost always blank.
  3738.  
  3739. SMALL
  3740.      The flag for special small memory model  compilation  -
  3741.      usually blank.
  3742.  
  3743. OF   The  link flag to control the output file's name - usu-
  3744.      ally -o<space>.  The Sun version of "make"  strips  off
  3745.      trailing whitespace, so a pair of empty quotes has been
  3746.      added after the space, to  protect  it.   On  non-Suns,
  3747.      this isn't necessary.
  3748.  
  3749. RF   The flag used to denote "compile but don't link" - usu-
  3750.      ally -c
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762. 10-4                      MAKEFILE                      10-4
  3763.  
  3764.  
  3765. PROGS
  3766.      This is a space-delimited list of all  programs.   This
  3767.      list  always  includes  elvis,  ctags, ref, elvrec, and
  3768.      elvprsv.  Also, everybody gets fmt except for BSD UNIX;
  3769.      it  already  has  its  own  version  of fmt as standard
  3770.      equipment.
  3771.  
  3772.      Most non-UNIX systems also include the vi, ex, and view
  3773.      aliases.  (UNIX doesn't need those aliases in the PROGS
  3774.      list because it creates  them  via  file  links  during
  3775.      installation.)   OS-9  doesn't  include  the  ex alias,
  3776.      because there is already a command by that  name  built
  3777.      into its standard shell.
  3778.  
  3779.      Note:  some  MS-DOS configurations break this list into
  3780.      two smaller lists, to compensate for  MS-DOS's  limita-
  3781.      tions on command line length.
  3782.  
  3783. CHMEM
  3784.      This  is  either  blank, or a command to be run immedi-
  3785.      ately after linking elvis.  Under Minix  and  Coherent,
  3786.      elvis  needs to have extra space assigned for the stack
  3787.      & heap after it has been linked, so their  commands  to
  3788.      do  that are placed here.  Most other operating systems
  3789.      generally  either  don't  need  to  have  their  stacks
  3790.      enlarged, or they enlarge it during linking.
  3791.  
  3792. SORT This  should  be  defined to be -DSORT if you want your
  3793.      tags list to  be  sorted,  or  blank  if  you  want  it
  3794.      unsorted.   The real vi requires a sorted tags file, so
  3795.      for the sake of compatibility all of the UNIX  configu-
  3796.      rations  use  -DSORT.  Elvis doesn't need a sorted tags
  3797.      file, though, so on non-UNIX systems you can leave this
  3798.      macro blank.
  3799.  
  3800. RM   This is the name of a program that deletes files uncon-
  3801.      ditionally.  It is used during  "make  clean".   RM  is
  3802.      defined  as "rm -f" for UNIX systems, or "del" for most
  3803.      others.
  3804.  
  3805. CP   This is the name of a program  that  copies  files.   -
  3806.      usually  "cp"  or  "copy".   It  is  used  during "make
  3807.      install".
  3808.  
  3809. SYS  This is the type of system.  It is used  to  select  an
  3810.      appropriate  style of linking and installation that are
  3811.      used by "make" and "make install",  respectively.   The
  3812.      available types are:
  3813.  
  3814.                          unx       UNIX and UNIX-like systems
  3815.                          dos       MS-DOS
  3816.                          ami       AmigaDos
  3817.                          tos       Atari TOS
  3818.                          os9       OS-9/68k
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828. 10-5                      MAKEFILE                      10-5
  3829.  
  3830.  
  3831.                          vms       VAX/VMS
  3832.                          xdos      cross-compiled on SCO for MS-DOS
  3833.  
  3834.  
  3835. DUMMY
  3836.      This is used as the "source" filename in the dependency
  3837.      list of targets which are supposed to  be  uncondition-
  3838.      ally  compiled.   It is usually nothing since most ver-
  3839.      sions of "make" treat an empty source file  list  as  a
  3840.      special  case, but OS-9 needs it defined as "dummy" and
  3841.      further requires that there be  no  actual  file  named
  3842.      dummy.
  3843.  
  3844. CFG  The  is  the  name of the compiler configuration file -
  3845.      usually blank, since most compilers don't need  a  con-
  3846.      figuration   file.   Some  MS-DOS  compilers  need  it,
  3847.      though.
  3848.  
  3849. 10.5.  Structure of Makefile.mix
  3850.  
  3851.      Makefile.mix begins with several sets of commented  out
  3852. configuration macro definitions, as described above.  A com-
  3853. ment saying "The rest of this  Makefile  contains  no  user-
  3854. serviceable parts" marks the end of this section.  Most peo-
  3855. ple won't need to edit anything after that.
  3856.  
  3857.      This is followed by macro definitions which are identi-
  3858. cal,  regardless  of your operating system.  The OBJS macros
  3859. list the object files that form the portable parts of elvis,
  3860. and  are  used together with the EXTRA and EXTRA2 configura-
  3861. tion macros during linking.
  3862.  
  3863.      The SRC macros list all of the files mentioned  in  the
  3864. "MANIFEST"  file.   These are used to bundle the source code
  3865. via "make uue" or "make sh".
  3866.  
  3867.      This is followed by a target named "all" which  depends
  3868. on  all  of  the  programs listed in the PROGS configuration
  3869. macro.  This is followed by detailed instructions describing
  3870. how  each  file is compiled and linked.  The only exceptions
  3871. are the "elvis"  program,  and  the  various  forms  of  the
  3872. "alias" program.
  3873.  
  3874.      Linking  a  big  program  like elvis is non-standard on
  3875. some systems.  To support  this,  we  just  say  that  elvis
  3876. depends  on  "linkelv.$(SYS)", where "$(SYS)" is replaced by
  3877. whatever you defined the SYS configuration macro to be.  The
  3878. various  link styles are listed after that.  The only really
  3879. tricky one is for DOS.  Since the list of files to be linked
  3880. is  too  long  to  fit  on  a DOS command line, a customized
  3881. response file is created, and the name of the response  file
  3882. is  passed  instead.   The exact format of the response file
  3883. depends on the compiler you're using.
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894. 10-6                      MAKEFILE                      10-6
  3895.  
  3896.  
  3897.      This is followed by system-dependent  ways  of  linking
  3898. the "alias" object file to create multiple executables.  For
  3899. most systems, we only really link it once to form  the  "ex"
  3900. executable,  and then copy that executable to form the "vi",
  3901. "view", and "input" executables.  OS-9, though, doesn't need
  3902. an  "ex"  executable and it requires actual linking for each
  3903. alias.
  3904.  
  3905.      Next comes installation, in all  its  system  dependent
  3906. forms.   This uses the now-familiar trick of saying that the
  3907. "install" target depends on a bogus file named "inst.$(SYS)"
  3908. and  then  listing  each  installation technique after that.
  3909. There should be no surprises here.
  3910.  
  3911.      The rest of Makefile.mix contains a few  handy  pseudo-
  3912. targets, such as "make clean".
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963. 11.  CFLAGS
  3964.  
  3965.      Elvis  uses many preprocessor symbols to control compi-
  3966. lation.  Some of these control  the  sizes  of  buffers  and
  3967. such.   The "-DNO_XXXX" options remove small sets of related
  3968. features.
  3969.  
  3970.      Most Elvis users will probably want to  keep  all  fea-
  3971. tures  available.  Minix-PC users, though, will have to sac-
  3972. rifice some sets because otherwise Elvis would be too  bulky
  3973. to compile.  The "asld" phase of the compiler craps out.
  3974.  
  3975. -DM_SYSV, -Dbsd, -DTOS, -DCOHERENT, -Damiga
  3976.      These  flags tell the compiler that Elvis is being com-
  3977.      piled for System-V UNIX, BSD UNIX, Atari TOS, Coherent,
  3978.      or AmigaDos, respectively.  For other systems, the con-
  3979.      fig.h file can generally figure it out automatically.
  3980.  
  3981. -DRAINBOW
  3982.      For MS-DOS systems, this causes  support  for  the  DEC
  3983.      Rainbow to be compiled into Elvis.
  3984.  
  3985. -DNO_S5WINSIZE
  3986.      Some  versions  of  SysV UNIX don't support support the
  3987.      "winsize" style of screen-size testing.  If you have  a
  3988.      SysV  system  and  can't  compile  "curses.c", then try
  3989.      adding -DNO_S5WINSIZE to the CFLAGS.
  3990.  
  3991. -DTERMIOS
  3992.      POSIX is a SysV-derived specification which uses a ter-
  3993.      minal  control  package  called  "termios",  instead of
  3994.      "termio".   Some  other  SysV  systems  may  also   use
  3995.      termios.   You  can  make elvis uses termios instead of
  3996.      the more common termio by adding -DTERMIOS  to  CFLAGS.
  3997.      (Note: This hasn't been tested very well.)
  3998.  
  3999. -DNBUFS=number
  4000.      Elvis keeps most of your text in a temporary file; only
  4001.      a small amount is actually stored in  RAM.   This  flag
  4002.      allows  you  to  control how much of the file can be in
  4003.      RAM at any time.  The default is 5 blocks, and the min-
  4004.      imum is 3 blocks.  (See the -DBLKSIZE flag, below.)
  4005.  
  4006.      More  RAM  allows  global  changes  to  happen a little
  4007.      faster.  If you're just making many  small  changes  in
  4008.      one  section  of  a  file, though, extra RAM won't help
  4009.      much.
  4010.  
  4011. -DBLKSIZE=number
  4012.      This controls the size of blocks that Elvis uses inter-
  4013.      nally.   The  value  of BLKSIZE must be a power of two.
  4014.      Every time you double BLKSIZE, you quadruple  the  size
  4015.      of  a  text  file  that  Elvis can handle, but you also
  4016.      cause the temporary file to grow faster.   For  MS-DOS,
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026. 11-2                       CFLAGS                       11-2
  4027.  
  4028.  
  4029.      Coherent,  and  Minix-PC,  the  default  value is 1024,
  4030.      which allows you to edit files up to almost 512K  bytes
  4031.      long.   For  all  other  systems,  the default value is
  4032.      2048, which allows you to edit files that are nearly  2
  4033.      megabytes long.
  4034.  
  4035.      The  BLKSIZE  also  determines the maximum line length,
  4036.      and a few other limits.  BLKSIZE should be either  256,
  4037.      512,  1024,  or 2048.  Values other than these can lead
  4038.      to strange behavior.
  4039.  
  4040. -DTMPDIR=string
  4041.      This sets the default value of the "directory"  option,
  4042.      which   specifies  where  the  temporary  files  should
  4043.      reside.  The value of TMPDIR must be a  string,  so  be
  4044.      sure  your  value includes the quote characters on each
  4045.      end.
  4046.  
  4047. -DEXRC=str, -DHMEXRC=str, -DSYSEXRC=str, -DEXINIT=str
  4048.      This lets you control the names of  the  initialization
  4049.      files.   Their  values  must  be strings, so be careful
  4050.      about quoting.
  4051.  
  4052.      EXRC is the name of the initialization file in the cur-
  4053.      rent  directory.   Its default value is ".exrc" on UNIX
  4054.      systems -- the same as the real vi.  Since that isn't a
  4055.      legal   DOS   filename,   under   DOS  the  default  is
  4056.      "elvis.rc".  For  other  systems,  check  the  config.h
  4057.      file.
  4058.  
  4059.      HMEXRC  is  the name of the initialization file in your
  4060.      home directory.  By default, it is the  same  as  EXRC.
  4061.      Elvis  will automatically prepend the name of your home
  4062.      directory to HMEXRC at run time, so don't give  a  full
  4063.      path name.
  4064.  
  4065.      SYSEXRC  is  the  name  of a system-wide initialization
  4066.      file.  It has no default value; if you don't  define  a
  4067.      value  for it, then the code that supports SYSEXRC just
  4068.      isn't compiled.  The value of SYSEXRC should be a  full
  4069.      pathname, in quotes.
  4070.  
  4071.      EXINIT  is the name of an environment variable that can
  4072.      contain initialization commands.  Normally,  its  value
  4073.      is "EXINIT".
  4074.  
  4075. -DKEYWORDPRG=string
  4076.      This flag determines the default value of the "keyword-
  4077.      prg" option.  Its value must be a string, so be careful
  4078.      about  quoting.   The  default  value  of  this flag is
  4079.      "ref", which is a C reference program.
  4080.  
  4081. -DCC_COMMAND=string -DMAKE_COMMAND=string -DERRLIST=string
  4082.      These control the names of the C compiler,  the  "make"
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092. 11-3                       CFLAGS                       11-3
  4093.  
  4094.  
  4095.      utility, and the error output file, respectively.  They
  4096.      are only used if -DNO_ERRLIST is not given.
  4097.  
  4098.      The default value of CC_COMMAND depends on the  Operat-
  4099.      ing  System and compiler that you use to compile elvis;
  4100.      for UNIX, the default is "cc".  The default  values  of
  4101.      MAKE_COMMAND  and  ERRLIST  are  "make"  and "errlist",
  4102.      respectively.
  4103.  
  4104. -DMAXRCLEN=number
  4105.      This determines how large a :@  macro  command  can  be
  4106.      (measured  in  bytes).   The default is 1000 bytes.  If
  4107.      you increase this value  significantly,  then  you  may
  4108.      need  to  allocate extra memory for the stack.  See the
  4109.      "CHMEM" setting in the Makefile.
  4110.  
  4111. -DSHELL=string
  4112.      This is the default value of the  "shell"  option,  and
  4113.      hence  the  default shell used from within Elvis.  This
  4114.      only controls the default; the value you give here  may
  4115.      be  overridden  at  run-time  by setting an environment
  4116.      variable named SHELL  (or  COMSPEC  for  MS-DOS).   Its
  4117.      value  must  be  a string constant, so be careful about
  4118.      quoting.
  4119.  
  4120. -DMAILER=string
  4121.      This is the name of the program that Elvis uses to send
  4122.      mail  to  a  user  whose  text has just been preserved.
  4123.      (See the manual page for the elvprsv program.)  If your
  4124.      system doesn't use electronic mail, then this option is
  4125.      irrelevant.  For UNIX and  OS-9  systems,  though,  the
  4126.      value  should be a quoted string.  The default value is
  4127.      "mail", but SysV users may prefer to use  "mailx",  and
  4128.      BSD users may prefer "Mail".
  4129.  
  4130. -DTAGS=string
  4131.      This sets the name of the "tags" file, which is used by
  4132.      the :tag command.  Its value must be a string constant,
  4133.      so be careful about quoting.
  4134.  
  4135. -DCS_IBMPC -DCS_LATIN1 -DCS_SPECIAL
  4136.      The  digraph  table  and  flipcase option will normally
  4137.      start out empty.  However, if  you  add  -DCS_IBMPC  or
  4138.      -DCS_LATIN1  to  your  CFLAGS, then they will start out
  4139.      filled with values that are appropriate for the IBM  PC
  4140.      character set or the ISO Latin-1 character set, respec-
  4141.      tively.
  4142.  
  4143.      You can also use -DCS_IBMPC and  -DCS_SPECIAL  together
  4144.      to  get  digraphs that produce the PC's graphic charac-
  4145.      ters.
  4146.  
  4147. -DDEBUG -DEBUG2
  4148.      -DDEBUG adds the ":debug" and ":validate" commands, and
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158. 11-4                       CFLAGS                       11-4
  4159.  
  4160.  
  4161.      also   adds   many  internal  consistency  checks.   It
  4162.      increases the size of the ".text" segment by about  6K.
  4163.  
  4164.      -DDEBUG2  causes a line to be appended to a file called
  4165.      "debug.out" everytime any change is made  to  the  edit
  4166.      buffer.
  4167.  
  4168. -DCRUNCH
  4169.      This flag removes some non-critical code, so that Elvis
  4170.      is smaller.  For example, it removes a  short-cut  from
  4171.      the  regexp  package, so that text searches are slower.
  4172.      Also, screen updates are not as efficient.  A couple of
  4173.      obscure features are disabled by this, too.
  4174.  
  4175. -DNO_MKEXRC
  4176.      This removes the ":mkexrc" command, so you have to cre-
  4177.      ate any .exrc files manually.  The size  of  the  .text
  4178.      segment will be reduced by about 1500 bytes.
  4179.  
  4180. -DNO_CHARATTR
  4181.      Permanently disables the charattr option.  This reduces
  4182.      the size of your ".text" segment by about 850 bytes.
  4183.  
  4184. -DNO_RECYCLE
  4185.      Normally, Elvis will recycle space (from the  temporary
  4186.      file)  which contains totally obsolete text.  This flag
  4187.      disables  this  recycling.   Without   recycling,   the
  4188.      ".text"  segment is about 1K smaller than it would oth-
  4189.      erwise be, but the tmp file grows much faster.  If  you
  4190.      have  a  lot of free space on your hard disk, but Elvis
  4191.      is too bulky to run with recycling, then try it without
  4192.      recycling.
  4193.  
  4194.      When  using  a  version of Elvis that has been compiled
  4195.      with -DNO_RECYCLE, you should be careful to avoid  mak-
  4196.      ing  many small changes to a file because each individ-
  4197.      ual change will cause the tmp file to grow by at  least
  4198.      1k.  Hitting "x" thirty times counts as thirty changes,
  4199.      but typing "30x"  counts  as  one  change.   Also,  you
  4200.      should  occasionally  do  a  ":w" followed by a ":e" to
  4201.      start with a fresh tmp file.
  4202.  
  4203.      Interestingly, the real vi never  recycles  space  from
  4204.      its temporary file.
  4205.  
  4206. -DNO_SENTENCE
  4207.      Leaves out the "(" and ")" visual mode commands.  Also,
  4208.      the "[[", "]]", "{", and "}" commands will  not  recog-
  4209.      nize *roff macros.  The sections and paragraphs options
  4210.      go away.  This saves about 650  bytes  in  the  ".text"
  4211.      segment.
  4212.  
  4213. -DNO_CHARSEARCH
  4214.      Leaves  out  the  visual  commands which locate a given
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224. 11-5                       CFLAGS                       11-5
  4225.  
  4226.  
  4227.      character in the current line: "f", "t", "F", "T",  ","
  4228.      and ";".  This saves about 900 bytes.
  4229.  
  4230. -DNO_EXTENSIONS
  4231.      Leaves  out the "K" and "#" visual commands.  Also, the
  4232.      arrow keys will no longer work in input mode.   Regular
  4233.      expressions will no longer recognize the \{\} operator.
  4234.      (Other extensions are either inherent in the design  of
  4235.      Elvis, or are controlled by more specific flags, or are
  4236.      too tiny to be worth removing.)  This saves  about  250
  4237.      bytes.
  4238.  
  4239. -DNO_MAGIC
  4240.      Permanently  disables  the "magic" option, so that most
  4241.      meta-characters in a regular expression are *NOT*  rec-
  4242.      ognized.   This  saves about 3k of space in the ".text"
  4243.      segment, because the complex  regular  expression  code
  4244.      can be replaced by much simpler code.
  4245.  
  4246. -DNO_SHOWMODE
  4247.      Permanently  disables  the  "showmode"  option,  saving
  4248.      about 250 bytes.
  4249.  
  4250. -DNO_CURSORSHAPE
  4251.      Normally, Elvis tries to adjust the shape of the cursor
  4252.      as   a   reminder   of   which  mode  you're  in.   The
  4253.      -DNO_CURSORSHAPE flag disables this, saving  about  150
  4254.      bytes.
  4255.  
  4256. -DNO_DIGRAPH
  4257.      To  allow entry of non-ASCII characters, Elvis supports
  4258.      digraphs.  A digraph is a single (non-ASCII)  character
  4259.      which  is entered as a combination of two other (ASCII)
  4260.      characters.  If you don't need to input non-ASCII char-
  4261.      acters,  or  if  your keyboard supports a better way of
  4262.      entering non-ASCII characters, then you can disable the
  4263.      digraph code and save about 450 bytes.
  4264.  
  4265. -DNO_ERRLIST
  4266.      Elvis  adds  a  ":errlist"  command, which is useful to
  4267.      programmers.  If you don't need this feature,  you  can
  4268.      disable it via the -DNO_ERRLIST flag.  This will reduce
  4269.      the .text segment by about 900 bytes, and the .bss seg-
  4270.      ment by about 300 bytes.
  4271.  
  4272. -DNO_ABBR
  4273.      The  -DNO_ABBR  flag  disables the ":abbr" command, and
  4274.      reduces the size of Elvis by about 250 bytes.
  4275.  
  4276. -DNO_OPTCOLS
  4277.      When Elvis displays the current  options  settings  via
  4278.      the  ":set"  command,  the  options are normally sorted
  4279.      into columns.  The -DNO_OPTCOLS flag causes the options
  4280.      to be sorted across the rows, which is much simpler for
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290. 11-6                       CFLAGS                       11-6
  4291.  
  4292.  
  4293.      the computer.  The -DNO_OPTCOLS flag  will  reduce  the
  4294.      size of your .text segment by about 500 bytes.
  4295.  
  4296. -DNO_MODELINES
  4297.      This removes all support for modelines.
  4298.  
  4299. -DNO_TAG
  4300.      This  disables  tag lookup.  It reduces the size of the
  4301.      .text segment by about 750 bytes.
  4302.  
  4303. -DNO_TAGSTACK
  4304.      This disables the tagstack.  The ^T and  :pop  commands
  4305.      will no longer be available.
  4306.  
  4307. -DNO_ALT_FKEY, -DNO_CTRL_FKEY, -DNO_SHIFT_FKEY, -DNO_FKEY
  4308.      These   remove   explicit  support  of  function  keys.
  4309.      -DNO_ALT_FKEY removes support for the <alternate>  ver-
  4310.      sions  function  keys.   -DNO_CTRL_FKEY removes support
  4311.      for the <control>  and  <alternate>  versions  function
  4312.      keys.  -DNO_SHIFT_FKEY removes support for the <shift>,
  4313.      <control>,  and  <alternate>  versions  function  keys.
  4314.      -DNO_FKEY removes all support of function keys.
  4315.  
  4316.      Elvis's  ":map"  command normally allows you to use the
  4317.      special sequence "#<n>" to map function key  <n>.   For
  4318.      example,  ":map #1 {!}fmt^M" will cause the <F1> key to
  4319.      reformat a paragraph.  Elvis checks the :k1=: field  in
  4320.      the  termcap description of your terminal to figure out
  4321.      what code is sent by  the  <F1>  key.   This  is  handy
  4322.      because it allows you to create a .exrc file which maps
  4323.      function keys the same way regardless of what  type  of
  4324.      terminal you use.
  4325.  
  4326.      That  behavior is standard; most implementations of the
  4327.      real vi supports it too.  Elvis extends this  to  allow
  4328.      you  to  use  "#1s"  to refer to <shift>+<F1>, "#1c" to
  4329.      refer  to  <control>+<F1>,  and  "#1a"  to   refer   to
  4330.      <alt>+<F1>.   The  termcap description for the terminal
  4331.      should have fields named :s1=:c1=:a1=: respectively, to
  4332.      define  the  code sent by these key combinations.  (You
  4333.      should also have :k2=:s2=:c2=:a2=: for  the  <F2>  key,
  4334.      and so on.)
  4335.  
  4336.      But  there  may  be  problems.   The  terminfo database
  4337.      doesn't support :s1=:c1=:a1=:, so no terminfo  terminal
  4338.      description  could ever support shift/control/alt func-
  4339.      tion keys; so you might as well add -DNO_SHIFT_FKEY  to
  4340.      CFLAGS if you're using terminfo.
  4341.  
  4342.      Note  that,  even if you have -DNO_FKEYS, you can still
  4343.      configure Elvis to use your function  keys  my  mapping
  4344.      the  literal character codes sent by the key.  You just
  4345.      couldn't do it in a terminal-independent way.
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356. 11-7                       CFLAGS                       11-7
  4357.  
  4358.  
  4359. -DTERM_925, -DTERM_AMIGA, -DTERM_VT100, -DTERM_VT52, etc.
  4360.      The tinytcap.c file contains  descriptions  of  several
  4361.      terminal  types.  For each system that uses tinytcap, a
  4362.      reasonable subset  of  the  available  descriptions  is
  4363.      actually  compiled  into Elvis.  If you wish to enlarge
  4364.      this  subset,  then  you  can   add   the   appropriate
  4365.      -DTERM_XXX flag to your CFLAGS settings.
  4366.  
  4367.      For  a  list of the available terminal types, check the
  4368.      tinytcap.c file.
  4369.  
  4370. -DINTERNAL_TAGS
  4371.      Normally, Elvis uses the "ref" program to  perform  tag
  4372.      lookup.   This  is more powerful than the real vi's tag
  4373.      lookup, but it can be much slower.
  4374.  
  4375.      If you add -DINTERNAL_TAGS to your CFLAGS setting, then
  4376.      Elvis  will use its own internal tag lookup code, which
  4377.      is faster.
  4378.  
  4379. -DPRSVDIR=directory
  4380.      This controls where preserved files will be placed.  An
  4381.      appropriate  default has been chosen for each Operating
  4382.      System, so you probably don't need to worry about it.
  4383.  
  4384. -DFILEPERMS=number
  4385.      This affects the attributes of files that  are  created
  4386.      by  Elvis;  it  is  used  as the second argument to the
  4387.      creat() function.  The default is 0666 which  (on  UNIX
  4388.      systems  at least) means that anybody can read or write
  4389.      the new file, but nobody can execute it.  On UNIX  sys-
  4390.      tems, the creat() call modifies this via the umask set-
  4391.      ting.
  4392.  
  4393. -DKEYBUFSIZE=number
  4394.      This determines the size of the type-ahead buffer  that
  4395.      elvis uses.  It also limits the size of keymaps that it
  4396.      can handle.  The  default  is  1000  characters,  which
  4397.      should be plenty.
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425. 12.  TERMCAP
  4426.  
  4427.      Elvis  uses  fairly  standard  termcap  fields for most
  4428. things.  I invented the cursor shape names and some  of  the
  4429. function  key names, but other than that there should be few
  4430. surprises.
  4431.  
  4432.  
  4433. Required numeric fields
  4434.  
  4435.      :co#:       number of columns on the screen (chars per line)
  4436.      :li#:       number of lines on the screen
  4437.  
  4438.  
  4439.      On many systems, Elvis has other ways to find  out  how
  4440. many  rows and columns your screen can show, so these values
  4441. might not be very relevent.  If these numbers  aren't  given
  4442. in  your termcap entry, and Elvis can't find the screen size
  4443. any other way, then it will default to 80x24.
  4444.  
  4445.  
  4446. Required string fields
  4447.  
  4448.      :ce=:       clear to end-of-line
  4449.      :cm=:       move the cursor to a given row/column
  4450.      :up=:       move the cursor up one line
  4451.  
  4452.  
  4453.      If these fields are missing, then Elvis will still  run
  4454. fairly well in "ex" mode, but "vi" mode requires these capa-
  4455. bilities as an absolute minimum.
  4456.  
  4457.  
  4458. Boolean fields
  4459.  
  4460.      :am:        auto margins - wrap when char is written in last column?
  4461.      :xn:        brain-damaged auto margins - newline ignored after wrap
  4462.      :pt:        physical tabs?
  4463.  
  4464.  
  4465.  
  4466. Optional string fields
  4467.  
  4468.      :al=:       insert a blank row on the screen
  4469.      :cl=:       home the cursor & clear the screen
  4470.      :dl=:       delete a row from the screen
  4471.      :cd=:       clear to end of display
  4472.      :ei=:       end insert mode
  4473.      :ic=:       insert a blank character
  4474.      :im=:       start insert mode
  4475.      :dc=:       delete a character
  4476.      :sr=:       scroll reverse (insert row at top of screen)
  4477.      :vb=:       visible bell
  4478.      :ks=:       keypad enable
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488. 12-2                       TERMCAP                      12-2
  4489.  
  4490.  
  4491.      :ke=:       keypad disable
  4492.      :ti=:       terminal initialization string, to start full-screen mode
  4493.      :te=:       terminal termination, to end full-screen mode
  4494.  
  4495.  
  4496.  
  4497. Optional strings received from the keyboard
  4498.  
  4499.      :kd=:       sequence sent by the <down arrow> key
  4500.      :kl=:       sequence sent by the <left arrow> key
  4501.      :kr=:       sequence sent by the <right arrow> key
  4502.      :ku=:       sequence sent by the <up arrow> key
  4503.      :kP=:       sequence sent by the <PgUp> key
  4504.      :kN=:       sequence sent by the <PgDn> key
  4505.      :kh=:       sequence sent by the <Home> key
  4506.      :kH=:       sequence sent by the <End> key
  4507.      :kI=:       sequence sent by the <Insert> key
  4508.  
  4509.  
  4510.      Originally, termcap  didn't  have  any  names  for  the
  4511. <PgUp>,  <PgDn>, <Home>, and <End> keys.  Although the capa-
  4512. bility names shown in the table above are the  most  common,
  4513. they  are  not  universal.  SCO Xenix uses :PU=:PD=:HM=:EN=:
  4514. for those keys.  Also, if the four arrow keys happen  to  be
  4515. part  of  a  3x3 keypad, then the five non-arrow keys may be
  4516. named :K1=: through :K5=:, so an  IBM  PC  keyboard  may  be
  4517. described  using those names instead.  Elvis can find any of
  4518. these names.
  4519.  
  4520.  
  4521. Optional strings sent by function keys
  4522.  
  4523.      :k1=:...:k9=:k0=:   codes sent by <F1> through <F10> keys
  4524.      :s1=:...:s9=:s0=:   codes sent by <Shift F1> ... <Shift F10>
  4525.      :c1=:...:c9=:c0=:   codes sent by <Ctrl F1> ... <Ctrl F10>
  4526.      :a1=:...:a9=:a0=:   codes sent by <Alt F1> ... <Alt F10>
  4527.  
  4528.  
  4529.      Note that :k0=: is used  to  describe  the  <F10>  key.
  4530. Some  termcap  documents  recommend  :ka=: or even :k;=: for
  4531. describing the <F10> key, but Elvis doesn't support that.
  4532.  
  4533.      Also, the :s1=:..., :c1=:..., and  :a1=:...  codes  are
  4534. very  non-standard.   The  terminfo  library doesn't support
  4535. them.  Consequently, if you're using  the  terminfo  library
  4536. then  you  might  as well add -DNO_SHIFT_FKEY to your CFLAGS
  4537. setting.
  4538.  
  4539.  
  4540. Optional fields that describe character attributes
  4541.  
  4542.      :so=:se=:   start/end standout mode (We don't care about :sg#:)
  4543.      :us=:ue=:   start/end underlined mode
  4544.      :md=:me=:   start/end boldface mode
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554. 12-3                       TERMCAP                      12-3
  4555.  
  4556.  
  4557.      :as=:ae=:   start/end alternate character set (italics)
  4558.      :ug#:       visible gap left by :us=:ue=:md=:me=:as=:ae=:
  4559.  
  4560.  
  4561.  
  4562. Optional fields that affect the cursor's shape
  4563.  
  4564.      The :cQ=: string is used by  Elvis  immediately  before
  4565. exiting  to  undo  the  effects  of  the  other cursor shape
  4566. strings.  If :cQ=: is not given, then all other cursor shape
  4567. strings are ignored.
  4568.  
  4569.      :cQ=:       normal cursor
  4570.      :cX=:       cursor used for reading EX command
  4571.      :cV=:       cursor used for reading VI commands
  4572.      :cI=:       cursor used during VI input mode
  4573.      :cR=:       cursor used during VI replace mode
  4574.  
  4575.  
  4576.      If the capabilities above aren't given, then Elvis will
  4577. try to use the following values instead.
  4578.  
  4579.      :ve=:       normal cursor, used as :cQ=:cX=:cI=:cR=:
  4580.      :vs=:       gaudy cursor, used as :cV=:
  4581.  
  4582.  
  4583.  
  4584. An example
  4585.  
  4586.      Here's the termcap entry I use on my Minix-ST system.
  4587.  
  4588.  
  4589. mx|minix|minixst|ansi:\
  4590.      :is=\E[0~:co#80:li#25:bs:pt:\
  4591.      :cm=\E[%i%d;%dH:up=\E[A:do=^J:nd=\E[C:sr=\EM:\
  4592.      :cd=\E[J:ce=\E[K:cl=\E[H\E[J:\
  4593.      :al=\E[L:dl=\E[M:ic=\E[@:dc=\E[P:im=:ei=:\
  4594.      :so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:\
  4595.      :md=\E[1m:me=\E[m:as=\E[1;3m:ae=\E[m:\
  4596.      :ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:\
  4597.      :k1=\E[1~:k2=\E[2~:k3=\E[3~:k4=\E[4~:k5=\E[5~:\
  4598.      :k6=\E[6~:k7=\E[17~:k8=\E[18~:k9=\E[19~:k0=\E[20~:
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623. 13.  ENVIRONMENT VARIABLES
  4624.  
  4625.      Elvis  examines  several  environment variables when it
  4626. starts up.  The values of these variables  are  used  inter-
  4627. nally  for  a variety of purposes.  You don't need to define
  4628. all of these; on most systems, Elvis only requires  TERM  to
  4629. be  defined.   On AmigaDOS, MS-DOS or TOS systems, even that
  4630. is optional.
  4631.  
  4632. TERM, TERMCAP
  4633.      TERM tells Elvis the name of the termcap entry to  use.
  4634.      TERMCAP may contain either the entire termcap entry, or
  4635.      the  full  pathname  of  the  termcap  file  to  search
  4636.      through.
  4637.  
  4638.      If  your  version of Elvis is using tinytcap instead of
  4639.      the full termcap library, then  the  value  of  TERMCAP
  4640.      can't  be the name of a file; it can only be undefined,
  4641.      or contain the entire termcap entry.   In  the  termcap
  4642.      entry,  tinytcap will convert \E to an <Esc> character,
  4643.      but other backslash escapes (\b,  \r,  etc.)  or  carat
  4644.      escapes  (^[,  ^M, etc.)  will not be converted to con-
  4645.      trol characters.  Instead, you should embed the  actual
  4646.      control character into the string.
  4647.  
  4648. TMP, TEMP
  4649.      These  only  work  for  AmigaDOS, MS-DOS and Atari TOS.
  4650.      Either of these  variables  may  be  used  to  set  the
  4651.      "directory"  option,  which  controls  where  temporary
  4652.      files are stored.  If you define them both, then TMP is
  4653.      used, and TEMP is ignored.
  4654.  
  4655. LINES, COLUMNS
  4656.      The  termcap entry for your terminal should specify the
  4657.      size of your  screen.   If  you're  using  a  windowing
  4658.      interface,  then  there  is  an ioctl() call which will
  4659.      provide the size of the window; the ioctl() values will
  4660.      override  the  values  in the termcap entry.  The LINES
  4661.      and COLUMNS environment  variables  (if  defined)  will
  4662.      override  either  of these sources.  They, in turn, can
  4663.      be overridden by a ":set" command.
  4664.  
  4665.      Normally, the LINES  and  COLUMNS  variables  shouldn't
  4666.      need to be defined.
  4667.  
  4668. EXINIT
  4669.      This  variable's  value  may contain one or more colon-
  4670.      mode commands, which will be executed  instead  of  the
  4671.      ".exrc"  file  in your home directory.  before interac-
  4672.      tive editing begins.
  4673.  
  4674.      To put more than one command in EXINIT, you  can  sepa-
  4675.      rate  the commands with either a newline or a '|' char-
  4676.      acter.
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686. 13-2                ENVIRONMENT VARIABLES               13-2
  4687.  
  4688.  
  4689. SHELL, COMSPEC
  4690.      You can use COMSPEC in MS-DOS, or SHELL  in  any  other
  4691.      system,  to specify which shell should be used for exe-
  4692.      cuting commands and expanding wildcards.
  4693.  
  4694. HOME This variable should give the  full  pathname  of  your
  4695.      home  directory.   Elvis needs to know the name of your
  4696.      home directory so it can locate the ".exrc" file there.
  4697.  
  4698. TAGPATH
  4699.      This  variable  is  used by the "ref" program.  It con-
  4700.      tains a list of directories that might contain a  rele-
  4701.      vant "tags" file.  Under AmigaDOS, MS-DOS or Atari TOS,
  4702.      the names of the directories  should  be  separated  by
  4703.      semicolons  (";").   Under other operating systems, the
  4704.      names should be separated by colons (":").
  4705.  
  4706.      If you don't define TAGPATH,  then  "ref"  will  use  a
  4707.      default list which includes the current directory and a
  4708.      few other likely places.  See the definition of DEFTAG-
  4709.      PATH at the start of ref.c for an accurate list.
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755. 14.  VERSIONS
  4756.  
  4757.      Elvis  currently  works  under  BSD UNIX, AT&T System-V
  4758. UNIX,  SCO  XENIX,  Minix,  Coherent,  MS-DOS,  Atari   TOS,
  4759. OS9/68k,  VAX/VMS,  AmigaDos, and OS/2.  This section of the
  4760. manual provides special information  that  applies  to  each
  4761. particular version of Elvis.
  4762.  
  4763.      For all versions except MS-DOS and VMS, the file "Make-
  4764. file.mix" should be copied to "Makefile", and then edited to
  4765. select the correct set of options for your system.  There is
  4766. more information about this embedded in the file itself.
  4767.  
  4768. 14.1.  BSD UNIX
  4769.  
  4770.      Temporary files are stored in /tmp.
  4771.  
  4772.      You should modify /etc/rc so that the  temp  files  are
  4773. preserved  when  the  system  is  rebooted.   Find a line in
  4774. /etc/rc which reads
  4775.  
  4776.      ex4.3preserve /tmp
  4777.  
  4778. or something like that, and append the following line:
  4779.  
  4780.      elvprsv /tmp/elv*
  4781.  
  4782.      If you do not have permission to modify /etc/rc,  don't
  4783. fret.  The above modification is only needed to allow you to
  4784. recover your changes after a system crash.   You  can  still
  4785. run  Elvis  without  that  modification,  and  you can still
  4786. recover your changes when Elvis crashes or when your  dialup
  4787. modem  looses  the  carrier  signal, or something like that.
  4788. Only a system crash or power failure could hurt you.
  4789.  
  4790.      Both Elvis and the real Vi read initialization commands
  4791. from  a  file  called ".exrc", but the commands in that file
  4792. might work on one editor but not the  other.   For  example,
  4793. "set  keywordprg=man"  will work for Elvis, but Vi will com-
  4794. plain because it doesn't have a "keywordprg" option.  If the
  4795. warning  messages  annoy  you,  then you can edit the CFLAGS
  4796. setting in the Makefile and add -DEXRC=\".elvisrc\".
  4797.  
  4798.      If you use X windows, you may wish to add "-DCS_LATIN1"
  4799. to  CFLAGS.  This will cause the digraph table and the flip-
  4800. case option to have default values that are appropriate  for
  4801. the  LATIN-1  character  set.  That's the standard character
  4802. set for X.
  4803.  
  4804.      The default mailer used notify users when text is  pre-
  4805. server  is  "mail".   You  may wish to change this to "Mail"
  4806. (with an uppercase 'M').  See the description of "MAILER" in
  4807. the CFLAGS section of this manual.
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818. 14-2                      VERSIONS                      14-2
  4819.  
  4820.  
  4821.      The default keyboard macro time-out value is larger for
  4822. BSD than it is for some  other  systems,  because  I've  had
  4823. trouble running Elvis via rlogin or Xterm.  I guess it takes
  4824. a while for those keystokes to squirt through the net.
  4825.  
  4826. 14.2.  System-V UNIX
  4827.  
  4828.      Most SysV UNIX systems use terminfo instead of termcap,
  4829. but  the  terminfo  library  doesn't seem to have a standard
  4830. name.  As shipped, Elvis' Makefile.mix  is  configured  with
  4831. "LIBS=-ltermcap".    You   may   need   to   change   it  to
  4832. "LIBS=-lterm" or "LIBS=-lterminfo" or even  "LIBS=-lcurses".
  4833.  
  4834.      The /etc/rc file (or its equivalent) should be modified
  4835. as described for BSD systems, above.  There's a pretty  good
  4836. chance  that  "make  install" will do this for you; it knows
  4837. how to create an editor  recovery  file  in  the  /etc/rc2.d
  4838. directory,  which  is  where  most modern SysV systems store
  4839. initialization commands.  You only need to  do  it  manually
  4840. for older SysV systems.
  4841.  
  4842.      The  potential trouble with ".exrc" described above for
  4843. BSD UNIX applies to System-V UNIX as well.
  4844.  
  4845.      The default mailer used notify users when text is  pre-
  4846. server  is  "mail".  You may wish to change this to "mailx".
  4847. See the description of "MAILER" in  the  CFLAGS  section  of
  4848. this manual.
  4849.  
  4850.      Elvis  uses control-C as the interrupt key, not Delete.
  4851. This was done so that the <Del> key could be used for  char-
  4852. acter deletion.
  4853.  
  4854. 14.3.  SCO Xenix
  4855.  
  4856.      For  Xenix-386,  you  can use the generic System-V set-
  4857. tings.  You may wish to add "-DCS_IBMPC" to CFLAGS, to  have
  4858. the  digraph  table  and  flipcase option start up in a mode
  4859. that is appropriate for the console.  Also, note that  there
  4860. is  a separate group of settings for use with Xenix-286.  It
  4861. already has "-DCS_IBMPC" in CFLAGS.
  4862.  
  4863.      Because Xenix is so similar to System-V,  everything  I
  4864. said  earlier  about  System-V  applies to the Xenix version
  4865. too, except that editor recovery might belong in a directory
  4866. called /etc/rc.d/8 instead.
  4867.  
  4868. 14.4.  Minix
  4869.  
  4870.      There  are separate settings in Makefile.mix for Minix-
  4871. PC and Minix-68k.  The differences  between  these  two  are
  4872. that the 68k version uses ".o" for the object file extension
  4873. where the PC version uses ".s", and the PC version has  some
  4874. extra  flags  in CFLAGS to reduce the size of Elvis.  The PC
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884. 14-3                      VERSIONS                      14-3
  4885.  
  4886.  
  4887. version also uses tinytcap (instead of the full termcap)  to
  4888. make it smaller.
  4889.  
  4890.      Minix-PC  users  should read the CFLAGS section of this
  4891. manual very carefully.  You have some choices to make...
  4892.  
  4893.      The  temporary  files  are  stored  in  /usr/tmp.   The
  4894. /usr/tmp  directory  must exist before you run Elvis, and it
  4895. must be readable & writable by everybody.  We  use  /usr/tmp
  4896. instead  of /tmp because after a system crash or power fail-
  4897. ure, you can recover the altered version of a file from  the
  4898. temporary  file  in  /usr/tmp.   If  it  was stored in /tmp,
  4899. though, then it would  be  lost  because  /tmp  is  normally
  4900. located  on the RAM disk.  Also, you'll need a /usr/preserve
  4901. directory which is readable & writable by root; this  direc-
  4902. tory  is  used  to store text files that have been preserved
  4903. after a crash.  The "make install" script will create it  if
  4904. necessary.
  4905.  
  4906.      Elvis  uses control-C as the interrupt key, not Delete.
  4907.  
  4908. 14.5.  Coherent
  4909.  
  4910.      Elvis was ported to Coherent by Esa Ahola.
  4911.  
  4912.      Elvis is too large to run  under  Coherent  unless  you
  4913. eliminate  some features via the CFLAGS setting.  The recom-
  4914. mended settings, in Makefile.mix, produce a working  version
  4915. of Elvis which emulates Vi faithfully, but lacks most of the
  4916. extensions.  You should read the CFLAGS section of this man-
  4917. ual carefully.
  4918.  
  4919.      You  can  probably  reduce  the  size of Elvis by using
  4920. tinytcap.c instead of -lterm.  This would allow you to  keep
  4921. most  features of Elvis, at the expense of terminal indepen-
  4922. dence.  (Tinytcap.c has  ANSI  escape  sequences  hard-coded
  4923. into  it.)   To  use  tinytcap, just add "tinytcap.o" to the
  4924. "EXTRA=" line in the Makefile, and remove "-lterm" from  the
  4925. "LIBS=" line.
  4926.  
  4927.      The  temporary  files  are  stored  in /tmp.  Preserved
  4928. files are stored in /usr/preserve.  You should  modify  your
  4929. /etc/rc  file to support file preservation; add the line ...
  4930.  
  4931.      /usr/bin/elvprsv /tmp/*
  4932.  
  4933.  ... just before the first "/bin/rm" line.
  4934.  
  4935. 14.6.  Linux
  4936.  
  4937.      The Makefile.mix file has a special section of  options
  4938. for  Linux.   There should be no surprises.  Linux is mostly
  4939. SysV-ish, so the SysV comments above will apply to Linux  as
  4940. well, except that most Linux systems still have an old-style
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950. 14-4                      VERSIONS                      14-4
  4951.  
  4952.  
  4953. /etc/rc file.  You should add the command ...
  4954.  
  4955.      /usr/bin/elvprsv /tmp/*
  4956.  
  4957.  ... in there somewhere.  On my SLS 1.02 system, I added  it
  4958. near  the  end,  just before the line that runs the shell on
  4959. "/etc/rc.local".
  4960.  
  4961. 14.7.  MS-DOS
  4962.  
  4963.      Elvis was ported to MS-DOS by Guntram Blohm and  Martin
  4964. Patzel.   Willett Kempton added support for the DEC Rainbow.
  4965.  
  4966.      Ideally, Elvis should be compiled with Microsoft C 5.10
  4967. and  the  standard  Microsoft  Make utility, via the command
  4968. "make elvis.mak".  This will compile Elvis and  all  related
  4969. utilities.
  4970.  
  4971.      With  Microsoft  C 6.00, you may have trouble compiling
  4972. regexp.c.  If so, try compiling it without optimization.
  4973.  
  4974.      The "Makefile.mix" file contains  a  set  of  suggested
  4975. settings for compiling Elvis with Turbo-C or Borland C.  (If
  4976. you have Turbo-C, but not the Make  utility,  then  you  can
  4977. almost  use  the  "Elvis.prj" file to compile Elvis, but you
  4978. must  explicitly  force  Turbo-C  to  compile  it  with  the
  4979. "medium" memory model.  Most of the related programs [ctags,
  4980. ref, virec, refont, and wildcard] are only one file long, so
  4981. you  should  have no trouble compiling them.)  The "alias.c"
  4982. file is meant to be compiled once into an  executable  named
  4983. "ex.exe".   You  should  then  copy "ex.exe" to "vi.exe" and
  4984. "view.exe".
  4985.  
  4986.      Elvis stores its temporary files in C:\tmp.  If this is
  4987. not  satisfactory,  then  you should edit the CFLAGS line of
  4988. your Makefile to change TMPDIR to something else before com-
  4989. piling.  You can also control the name of the temp directory
  4990. via an environment variable named TMP or TEMP.   The  direc-
  4991. tory must exist before you can run Elvis.
  4992.  
  4993.      The TERM environment variable determines how Elvis will
  4994. write to the screen.  It can be set to any one of  the  fol-
  4995. lowing values:
  4996.  
  4997.                pcbios    Use BIOS calls on an IBM-PC clone.
  4998.                rainbow   Use DEC Rainbow interface.
  4999.                ansi      Use ANSI.SYS driver.
  5000.                nansi     User faster NANSI.SYS driver.
  5001.  
  5002.  
  5003.      If  the  TERM variable isn't set, then Elvis will auto-
  5004. matically select either the "rainbow" interface (when run on
  5005. a Rainbow) or "pcbios" (on an IBM clone).
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016. 14-5                      VERSIONS                      14-5
  5017.  
  5018.  
  5019.      You  may  prefer to use NANSI.SYS for speed; or you may
  5020. NEED to use ANSI.SYS for a non-clone, such as a lap-top.  If
  5021. so,  you  should  install  one  of  these  drivers by adding
  5022. "driver = nansi.sys" (or whatever) to your CONFIG.SYS  file,
  5023. and  then you should define TERM to be "nansi" (or whatever)
  5024. by adding "set TERM=nansi" to your AUTOEXEC.BAT  file.   You
  5025. must  then  reboot  for these changes to take effect.  After
  5026. that, Elvis will notice  the  "TERM"  setting  and  use  the
  5027. driver.
  5028.  
  5029.      Since  ".exrc" is not a valid DOS filename, the name of
  5030. the initialization file  has  been  changed  to  "elvis.rc".
  5031. Elvis  will  look  for an "elvis.rc" file first in your home
  5032. directory.  If it exists, and  contains  ":set  exrc",  then
  5033. Elvis  will  check  for  another  "elvis.rc"  in the current
  5034. directory.   By  default,  the  directory  where   ELVIS.EXE
  5035. resides  is  taken to be your home directory.  You can over-
  5036. ride this default by setting an environment  variable  named
  5037. "HOME"  to the full pathname of your home directory.  To set
  5038. "HOME", you would typically add the following line  to  your
  5039. AUTOEXEC.BAT file:
  5040.      set HOME c:\
  5041.  
  5042.      An  extra program, called "wildcard", is needed for MS-
  5043. DOS.  It expands wildcard  characters  in  file  names.   If
  5044. Elvis  flashes  a  "Bad command or filename" message when it
  5045. starts, then you've probably lost the  WILDCARD.EXE  program
  5046. somehow.
  5047.  
  5048.      Elvis  can  run under Windows, but you may have trouble
  5049. with TEMP.  Windows uses an environment variable called TEMP
  5050. which  interferes  with Elvis' usage of TEMP; to work around
  5051. this, you can simply set an environment variable  named  TMP
  5052. (with  no  'E')  to  the name of Elvis' temporary directory.
  5053. When TEMP and TMP are both set, Elvis uses TMP  and  ignored
  5054. TEMP.
  5055.  
  5056.      In a ":set" command, the backslash character is used to
  5057. "escape" the character that follows it.  To make a backslash
  5058. be  part of a string option's value, you must enter a double
  5059. backslash.  For example, to define the directory where  tem-
  5060. porary files will exist, you could add ":set dir=C:\\tmp" to
  5061. your ELVIS.RC file.  Just plain ":set dir=C:\tmp" (with  one
  5062. backslash) won't work!.
  5063.  
  5064. 14.8.  Atari TOS
  5065.  
  5066.      Elvis was ported to Atari TOS by Guntram Blohm and Mar-
  5067. tin Patzel.  It is very similar to the MS-DOS  version.   It
  5068. has  been  tested with the Mark Williams C compiler and also
  5069. GNU-C.
  5070.  
  5071.      The TERM environment variable is ignored; the  ST  port
  5072. always  assumes  that  TERM=vt52.   The SHELL (not COMSPEC!)
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082. 14-6                      VERSIONS                      14-6
  5083.  
  5084.  
  5085. variable should be set to the name of a line-oriented shell.
  5086.  
  5087.      A  simple  shell in included with Elvis.  Its source is
  5088. in "shell.c", and the name of the executable is "shell.ttp".
  5089. The  file  "profile.sh" should contain a set of instructions
  5090. to be executed when the shell first starts up.   An  example
  5091. of this file is included, but you will almost certainly want
  5092. to edit it right away to match your configuration.  (If  you
  5093. already have a command-line shell, then you'll probably want
  5094. to continue using it.  The shell that comes  with  Elvis  is
  5095. very limited.)
  5096.  
  5097.      Currently,  character attributes cannot be displayed on
  5098. the screen.
  5099.  
  5100.      Elvis runs under MiNT (a free  multi-tasking  extension
  5101. to  TOS)  but  it  can  be a CPU hog because of the way that
  5102. Elvis reads from the keyboard  with  timeout.   Also,  Elvis
  5103. doesn't  use  any  of  the special features of MiNT.  I have
  5104. received a set of patches that optimize Elvis for MiNT,  but
  5105. they arrived too late to integrate into this release.
  5106.  
  5107. 14.9.  OS9/68k
  5108.  
  5109.      Elvis was ported to OS9/68k by Peter Reinig.
  5110.  
  5111.      The  Makefile  is currently configured to install Elvis
  5112. and the related programs in /dd/usr/cmds  If  this  this  is
  5113. unacceptable, then you should change the BIN setting to some
  5114. other directory.  Similarly, it expects the source  code  to
  5115. reside  in  /dd/usr/src/elvis;  the  ODIR setting is used to
  5116. control this.
  5117.  
  5118.      Temporary files are stored in  the  /dd/tmp  directory.
  5119. Your  /dd/startup file may need to be modified to prevent it
  5120. from deleting Elvis' temporary files; make  /dd/startup  run
  5121. the elvprsv program before it wipes out /dd/tmp.
  5122.  
  5123.      The  program in alias.c is linked repeatedly to produce
  5124. the "vi", "view", and "input" aliases for Elvis.  Sadly, the
  5125. "ex"  alias is impossible to implement under OS9 because the
  5126. shell has a built-in command by that name.
  5127.  
  5128.      For some  purposes,  you  must  give  `make'  the  "-b"
  5129. option.  Specifically, you need this for "make -b clean" and
  5130. "make -b install".
  5131.  
  5132. 14.10.  VAX/VMS
  5133.  
  5134.      John Campbell ported Elvis to VAX/VMS.
  5135.  
  5136.      A heavily laden VAX can take half an  hour  to  compile
  5137. Elvis.  This is normal.  Don't panic.
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148. 14-7                      VERSIONS                      14-7
  5149.  
  5150.  
  5151.      While  running,  Elvis  will  create temporary files in
  5152. SYS$SCRATCH.  Enter SHOW LOGICAL  SYS$SCRATCH  to  see  what
  5153. actual directory you are using.  Many sites have SYS$SCRATCH
  5154. equivalenced to SYS$LOGIN.  The Elvis temporary  files  look
  5155. like the following on VMS while Elvis is running:
  5156.        ELV_1123A.1;1       ELV_1123A.2;1       SO070202.;1
  5157.  
  5158.      Also,  filtering commands (like !!dir and !}fmt) should
  5159. work on VMS.  This assumes, however,  that  you  can  create
  5160. temporary  mailboxes  and  that your mailbox quota (a sysgen
  5161. parameter) is at least 256 bytes for a single write  to  the
  5162. mailbox.   This  is  the  default sysgen parameter, so there
  5163. should be few people who experience filter problems.
  5164.  
  5165.      Additionally, an attempt was made to support the  stan-
  5166. dard  terminals  on  VMS: "vt52", "vt100", "vt200", "vt300",
  5167. "vt101", "vt102".  Non-standard terminals could be supported
  5168. by  setting  your  terminal type to UNKNOWN (by entering SET
  5169. TERM/UNKNOWN) and  defining  the  logical  name  ELVIS_TERM.
  5170. Whatever  ELVIS_TERM translates to, however, will have to be
  5171. included in tinytcap.c.  Note that the upper/lowercase  dis-
  5172. tinctions are significant, and that DCL will upshift charac-
  5173. ters that are not quoted strings, so enter DEFINE ELVIS_TERM
  5174. "hp2621a".   As distributed, it would probably not be a good
  5175. idea to have more than the standard terminals in  tinytcap.c
  5176. (else  it  wouldn't  be  tiny, would it?).  Changes here, of
  5177. course, would require a recompilation to take effect.
  5178.  
  5179.      If you have a version  of  the  "termcap"  library  and
  5180. database on your system, then you may wish to replace tinyt-
  5181. cap with the real termcap.
  5182.  
  5183. 14.11.  AmigaDOS
  5184.  
  5185.      Mike Rieser and Dale Rahn ported Elvis to AmigaDOS.
  5186.  
  5187.      The port was done using  Manx  Aztec  C  version  5.2b.
  5188. Elvis  uses about as much space as it can and still be small
  5189. code and data.  Elvis should also compile under DICE, though
  5190. there  may  be  a little trouble with signed versus unsigned
  5191. chars.
  5192.  
  5193.      The port has been done so  the  same  binary  will  run
  5194. under both versions of AmigaDOS.  Under AmigaDOS 2.04, Elvis
  5195. supports all the  documented  features.   It  also  uses  an
  5196. external program ref to do tag lookup.  So, the accompanying
  5197. programs: ref and ctags  are  recommended.   Under  AmigaDOS
  5198. 1.2/1.3  Elvis works, buts lacks the more advanced features.
  5199.  
  5200.      For the port to AmigaDOS 2.04, we tried to use as  many
  5201. Native  AmigaDOS  calls  as  we could.  This should increase
  5202. Elvis's chances at  being  compiled  with  other  compilers.
  5203. DICE  seems  to have a different default char type.  You may
  5204. need to use the UCHAR() macro in tio.c.  To test it, try the
  5205.  
  5206.  
  5207.  
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214. 14-8                      VERSIONS                      14-8
  5215.  
  5216.  
  5217. :map command; if it looks right, things are cool.
  5218.  
  5219.      For the port to AmigaDOS 1.3, we tried to make sure the
  5220. program was at least usable.   Many  features  are  missing,
  5221. most  notably  running commands in subshells.  Also, what we
  5222. could get working, we used Aztec functions to support  them,
  5223. so this part is little more compiler dependent.
  5224.  
  5225.      Aztec  is  compatible  with the SAS libcall #pragma.  I
  5226. personally prefer using the includes  that  come  from  Com-
  5227. modore  over  the  ones  supplied with Aztec, but for people
  5228. with a straight Aztec installation, I went with the  default
  5229. names for the Aztec pragmas.
  5230.  
  5231.      One  include you'll need is <sys/types.h>.  It's a com-
  5232. mon include when porting software just  make  yourself  one.
  5233. It's  a  two line file that saves a lot of hassle especially
  5234. in the Elvis  source.   So,  make  a  directory  where  your
  5235. includes  are  located called `sys' and in a file below that
  5236. type:
  5237.         /* sys/types.h */
  5238.         #include <exec/types.h>
  5239.  
  5240.      When setting environment  variables  (either  local  or
  5241. global)  for  variables  that specify a directory, make sure
  5242. the variable ends in `:' or `/'.  This saved from having  to
  5243. change  much  of the way Elvis works.  The default temporary
  5244. directory (if TEMP and TMP aren't specified) is  "T:".   The
  5245. default  if  HOME directory (if no HOME environment variable
  5246. is set) is "S:".
  5247.  
  5248.      To avoid conflict with other uses, Elvis uses  elvis.rc
  5249. instead of .exrc or where it looks for macros.
  5250.  
  5251. 14.12.  OS/2 2.x
  5252.  
  5253.      Elvis  was  ported  to  OS/2  by  Kai Uwe Rommel.  Greg
  5254. Roelofs fixed some generic bugs and added various tweaks and
  5255. VIO  features not supported by OS/2's ANSI emulation.  Elvis
  5256. was ported  using  the  emx  port  of  the  GNU  C  compiler
  5257. ("emx+gcc"); other OS/2 compilers (including the gcc/2 port)
  5258. will probably not work due to their lack of termcap support.
  5259. If  you use emx 0.8f or earlier, you will need to change the
  5260. -Zmtd option to -Zmt in Makefile.mix, as noted in  the  com-
  5261. ment there.
  5262.  
  5263.      The  port  is  derived from the MS-DOS port, so most of
  5264. the MS-DOS comments should still be valid.   In  particular,
  5265. the  default  pathnames for the temp directory and preserva-
  5266. tion directory are  the  same,  and  wildcard.exe  is  used.
  5267. (emx's  _wildcard()  function  is  [optionally] used in most
  5268. places, but ex.c still calls the "standard" wildcard() func-
  5269. tion.)
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280. 14-9                      VERSIONS                      14-9
  5281.  
  5282.  
  5283.      Note  that  the  executables are dynamically linked, so
  5284. you'll need EMX.DLL and EMXLIBC.DLL somewhere in  your  LIB-
  5285. PATH.   These  are  included with executables-only distribu-
  5286. tions and, of course, with emx itself.  You'll also  need  a
  5287. termcap.dat  file  in  a  location pointed at by the TERMCAP
  5288. variable; again, one is supplied.   Set  the  TERM  variable
  5289. equal to one of the listed termcap entries such as "ansi" or
  5290. "pcbios".
  5291.  
  5292.      Finally, note that the VIO features mentioned above are
  5293. not enabled by default.  Without them, Elvis uses only term-
  5294. cap codes for screen  updates  and  can  therefore  be  used
  5295. remotely  (e.g., in a telnet session).  If you're working at
  5296. the OS/2 system console, however, the VIO  features  can  be
  5297. enabled via a special Elvis variable, "viomode" (abbreviated
  5298. "vm").  Although it can be used interactively to enable most
  5299. of  the  new features (smooth backscrolling, cursor shape in
  5300. insert  mode,  shorter  beeps),  enabling  both  the   auto-
  5301. detection  of  ANSI mode (plus setting it, if necessary) and
  5302. the restoration of screen colors requires the  EXINIT  vari-
  5303. able  to  be  set.   (By  the  time Elvis is running and the
  5304. interactive command is given, it's too late  for  such  ini-
  5305. tializations.)  For example, add "set EXINIT=set viomode" to
  5306. your config.sys file; this will take effect at the next OS/2
  5307. reboot.
  5308.  
  5309. 14.13.  Other Systems
  5310.  
  5311.      For  SunOS  and  Solaris 1.x, use the BSD settings; for
  5312. Solaris 2.x, use the SysV  settings.   Earlier  versions  of
  5313. Elvis  didn't link correctly due to a quirk in Sun's version
  5314. of the "make" utility, but this version of Elvis has a work-
  5315. around  for that quirk so you should have no trouble at all.
  5316.  
  5317.      For AIX, use the SysV settings  in  Makefile.mix,  with
  5318. the changes suggested by comments there.
  5319.  
  5320.      For other UNIXoid systems, I suggest you start with the
  5321. Minix-68k settings and then grow from that.  Minix is a nice
  5322. starting  point  because  it  is  a clone of Version 7 UNIX,
  5323. which was the last common ancestor  of  BSD  UNIX  and  SysV
  5324. UNIX.   Any  operating system which claims any UNIX compati-
  5325. bility whatsoever will therefore support V7/Minix code.  You
  5326. may  need  to  fiddle with #include directives or something,
  5327. though.  Minix-68k is a better starting point than  Minix-PC
  5328. because the PC compiler has some severe quirks.
  5329.  
  5330.      If  you're  thinking  of porting Elvis to some non-UNIX
  5331. system, I suggest you begin by studying the "INTERNALS" sec-
  5332. tion of this manual.
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346. 14-10                     VERSIONS                     14-10
  5347.  
  5348.  
  5349. 14.14.  X Windows Notes
  5350.  
  5351.      Normally,  you  can  use the mouse to select text in an
  5352. xterm window and/or paste it as though  it  had  been  typed
  5353. into  that  window.  Elvis changes this behavior; when elvis
  5354. is running in an xterm, any mouse click will just  move  the
  5355. cursor.   To  perform  the normal xterm select & paste while
  5356. elvis is running, you must hold the  <Shift>  key  when  you
  5357. make the selection or paste it.
  5358.  
  5359.      If  you resize the window, elvis will notice the change
  5360. and make any necessary changes.  (Earlier versions of  elvis
  5361. didn't update the value of the "window" option, resulting in
  5362. '@' signs appearing  on  the  screen.   This  has  now  been
  5363. fixed.)
  5364.  
  5365.  
  5366.  
  5367.  
  5368.  
  5369.  
  5370.  
  5371.  
  5372.  
  5373.  
  5374.  
  5375.  
  5376.  
  5377.  
  5378.  
  5379.  
  5380.  
  5381.  
  5382.  
  5383.  
  5384.  
  5385.  
  5386.  
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.  
  5394.  
  5395.  
  5396.  
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.  
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415. 15.  QUESTIONS & ANSWERS
  5416.  
  5417.  
  5418. 1)  How can I make Elvis run faster under DOS?
  5419.  
  5420.        There are several things you can do.  The first thing
  5421.        to do is get a good screen driver such as  NANSI.SYS.
  5422.        This  can  speed  up screen redrawing by as much as a
  5423.        factor of eight!  The DOS-specific part of section 12
  5424.        tells you how to do this.
  5425.  
  5426.        You  might  also  consider  reducing  the size of the
  5427.        blocks that Elvis uses.   You'll  need  to  recompile
  5428.        Elvis  to do this.  The default BLKSIZE is 2048 bytes
  5429.        for the DOS version of Elvis, which  means  that  for
  5430.        each  keystroke  that you insert, Elvis must shift an
  5431.        average of about 1000 bytes.  That's  a  lot  to  ask
  5432.        from  a little old 5MHz 8088.  A BLKSIZE of 512 bytes
  5433.        might be more appropriate.
  5434.  
  5435.        A "write-back" disk cache can help.  DOS 5.0 and Win-
  5436.        dows 3.0 come with one of these, called SMARTDRV.EXE.
  5437.        I suggest you add "SMARTDRV C+" to your  AUTOEXEC.BAT
  5438.        file.
  5439.  
  5440.        If  you're really desperate for more speed, you might
  5441.        want to make Elvis store its temporary files on a RAM
  5442.        disk.   However, this limits the size of the file you
  5443.        can edit, and it eliminates any chance you  may  have
  5444.        had  to  recover  your  work after a power failure or
  5445.        system crash, but it might be worth it;  you  decide.
  5446.        To  do this, add ":set dir=R:\" (or whatever your RAM
  5447.        disk's name is) to the elvis.rc file.
  5448.  
  5449.        Next, consider turning off the "sync"  option.   When
  5450.        the  sync  option  is turned on, Elvis will close the
  5451.        temporary file and reopen it after every  change,  in
  5452.        order  to  force  DOS  to update the file's directory
  5453.        entry.  If you put ":set nosync"  into  the  elvis.rc
  5454.        file,  then  Elvis  will only close the file when you
  5455.        start editing a different text file, or  when  you're
  5456.        exiting Elvis.  Consequently, there is no chance that
  5457.        you'll be able to recover your changes after a  power
  5458.        failure... so if you're going to this, then you might
  5459.        as well store the temp files on the RAM disk, too.
  5460.  
  5461.  
  5462. 2)  Why isn't Elvis reading my .exrc (or ELVIS.RC) file?
  5463.  
  5464.        For security reasons, Elvis doesn't normally look for
  5465.        a  .exrc  file  in  the  current  directory.  A mean-
  5466.        spirited person could lay a trap by placing a danger-
  5467.        ous command in a .exrc file in some public directory.
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475.  
  5476.  
  5477.  
  5478. 15-2                 QUESTIONS & ANSWERS                15-2
  5479.  
  5480.  
  5481.        If you know for a fact that no such person  has  ever
  5482.        used  your  computer, then you can make elvis process
  5483.        the .exrc file from the current directory  by  adding
  5484.        "set exrc" to either your EXINIT environment variable
  5485.        or to the .exrc file in your home directory.
  5486.  
  5487.  
  5488. 3)  What is my home directory?
  5489.  
  5490.        On UNIX systems, each user is given a private  "home"
  5491.        directory.   Among other uses, this is used for stor-
  5492.        ing personal configuration files for use with various
  5493.        programs.   UNIX  stores  the  pathname  of your home
  5494.        directory in an environment variable called "HOME".
  5495.  
  5496.        DOS doesn't have UNIX-style home directories, but  if
  5497.        you  explicitly  set  HOME to the name of some direc-
  5498.        tory, then Elvis will still  look  for  its  ELVIS.RC
  5499.        file  there.   If HOME is unset, then elvis will look
  5500.        for ELVIS.RC in the same  directory  where  ELVIS.EXE
  5501.        was found.
  5502.  
  5503.  
  5504. 4)  Where's the <Esc> key on a DEC keyboard?
  5505.  
  5506.        I don't know.  Maybe the <F11> key?  Maybe Control-3?
  5507.        You could always use ":map!" to make some  other  key
  5508.        act like the <Esc> key.  If all else fails, try <Con-
  5509.        trol-[>.
  5510.  
  5511.  
  5512. 5)  Is there a way to show which keys do what?
  5513.  
  5514.        Yes.  The command ":map" will show what each key does
  5515.        in  command  mode,  and  ":map!" (with an exclamation
  5516.        mark) shows what each key does in input mode.
  5517.  
  5518.        The table is divided into three  columns:  the  key's
  5519.        label,  the characters that it sends, and the charac-
  5520.        ters that Elvis pretends you typed.
  5521.  
  5522.  
  5523. 6)  How can I make Elvis display long lines  like  the  real
  5524.     vi?
  5525.  
  5526.        You can't yet.  The next version of Elvis should sup-
  5527.        port this, though.
  5528.  
  5529.  
  5530. 7)  I can't recover my text [under  MS-DOS  or  Atari  TOS].
  5531.     According  to  the directory listing, the temporary file
  5532.     is 0 bytes long.  What went wrong?
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544. 15-3                 QUESTIONS & ANSWERS                15-3
  5545.  
  5546.  
  5547.        MS-DOS and TOS only update a file's  directory  entry
  5548.        when the file is closed.  If the system crashes while
  5549.        the file is still open, then  the  file's  length  is
  5550.        stored  as  0  bytes.  The ":set sync" option is sup-
  5551.        posed to prevent this; you probably turned it off  in
  5552.        the interest of speed, right?
  5553.  
  5554.        Under  MS-DOS  [I  don't  know about TOS], you should
  5555.        delete  the  empty  temporary  file,  and  then   run
  5556.        CHKDSK/F.   This might find the data that belonged in
  5557.        the empty file, and place it in a  new  file  with  a
  5558.        name  like  "000001.CHK" -- something like that.  You
  5559.        can then try to extract the text from that  temporary
  5560.        file  by  giving the command "elvprsv -R 000001.chk".
  5561.        If you're lucky, then this might recover your text.
  5562.  
  5563.  
  5564. 8)  What is the most current version of Elvis?
  5565.  
  5566.        Each version of Elvis that is released to the  public
  5567.        has  a  version number of the form "number point num-
  5568.        ber".  As I write this, the most current  version  of
  5569.        Elvis is 1.8pl3.
  5570.  
  5571.        The  intermediate  steps  between one release and the
  5572.        next are labeled with the next version number, with a
  5573.        letter   appended.    For   example,  after  1.4  was
  5574.        released, I started working on 1.5a.  I am  currently
  5575.        working  on 2.0a.  When Elvis reaches a stable state,
  5576.        I'll call it 2.0 and release it.
  5577.  
  5578.        Sometimes a beta-test version of Elvis will be avail-
  5579.        able  via  anonymous FTP from m2xenix.psg.com, in the
  5580.        directory "pub/elvis/beta".
  5581.  
  5582.  
  5583. 9)  I only got executables, but now I want the source  code.
  5584.     Where can I get it?
  5585.  
  5586.        If  you  have access to the Internet, then you should
  5587.        be able to fetch it from one of the  public  archives
  5588.        such  as  plains.nodak.edu.   It  is  accessible  via
  5589.        anonymous FTP, or via an email server named "archive-
  5590.        server@plains.nodak.edu".   Elvis  is  located in the
  5591.        directory "/pub/Minix/all.contrib".
  5592.  
  5593.        It is also available from the C Users' Group, in vol-
  5594.        ume  #365.   As  I write this, they are asking $4 per
  5595.        disk plus $3.50  per  order  in  the  US,  and  elvis
  5596.        requires  three  disks;  this  is  subject to change.
  5597.        Their phone  number  is  (913)  841-1631,  and  their
  5598.        address is:
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610. 15-4                 QUESTIONS & ANSWERS                15-4
  5611.  
  5612.  
  5613.                                 The C Users' Group
  5614.                                 1601 W. 23rd Street, #200
  5615.                                 Lawrence  KS  66046-2743
  5616.  
  5617.  
  5618.  
  5619. 10) Is this shareware, or public domain, or what?
  5620.  
  5621.        It  is  not  public  domain; it is copyrighted by me,
  5622.        Steve Kirkendall.  However, this  particular  version
  5623.        is  freely  redistributable, in either source form or
  5624.        executable form.   (I  would  prefer  that  you  give
  5625.        copies  away  for free, complete with the full source
  5626.        code... but I'm not going to force you.)
  5627.  
  5628.        It is not shareware; you aren't expected to  send  me
  5629.        anything.  You can use it without guilt.
  5630.  
  5631.        It is not "copylefted."  I hold a copyright, but cur-
  5632.        rently I have not added any of the usual restrictions
  5633.        that  you would find on copylefted software.  If peo-
  5634.        ple start doing really  obnoxious  things  to  Elvis,
  5635.        then  I  will start adding restrictions to subsequent
  5636.        versions, but earlier  versions  won't  be  affected.
  5637.        (So far, everybody has been pretty good about this so
  5638.        no restrictions have been necessary.)
  5639.  
  5640.  
  5641. 11) Can I reuse parts of your source code?
  5642.  
  5643.        Yes.  Please be careful, though, to  make  sure  that
  5644.        the  code  really is mine.  Some of the code was con-
  5645.        tributed by  other  people,  and  I  don't  have  the
  5646.        authority  to  give  you  permission  to use it.  The
  5647.        author's name can be  found  near  the  top  of  each
  5648.        source  file.  If it says "Steve Kirkendall" then you
  5649.        may use  it;  otherwise,  you'd  better  contact  the
  5650.        author first.
  5651.  
  5652.        Please don't remove my name from the source code.  If
  5653.        you modify the source, please make  a  note  of  that
  5654.        fact  in  a  comment near the top of the source code.
  5655.        And, finally, please mention my name in your documen-
  5656.        tation.
  5657.  
  5658.  
  5659. 12) Can Elvis work with non-ASCII files?
  5660.  
  5661.        Elvis  is  8-bit  clean.   This means that Elvis will
  5662.        allow you to edit files that use a European  extended
  5663.        ASCII character set.  However, some terminals are not
  5664.        8-bit clean;  they  treat  characters  in  the  range
  5665.        0x80-0x9f  as  control characters.  Elvis expects all
  5666.        characters  above  0x7f  to  be  treated  as   normal
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676. 15-5                 QUESTIONS & ANSWERS                15-5
  5677.  
  5678.  
  5679.        displayable  characters,  so on these terminals Elvis
  5680.        may produce a scrambled display.
  5681.  
  5682.        Elvis can't edit binary files because it can't handle
  5683.        the NUL character, and because of line-length limita-
  5684.        tions.
  5685.  
  5686.        Elvis has also modified to work with 16-bit character
  5687.        sets,  but that modification is not part of the stan-
  5688.        dard    Elvis    distribution.     Yongguang    Zhang
  5689.        (ygz@cs.purdue.edu)  has created a Chinese version of
  5690.        Elvis that uses  16-bit  characters  and  runs  under
  5691.        cxterm   (Chinese   X-term)   on  X-windows  systems.
  5692.        Junichiro Itoh (itojun@foretune.co.jp)  has  modified
  5693.        Elvis to edit Japanese text under MS-DOS.
  5694.  
  5695.  
  5696.  
  5697.  
  5698.  
  5699.  
  5700.  
  5701.  
  5702.  
  5703.  
  5704.  
  5705.  
  5706.  
  5707.  
  5708.  
  5709.  
  5710.  
  5711.  
  5712.  
  5713.  
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745. NAME
  5746.        ctags - Generates "tags" and (optionally) "refs" files
  5747.  
  5748. SYNOPSIS
  5749.        ctags [-BSstvraT] filesnames...
  5750.  
  5751. DESCRIPTION
  5752.        ctags  generates  the "tags" and "refs" files from a group
  5753.        of C source files.  The "tags"  file  is  used  by  Elvis'
  5754.        ":tag"  command,  control-]  command,  and -t option.  The
  5755.        "refs" file is sometimes used by the ref(1) program.
  5756.  
  5757.        Each C source file is scanned for #define  statements  and
  5758.        global  function  definitions.   The  name of the macro or
  5759.        function becomes the name of a tag.  For each tag, a  line
  5760.        is added to the "tags" file which contains:
  5761.                      - the name of the tag
  5762.                      - a tab character
  5763.                      - the name of the file containing the tag
  5764.                      - a tab character
  5765.                      - a way to find the particular line within the file.
  5766.  
  5767.        The  filenames  list  will typically be the names of all C
  5768.        source files in the current directory, like this:
  5769.               $ ctags -stv *.[ch]
  5770.  
  5771. OPTIONS
  5772.        -B     Normally, ctags  encloses  regular  expressions  in
  5773.               slashes  (/regexp/)  which  causes  elvis to search
  5774.               from the top of the file.  The -B flag causes ctags
  5775.               to  enclose  the  regular  expressions  in question
  5776.               marks (?regexp?) so elvis will search backward from
  5777.               the bottom of the file.  This rarely matters.
  5778.  
  5779.        -t     Include typedefs.  A tag will be generated for each
  5780.               user-defined type.  Also tags will be generated for
  5781.               struct  and enum names.  Types are considered to be
  5782.               global if they are defined in a  header  file,  and
  5783.               static if they are defined in a C source file.
  5784.  
  5785.        -v     Include  variable declarations.  A tag will be gen-
  5786.               erated for each variable, except for those that are
  5787.               declared inside the body of a function.
  5788.  
  5789.        -s     Include  static  tags.   Ctags  will  normally  put
  5790.               global tags in the "tags" file, and silently ignore
  5791.               the  static tags.  This flag causes both global and
  5792.               static tags to be added.  The name of a static  tag
  5793.               is  generated by prefixing the name of the declared
  5794.               item with the name of the file where it is defined,
  5795.               with  a  colon  in  between.   For example, "static
  5796.               foo(){}"  in  "bar.c"  results  in  a   tag   named
  5797.               "bar.c:foo".
  5798.  
  5799.  
  5800.  
  5801.  
  5802.                                                                 1
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808. CTAGS(1)                                                 CTAGS(1)
  5809.  
  5810.  
  5811.        -S     Include static tags, but make them look like global
  5812.               tags.  Most  tags-aware  programs  don't  like  the
  5813.               "filename:tagname" tags produced by the -s flag, so
  5814.               -S was added as an alternative.  If elvis  and  ref
  5815.               are the only programs that read the tags file, then
  5816.               you don't need -S; otherwise you do.
  5817.  
  5818.        -r     This causes  ctags  to  generate  both  "tags"  and
  5819.               "refs".  Without -r, it would only generate "tags".
  5820.  
  5821.        -a     Append to  "tags",  and  maybe  "refs".   Normally,
  5822.               ctags  overwrites  these  files  each  time  it  is
  5823.               invoked.  This flag is useful when you have to many
  5824.               files in the current directory for you to list them
  5825.               on a single command-line; it allows  you  to  split
  5826.               the arguments among several invocations.
  5827.  
  5828.        -T     This flag isn't available on all systems.  UNIX has
  5829.               it, but most others don't.  The  -T  flag  prevents
  5830.               ctags  from generating a "tags" file.  This is use-
  5831.               ful when you want  to  generate  a  "refs"  without
  5832.               changing "tags".
  5833.  
  5834. FILES
  5835.        tags   A  cross-reference  that  lists  each tag name, the
  5836.               name of the source file that contains it, and a way
  5837.               to locate a particular line in the source file.
  5838.  
  5839.        refs   The  "refs"  file contains the definitions for each
  5840.               tag in the "tags" file, and very little else.  This
  5841.               file  can  be  useful,  for example, when licensing
  5842.               restrictions prevent you  from  making  the  source
  5843.               code  to  the standard C library readable by every-
  5844.               body, but you still everybody to  know  what  argu-
  5845.               ments the library functions need.
  5846.  
  5847. BUGS
  5848.        ctags  is  sensitive to indenting and line breaks.  Conse-
  5849.        quently, it might not discover all of the tags in  a  file
  5850.        that is formatted in an unusual way.
  5851.  
  5852. SEE ALSO
  5853.        elvis(1), refs(1)
  5854.  
  5855. AUTHOR
  5856.        Steve Kirkendall
  5857.        kirkenda@cs.pdx.edu
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.                                                                 2
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877. NAME
  5878.        elvis, ex, vi, view, input - The editor
  5879.  
  5880. SYNOPSIS
  5881.        elvis [flags] [+cmd] [files...]
  5882.  
  5883. DESCRIPTION
  5884.        Elvis is a text editor which emulates vi/ex.
  5885.  
  5886.        On  systems  which  pass  the program name as an argument,
  5887.        such as Unix and Minix, you may also install  elvis  under
  5888.        the  names  "ex",  "vi", "view", and "input".  These extra
  5889.        names would normally be links to elvis; see the "ln" shell
  5890.        command.
  5891.  
  5892.        When  elvis  is  invoked  as  "vi",  it behaves exactly as
  5893.        though it was invoked as "elvis".  However, if you  invoke
  5894.        elvis as "view", then the readonly option is set as though
  5895.        you had given it the "-R" flag.  If you  invoke  elvis  as
  5896.        "ex",  then  elvis will start up in the colon command mode
  5897.        instead of the visual command  mode,  as  though  you  had
  5898.        given it the "-e" flag.  If you invoke elvis as "input" or
  5899.        "edit", then elvis will start up in input mode, as  though
  5900.        the "-i" flag was given.
  5901.  
  5902. OPTIONS
  5903.        -r     To  the  real  vi,  this flag means that a previous
  5904.               edit should be recovered.   Elvis,  though,  has  a
  5905.               separate  program, called elvrec(1), for recovering
  5906.               files.  When you invoke elvis with -r,  elvis  will
  5907.               tell you to run elvrec.
  5908.  
  5909.        -R     This sets the "readonly" option, so you won't acci-
  5910.               dentally overwrite a file.
  5911.  
  5912.        -s     This set the "safer" option,  which  disables  many
  5913.               potentially harmful commands.  It has not been rig-
  5914.               orously proven to be absolutely secure, however.
  5915.  
  5916.        -t tag This causes elvis to start  editing  at  the  given
  5917.               tag.
  5918.  
  5919.        -m [file]
  5920.               Elvis  will  search through file for something that
  5921.               looks like an error message from  a  compiler.   It
  5922.               will then begin editing the source file that caused
  5923.               the error, with the  cursor  sitting  on  the  line
  5924.               where the error was detected.  If you don't explic-
  5925.               itly name a file, then "errlist" is assumed.
  5926.  
  5927.        -e     Elvis will start up in colon command mode.
  5928.  
  5929.        -v     Elvis will start up in visual command mode.
  5930.  
  5931.  
  5932.  
  5933.  
  5934.                                                                 1
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940. ELVIS(1)                                                 ELVIS(1)
  5941.  
  5942.  
  5943.        -i     Elvis will start up in input mode.
  5944.  
  5945.        -w winsize
  5946.               Sets the "window" option's value to winsize.
  5947.  
  5948.        +command or -c command
  5949.               If you use the +command parameter, then  after  the
  5950.               first  file  is loaded command is executed as an EX
  5951.               command.  A typical example would  be  "elvis  +237
  5952.               foo",  which would cause elvis to start editing foo
  5953.               and then move directly to line 237.  The  "-c  com-
  5954.               mand"  variant  was added for UNIX SysV compatibil-
  5955.               ity.
  5956.  
  5957. FILES
  5958.        /tmp/elv*
  5959.               During editing, elvis stores text  in  a  temporary
  5960.               file.   For  UNIX, this file will usually be stored
  5961.               in the /tmp directory, and the first three  charac-
  5962.               ters  will be "elv".  For other systems, the tempo-
  5963.               rary files may be stored someplace  else;  see  the
  5964.               version-specific section of the documentation.
  5965.  
  5966.        tags   This  is the database used by the :tags command and
  5967.               the -t  option.   It  is  usually  created  by  the
  5968.               ctags(1) program.
  5969.  
  5970.        .exrc or elvis.rc
  5971.               On UNIX-like systems, a file called ".exrc" in your
  5972.               home directory is executed as a series of  ex  com-
  5973.               mands.   A file by the same name may be executed in
  5974.               the current directory, too.  On  non-UNIX  systems,
  5975.               ".exrc" is usually an invalid file name; there, the
  5976.               initialization file is called "elvis.rc" instead.
  5977.  
  5978. ENVIRONMENT
  5979.        TERM   This is the name of your terminal's  entry  in  the
  5980.               termcap  or  terminfo  database.  The list of legal
  5981.               values varies from one system to another.
  5982.  
  5983.        TERMCAP
  5984.               Optional.  If your system  uses  termcap,  and  the
  5985.               TERMCAP variable is unset, then
  5986.                will   read   your   terminal's   definition  from
  5987.               /etc/termcap.  If TERMCAP is set to the full  path-
  5988.               name  of  a  file  (starting with a '/') then  will
  5989.               look in the named file instead of /etc/termcap.  If
  5990.               TERMCAP  is set to a value which doesn't start with
  5991.               a '/', then its value is assumed  to  be  the  full
  5992.               termcap entry for your terminal.
  5993.  
  5994.        TERMINFO
  5995.               Optional.   If  your  system uses terminfo, and the
  5996.               TERMINFO variable is unset, then
  5997.  
  5998.  
  5999.  
  6000.                                                                 2
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006. ELVIS(1)                                                 ELVIS(1)
  6007.  
  6008.  
  6009.                will read  your  terminal's  definition  from  the
  6010.               database  in  the  /usr/lib/terminfo  database.  If
  6011.               TERMINFO is set, then its  value  is  used  as  the
  6012.               database  name to use instead of /usr/lib/terminfo.
  6013.  
  6014.        LINES, COLUMNS
  6015.               Optional.  These variables, if set,  will  override
  6016.               the   screen   size   values  given  in  the  term-
  6017.               cap/terminfo for your terminal.  On windowing  sys-
  6018.               tems  such as X,  has other ways of determining the
  6019.               screen size, so you  should  probably  leave  these
  6020.               variables unset.
  6021.  
  6022.        EXINIT Optional.  This variable can hold EX commands which
  6023.               will be executed instead of the .exrc file in  your
  6024.               home directory.
  6025.  
  6026.        SHELL  Optional.   The  SHELL  variable  sets  the default
  6027.               value for  the  "shell"  option,  which  determines
  6028.               which  shell  program  is  used to perform wildcard
  6029.               expansion in file names, and also which is used  to
  6030.               execute  filters or external programs.  The default
  6031.               value on UNIX systems is "/bin/sh".
  6032.  
  6033.               Note: Under MS-DOS, this variable is called COMSPEC
  6034.               instead of SHELL.
  6035.  
  6036.        HOME   This  variable  should  be  set to the name of your
  6037.               home directory.
  6038.                looks for its initialization file there;  if  HOME
  6039.               is  unset  then the initialization file will not be
  6040.               executed.
  6041.  
  6042.        TAGPATH
  6043.               Optional.  This variable is used by the "ref"  pro-
  6044.               gram,  which  is invoked by the shift-K, control-],
  6045.               and :tag commands.  See "ref" for more information.
  6046.  
  6047.        TMP, TEMP
  6048.               These  optional environment variables are only used
  6049.               in non-UNIX versions of .  They allow you to supply
  6050.               a  directory  name to be used for storing temporary
  6051.               files.
  6052.  
  6053. SEE ALSO
  6054.        ctags(1), ref(1), elvprsv(1), elvrec(1)
  6055.  
  6056.        Elvis - A Clone of Vi/Ex, the  complete  elvis  documenta-
  6057.        tion.
  6058.  
  6059. BUGS
  6060.        There  is  no  LISP  support.   Certain other features are
  6061.        missing, too.
  6062.  
  6063.  
  6064.  
  6065.  
  6066.                                                                 3
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072. ELVIS(1)                                                 ELVIS(1)
  6073.  
  6074.  
  6075.        Auto-indent mode is not quite compatible with the real vi.
  6076.        Among  other  things,  0^D and ^^D don't do what you might
  6077.        expect.
  6078.  
  6079.        Long lines are displayed differently.  The real  vi  wraps
  6080.        long  lines  onto  multiple  rows of the screen, but elvis
  6081.        scrolls sideways.
  6082.  
  6083. AUTHOR
  6084.        Steve Kirkendall
  6085.        kirkenda@cs.pdx.edu
  6086.  
  6087.        Many other people have worked to  port  elvis  to  various
  6088.        operating  systems.   To  see who deserves credit, run the
  6089.        :version command from within elvis, or look in the system-
  6090.        specific section of the complete documentation.
  6091.  
  6092.  
  6093.  
  6094.  
  6095.  
  6096.  
  6097.  
  6098.  
  6099.  
  6100.  
  6101.  
  6102.  
  6103.  
  6104.  
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111.  
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.                                                                 4
  6133.  
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141. NAME
  6142.        elvprsv  -  Preserve  the  the  modified version of a file
  6143.        after a crash.
  6144.  
  6145. SYNOPSIS
  6146.        elvprsv ["-why elvis died"] /tmp/filename...
  6147.        elvprsv -R /tmp/filename...
  6148.  
  6149. DESCRIPTION
  6150.        elvprsv preserves your edited text after elvis dies.   The
  6151.        text can be recovered later, via the elvprsv program.
  6152.  
  6153.        For  UNIX-like  systems, you should never need to run this
  6154.        program from the command line.  It  is  run  automatically
  6155.        when  elvis  is  about  to  die, and it should be run (via
  6156.        /etc/rc) when the computer is booted.  THAT'S ALL!
  6157.  
  6158.        For non-UNIX systems such as MS-DOS or VMS, you can either
  6159.        use elvprsv the same way as under UNIX systems (by running
  6160.        it from your AUTOEXEC.BAT file), or you can run  it  sepa-
  6161.        rately  with  the  "-R"  flag  to recover the files in one
  6162.        step.
  6163.  
  6164.        If you're editing a file when elvis dies (due  to  a  bug,
  6165.        system crash, power failure, etc.)  then elvprsv will pre-
  6166.        serve the most recent version of your text.  The preserved
  6167.        text  is  stored in a special directory; it does NOT over-
  6168.        write your text file automatically.  (If the  preservation
  6169.        directory  hasn't been set up correctly, then elvprsv will
  6170.        simply send you a mail message descrining how to  manually
  6171.        run elvprsv.)
  6172.  
  6173.        elvprsv  will  send  mail  to  any user whose work it pre-
  6174.        serves, if your operating system normally supports mail.
  6175.  
  6176. FILES
  6177.        /tmp/elv*
  6178.               The temporary file that elvis  was  using  when  it
  6179.               died.
  6180.  
  6181.        /usr/preserve/p*
  6182.               The text that is preserved by elvprsv.
  6183.  
  6184.        /usr/preserve/Index
  6185.               A  text file which lists the names of all preserved
  6186.               files, and the names of the /usr/preserve/p*  files
  6187.               which contain their preserved text.
  6188.  
  6189. BUGS
  6190.        Due  to the permissions on the /usr/preserve directory, on
  6191.        UNIX systems elvprsv must be run as  superuser.   This  is
  6192.        accomplished  by making the elvprsv executable be owned by
  6193.        "root" and turning on its "set user id" bit.
  6194.  
  6195.  
  6196.  
  6197.  
  6198.                                                                 1
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204. ELVPRSV(1)                                             ELVPRSV(1)
  6205.  
  6206.  
  6207.        If you're editing a nameless buffer when elvis dies,  then
  6208.        elvprsv will pretend that the file was named "foo".
  6209.  
  6210. AUTHOR
  6211.        Steve Kirkendall
  6212.        kirkenda@cs.pdx.edu
  6213.  
  6214.  
  6215.  
  6216.  
  6217.  
  6218.  
  6219.  
  6220.  
  6221.  
  6222.  
  6223.  
  6224.  
  6225.  
  6226.  
  6227.  
  6228.  
  6229.  
  6230.  
  6231.  
  6232.  
  6233.  
  6234.  
  6235.  
  6236.  
  6237.  
  6238.  
  6239.  
  6240.  
  6241.  
  6242.  
  6243.  
  6244.  
  6245.  
  6246.  
  6247.  
  6248.  
  6249.  
  6250.  
  6251.  
  6252.  
  6253.  
  6254.  
  6255.  
  6256.  
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.                                                                 2
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273. NAME
  6274.        elvrec  -  Recover  the modified version of a file after a
  6275.        crash
  6276.  
  6277. SYNOPSIS
  6278.        elvrec [preservedfile [newfile]]
  6279.  
  6280. DESCRIPTION
  6281.        If you're editing a  file  when  elvis  dies,  the  system
  6282.        crashes,  or  power fails, the most recent version of your
  6283.        text will be preserved.  The preserved text is stored in a
  6284.        special  directory;  it  does NOT overwrite your text file
  6285.        automatically.
  6286.  
  6287.        The elvrec program locates  the  preserved  version  of  a
  6288.        given  file,  and writes it over the top of your text file
  6289.        -- or to a new file, if you prefer.   The  recovered  file
  6290.        will have nearly all of your changes.
  6291.  
  6292.        To see a list of all recoverable files, run elvrec with no
  6293.        arguments.
  6294.  
  6295.        (Note: if you haven't set up a directory for file  preser-
  6296.        vation,  then  elvis'  you'll  have  to  manually  run the
  6297.        elvprsv program instead of elvrec.)
  6298.  
  6299. FILES
  6300.        /usr/preserve/p*
  6301.               The text that was preserved when elvis died.
  6302.  
  6303.        /usr/preserve/Index
  6304.               A text file which lists the names of all  preserved
  6305.               files,  and the names of the /usr/preserve/p* files
  6306.               which contain their preserved text.
  6307.  
  6308. BUGS
  6309.        elvrec is very picky about filenames.  You must tell it to
  6310.        recover  the  file using exactly the same pathname as when
  6311.        you were editing it.  The simplest way to do this is to go
  6312.        into  the same directory that you were editing, and invoke
  6313.        elvrec with the same filename as elvis.  If  that  doesn't
  6314.        work,  then  try  running elvrec with no arguments, to see
  6315.        exactly which pathname it is using for the desired file.
  6316.  
  6317.        Due to the permissions on the /usr/preserve directory,  on
  6318.        UNIX  systems  elvrec  must  be run as superuser.  This is
  6319.        accomplished by making the elvrec executable be  owned  by
  6320.        "root" and setting its "set user id" bit.
  6321.  
  6322.        If  you're editing a nameless buffer when elvis dies, then
  6323.        elvrec will pretend that the file was named "foo".
  6324.  
  6325. AUTHOR
  6326.        Steve Kirkendall
  6327.  
  6328.  
  6329.  
  6330.                                                                 1
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336. ELVREC(1)                                               ELVREC(1)
  6337.  
  6338.  
  6339.        kirkenda@cs.pdx.edu
  6340.  
  6341.  
  6342.  
  6343.  
  6344.  
  6345.  
  6346.  
  6347.  
  6348.  
  6349.  
  6350.  
  6351.  
  6352.  
  6353.  
  6354.  
  6355.  
  6356.  
  6357.  
  6358.  
  6359.  
  6360.  
  6361.  
  6362.  
  6363.  
  6364.  
  6365.  
  6366.  
  6367.  
  6368.  
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392.  
  6393.  
  6394.  
  6395.  
  6396.                                                                 2
  6397.  
  6398.  
  6399.  
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405. NAME
  6406.        fmt - adjust line-length for paragraphs of text
  6407.  
  6408. SYNOPSIS
  6409.        fmt [-width] [files]...
  6410.  
  6411. DESCRIPTION
  6412.        fmt  is  a  simple  text formatter.  It inserts or deletes
  6413.        newlines, as necessary, to make all lines in  a  paragraph
  6414.        be approximately the same width.  It preserves indentation
  6415.        and word spacing.
  6416.  
  6417.        The default line width is 72 characters.  You can override
  6418.        this with the -width flag.  If you don't name any files on
  6419.        the command line, then fmt will read from stdin.
  6420.  
  6421.        It is typically used from within vi  to  adjust  the  line
  6422.        breaks in a single paragraph.  To do this, move the cursor
  6423.        to the  top  of  the  paragraph,  type  "!}fmt",  and  hit
  6424.        <Return>.
  6425.  
  6426. AUTHOR
  6427.        Steve Kirkendall
  6428.        kirkenda@cs.pdx.edu
  6429.  
  6430.  
  6431.  
  6432.  
  6433.  
  6434.  
  6435.  
  6436.  
  6437.  
  6438.  
  6439.  
  6440.  
  6441.  
  6442.  
  6443.  
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.                                                                 1
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471. NAME
  6472.        ref - Display a C function header
  6473.  
  6474. SYNOPSIS
  6475.        ref [-t] [-x] [-c class]... [-f file]... tag
  6476.  
  6477. DESCRIPTION
  6478.        ref quickly locates and displays the header of a function.
  6479.        To do this, ref looks in the "tags" file for the line that
  6480.        describes the function, and then scans the source file for
  6481.        the function.  When it locates the function,  it  displays
  6482.        an  introductory comment (if there is one), the function's
  6483.        declaration, and the declarations of all arguments.
  6484.  
  6485. SEARCH METHOD
  6486.        ref uses a fairly sophisticated tag look-up algorithm.  If
  6487.        you  supply a filename via -f file, then elvis first scans
  6488.        the tags file for a  static  tag  from  that  file.   This
  6489.        search  is  limited to the tags file in the current direc-
  6490.        tory.
  6491.  
  6492.        If you  supply  a  classname  via  -c  class,  then  elvis
  6493.        searches  for  a  tag from that class.  This search is not
  6494.        limited to the current directory; You can supply a list of
  6495.        directories  in  the environment variable TAGPATH, and ref
  6496.        will search through the  "tags"  file  in  each  directory
  6497.        until it finds a tag in the desired class.
  6498.  
  6499.        If  that  fails,  ref will then try to look up an ordinary
  6500.        global tag.  This search checks  all  of  the  directories
  6501.        listed  in  TAGPATH, too.  If the tag being sought doesn't
  6502.        contain any colons, and you haven't given a -x flag,  then
  6503.        any  static  tags in a tags file will be treated as global
  6504.        tags.
  6505.  
  6506.        If you've given the -t flag, then ref will  simply  output
  6507.        the  tag  line  that it found, and then exit.  Without -t,
  6508.        though, ref will search for the tag line.  It will try  to
  6509.        open  the  source file, which should be in the same direc-
  6510.        tory as the tags file where the tag  was  discovered.   If
  6511.        the  source file doesn't exist, or is unreadable, then ref
  6512.        will try to open a file called "refs" in  that  directory.
  6513.        Either  way,  ref  will try to locate the tag, and display
  6514.        whatever it finds.
  6515.  
  6516. INTERACTION WITH ELVIS
  6517.        ref is used by elvis' shift-K command.  If the  cursor  is
  6518.        located  on  a  word such as "splat", in the file "foo.c",
  6519.        then elvis will invoke ref with the command "ref -f  foo.c
  6520.        splat".
  6521.  
  6522.        If  elvis has been compiled with the -DEXTERNAL_TAGS flag,
  6523.        then elvis will use ref to scan the tags files.   This  is
  6524.        slower  than  the  built-in  tag  searching, but it allows
  6525.  
  6526.  
  6527.  
  6528.                                                                 1
  6529.  
  6530.  
  6531.  
  6532.  
  6533.  
  6534. REF(1)                                                     REF(1)
  6535.  
  6536.  
  6537.        elvis to access the more sophisticated tag lookup provided
  6538.        by ref.  Other than that, external tags should act exactly
  6539.        like internal tags.
  6540.  
  6541. OPTIONS
  6542.        -t     Output tag info, instead of the function header.
  6543.  
  6544.        -f file
  6545.               The tag might be a static function  in  file.   You
  6546.               can  use  several  -f  flags  to  have ref consider
  6547.               static tags from more than one file.
  6548.  
  6549.        -c class
  6550.               The tag might be a member of class class.  You  can
  6551.               use several -c flags to have ref consider tags from
  6552.               more than one class.
  6553.  
  6554. FILES
  6555.        tags   List of function names and their locations,  gener-
  6556.               ated by ctags.
  6557.  
  6558.        refs   Function   headers   extracted  from  source  files
  6559.               (optional).
  6560.  
  6561. ENVIRONMENT
  6562.        TAGPATH
  6563.               List of directories to be searched.   The  elements
  6564.               in the list are separated by either semicolons (for
  6565.               MS-DOS, Atari TOS,  and  AmigaDos),  or  by  colons
  6566.               (every other operating system).  For each operating
  6567.               system, ref has a built-in default which is  proba-
  6568.               bly adequate.
  6569.  
  6570. NOTES
  6571.        You  might  want  to  generate a "tags" file the directory
  6572.        that contains the source code for standard  C  library  on
  6573.        your  system.   If licensing restrictions prevent you from
  6574.        making the library source readable by everybody, then  you
  6575.        can  have  ctags  generate  a "refs" file, and make "refs"
  6576.        readable by everybody.
  6577.  
  6578.        If your system doesn't come with the library source  code,
  6579.        then  perhaps  you can produce something workable from the
  6580.        lint libraries.
  6581.  
  6582. SEE ALSO
  6583.        elvis(1), ctags(1)
  6584.  
  6585. AUTHOR
  6586.        Steve Kirkendall
  6587.        kirkenda@cs.pdx.edu
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.                                                                 2
  6595.  
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.