home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / apps / text_ed / elv16b2 / doc / elvisman.txt < prev    next >
Text File  |  1992-08-18  |  158KB  |  5,413 lines

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