Path: utzoo!utgpu!cs.utexas.edu!uunet!zephyr.ens.tek.com!tektronix!nosun!qiclab!pdxgate!eecs.cs.pdx.edu!kirkenda From: kirkenda@eecs.cs.pdx.edu (Steve Kirkendall) Newsgroups: alt.sources Subject: Elvis 1.4, part 2 of 8 Message-ID: <826@pdxgate.UUCP> Date: 3 Dec 90 21:28:20 GMT Sender: news@pdxgate.UUCP Reply-To: kirkenda@eecs.cs.pdx.edu (Steve Kirkendall) Organization: Portland State University, Portland, OR Lines: 2039 : ------------------------ CUT HERE -------------------- test -d doc || mkdir doc || exit 2 if test -f doc/cutbufs.doc -a "$1" != -f then echo Will not overwrite doc/cutbufs.doc else echo Extracting doc/cutbufs.doc sed 's/^X//' >doc/cutbufs.doc <<\eof X X Elvis 1.4 CUT BUFFERS Page 6-1 X X XE6. CUT BUFFERSF X X When elvis deletes text, it stores that text in a cut buffer. X This happens in both visual mode and EX mode. There is no X practical limit to how much text a cut buffer can hold. X X There are 36 cut buffers: 26 named buffers ("a through "z), 9 X anonymous buffers ("1 through "9), and 1 extra cut buffer (".). X X In EX mode, the :move and :copy commands use a cut buffer to X temporarily hold the text to be moved/copied. X X X E6.1 FillingF X X In visual mode, text is copied into a cut buffer when you use X the d, y, c, C, or s commands. X X By default, the text goes into the "1 buffer. The text that X used to be in "1 gets shifted into "2, "2 gets shifted into "3, and X so on. The text that used to be in "9 is lost. This way, the last X 9 things you deleted are still accessible. X X You can also put the text into a named buffer -- "a through "z. X To do this, you should type the buffer's name (two keystrokes: a X double-quote and a lowercase letter) before the d/y/c/C/s command. X When you do this, "1 through "9 are not affected by the cut. X X You can append text to one of the named buffers. To do this, X type the buffer's name in uppercase (a double-quote and an X uppercase letter) before the d/y/c/C/s command. X X The ". buffer is special. It isn't affected by the d/y/c/C/s X command. Instead, it stores the text that you typed in the last X time you were in input mode. It is used to implement the . visual X command, and ^A in input mode. X X In EX mode (also known as colon mode), the :delete, :change, and X :yank commands all copy text into a cut buffer. Like the visual X commands, these EX commands normally use the "1 buffer, but you can X use one of the named buffers by giving its name after the command. X For example, X X :20,30y a X X will copy lines 20 through 30 into cut buffer "a. X X You can't directly put text into the ". buffer, or the "2 X through "9 buffers. X X X X X X X X X X X X X X X Elvis 1.4 CUT BUFFERS Page 6-2 X X X E6.2 Pasting from a Cut BufferF X X There are two styles of pasting: line-mode and character-mode. X If a cut buffer contains whole lines (from a command like "dd") X then line-mode pasting is used; if it contains partial lines (from X a command like "dw") then character-mode pasting is used. The EX X commands always cut whole lines. X X Character-mode pasting causes the text to be inserted into the X line that the cursor is on. X X Line-mode pasting inserts the text on a new line above or below X the line that the cursor is on. It doesn't affect the cursor's X line at all. X X In visual mode, the p and P commands insert text from a cut X buffer. Uppercase P will insert it before the cursor, and X lowercase p will insert it after the cursor. Normally, these X commands will paste from the "1 buffer, but you can specify any X other buffer to paste from. Just type its name (a double-quote and X another character) before you type the P or p. X X In EX mode, the (pu)t command pastes text after a given line. X To paste from a buffer other that "1, enter its name after the X command. X X X E6.3 MacrosF X X The contents of a named cut buffer can be executed as a series X of ex/vi commands. X X To put the instructions into the cut buffer, you must first X insert them into the file, and then delete them into a named cut X buffer. X X To execute a cut buffer's contents as EX commands, you should X give the EX command "@" and the name of the buffer. For example, X :@z will execute "z as a series of EX commands. X X To execute a cut buffer's contents as visual commands, you X should give the visual command "@" and the letter of the buffer's X name. The visual "@" command is different from the EX "@" X command. They interpret the cut buffer's contents differently. X X The visual @ command can be rather finicky. Each character in X the buffer is interpretted as a keystroke. If you load the X instructions into the cut buffer via a "zdd command, then the X newline character at the end of the line will be executed just like X any other character, so the cursor would be moved down 1 line. If X you don't want the cursor to move down 1 line at the end of each @z X command, then you should load the cut buffer by saying 0"zD X instead. X X Although cut buffers may hold any amount of text, elvis can only X -1execute-0 small buffers. For EX mode, the buffer is limited to about X 1k bytes. For visual mode, the buffer is limited to about 80 X bytes. If a buffer is too large to execute, an error message is X X X X X X Elvis 1.4 CUT BUFFERS Page 6-3 X X X displayed. X X You can't nest @ commands. You can't run @ commands from your X .exrc file, or any other :source file either. Similarly, you can't X run a :source command from within an @ command. Hopefully, these X restrictions will be lifted in a later version. X X X E6.4 The Effect of Switching FilesF X X When elvis first starts up, all cut buffers are empty. When you X switch to a different file (via the :n or :e commands perhaps) the X 9 anonymous cut buffers are emptied again, but the other 27 buffers X retain their text. X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X eof if test `wc -c doc/options.doc <<\eof X X Elvis 1.4 OPTIONS Page 5-1 X X XE5. OPTIONSF X X Options may be set or examined via the colon command "set". The X values of options will affect the operation of later commands. X X For convenience, options have both a long descriptive name and a X short name which is easy to type. You may use either name X interchangably. I like the short names, myself. X X-1long name short type default meaning -0 Xautoindent ai Bool noai auto-indent during input Xautoprint ap Bool ap in EX, print the current line Xautowrite aw Bool noaw auto-write when switching files Xcharattr ca Bool noca interpret \fX sequences? Xcc cc Str cc="cc -c" name of the C compiler Xcolumns co Num co=80 width of the screen Xdigraph dig Bool nodig recognize digraphs? Xdirectory dir Str dir="/usr/tmp" where tmp files are kept Xedcompatible ed Bool noed remember ":s//" options Xerrorbells eb Bool eb ring bell on error Xexrefresh er Bool er write lines indiviually in EX Xflipcase fc Str fc="" non-ASCII chars flipped by ~ Xhideformat hf Bool hf hide text formatter commands Xignorecase ic Bool noic upper/lowercase match in search Xinputmode im Bool noim start vi in insert mode? Xkeytime kt Num kt=2 timeout for mapped key entry Xkeywordprg kp Str kp="ref" full pathname of shift-K prog Xlines ln Num ln=25 number of lines on the screen Xlist li Bool noli display lines in "list" mode Xmagic ma Bool ma use regular expression in search Xmake mk Str mk="make" name of the "make" program Xmodeline ml Bool noml are modelines processed? Xparagraphs pa Str pa="PPppIPLPQP" names of "paragraph" nroff cmd Xreadonly ro Bool noro prevent overwriting of orig file Xreport re Num re=5 report when 5 or more changes Xscroll sc Num sc=12 scroll amount for ^U and ^D Xsections se Str se="NHSHSSSEse" names of "section" nroff cmd Xshell sh Str sh="/bin/sh" full pathname of the shell Xshowmatch sm Bool nosm show matching ()[]{} Xshowmode smd Bool nosmd say when we're in input mode Xshiftwidth sw Num sw=8 shift amount for < and > Xsidescroll ss Num ss=8 amount of sideways scrolling Xsync sy Bool nosy call sync() often Xtabstop ts Num ts=8 width of tab characters Xterm te Str te="$TERM" name of the termcap entry Xvbell vb Bool vb use visible alternative to bell Xwarn wa Bool wa warn for ! if file modified Xwrapmargin wm Num wm=0 wrap long lines in input mode Xwrapscan ws Bool ws at EOF, searches wrap to line 1 X X There are three types of options: Bool, string, and numeric. X Boolean options are made TRUE by giving the name of the option as X an argument to the "set" command; they are made FALSE by prefixing X the name with "no". For example, "set autoindent" makes the X autoindent option TRUE, and "set noautoindent" makes it FALSE. X X X X X X X X X Elvis 1.4 OPTIONS Page 5-2 X X X To change the value of a string or numeric option, pass the X "set" command the name of the option, followed by an "=" sign and X the option's new value. For example, "set tabstop=8" will give the X tabstop option a value of 8. For string options, you may enclose X the new value in quotes. X X X E5.1 AutoIndentF X X During input mode, the autoindent option will cause each added X line to begin with the same amount of leading whitespace as the X line above it. Without autoindent, added lines are initially X empty. X X X E5.2 AutoPrintF X X This option only affects EX mode. If the autoprint option on, X and either the cursor has moved to a different line or the previous X command modified the file, then Elvis will print the current line. X X X E5.3 AutoWriteF X X When you're editing one file and decide to switch to another - X via the :tag command, or :next command, perhaps - if your current X file has been modified, then Elvis will normally print an error X message and refuse to switch. X X However, if the autowrite option is on, then Elvis will write X the modified version of the current file and successfully switch to X the new file. X X X E5.4 CCF X X The :cc command runs the C compiler. This option should be set X to the name of your compiler. X X X E5.5 CharAttrF X X Many text formatting programs allow you to designate portions of X your text to be underlined, italicized, or boldface by embedding X the special strings \fU, \fI, and \fB in your text. The special X string \fR marks the end of underlined or boldface text. X X Elvis normally treats those special strings just like any other X text. X X However, if the charattr option is on, then Elvis will interpret X those special strings correctly, to display underlined or boldface X text on the screen. (This only works, of course, if your terminal X can display underlined and boldface, and if the TERMCAP entry says X how to do it.) X X X X X X X X X Elvis 1.4 OPTIONS Page 5-3 X X X E5.6 COlumnsF X X This is a "read only" option. You can't change its value, but X you can have Elvis print it. It shows how wide your screen is. X X X E5.7 DIGraphF X X This option is used to enable/disable recognition of digraphs. X The default value is nodigraph, which means that digraphs will not X be recognized. X X X E5.8 DIRectoryF X X Elvis stores text in temporary files. This option allows you to X control which directory those temporary files will appear in. The X default is /usr/tmp. X X This option can only be set in a .exrc file; after that, elvis X will have already started making temporary files in some other X directory, so it would be too late. X X X E5.9 EDcompatibleF X X This option affects the behaviour of the X ":s/regexp/text/options" command. It is normally off (:se noed) X which causes all of the substitution options to be off unless X explicitly given. X X However, with edcompatible on (:se ed), the substitution command X remembers which options you used last time. Those same options X will continue to be used until you change them. In edcompatible X mode, when you explicitly give the name of a substitution option, X you will toggle the state of that option. X X This all seems very strange to me, but its implementation was X almost free when I added the ":&" command to repeat the previous X substitution, so there it is. X X X E5.10 ErrorBellsF X X Elvis normally rings a bell when you do something wrong. This X option lets you disable the bell. X X X E5.11 ExRefreshF X X The EX mode of Elvis writes many lines to the screen. You can X make Elvis either write each line to the screen separately, or save X up many lines and write them all at once. X X The exrefresh option is normally on, so each line is written to X the screen separately. X X X X X X X X Elvis 1.4 OPTIONS Page 5-4 X X X You may wish to turn the exrefresh option off (:se noer) if the X "write" system call is costly on your machine, or if you're using a X windowing environment. (Windowing environments scroll text a lot X faster when you write many lines at once.) X X This option has no effect in visual command mode or input mode. X X X E5.12 FlipCaseF X X The flipcase option allows you to control how the non-ASCII X characters are altered by the "~" command. X X The string is divided into pairs of characters. When "~" is X applied to a non-ASCII character, Elvis looks up the character in X the flipcase string to see which pair it's in, and replaces it by X the other character of the pair. X X X E5.13 HideFormatF X X Many text formatters require you to embed format commands in X your text, on lines that start with a "." character. Elvis X normally displays these lines like any other text, but if the X hideformat option is on, then format lines are displayed as blank X lines. X X X E5.14 IgnoreCaseF X X Normally, when Elvis searches for text, it treats uppercase X letters as being different for lowercase letters. X X When the ignorecase option is on, uppercase and lowercase are X treated as equal. X X X E5.15 InputModeF X X This option allows you to have Elvis start up in insert mode. X You can still exit insert mode at any time by hitting the ESC key, X as usual. Usually, this option would be set in your ".exrc" file. X X X E5.16 KeyTimeF X X The arrow keys of most terminals send a multi-character X sequence. It takes a measurable amount of time for these sequences X to be transmitted. The keytime option allows you to control the X maximum amount of time to allow for an arrow key (or other mapped X key) to be received in full. X X The default keytime value is 2. Because of the way UNIX X timekeeping works, the actual amount of time allowed will vary X slightly, but it will always be between 1 and 2 seconds. X X X X X X X X X Elvis 1.4 OPTIONS Page 5-5 X X X If you set keytime to 1, then the actual amount of time allowed X will be between 0 and 1 second. This will generally make the X keyboard's response be a little faster (mostly for the ESC key), X but on those occasions where the time allowed happens to be closer X to 0 than 1 second, Elvis may fail to allow enough time for an X arrow key's sequence to be received fully. Ugh. X X As a special case, you can set keytime to 0 to disable this time X limit stuff altogether. The big problem here is: If your arrow X keys' sequences start with an ESC, then every time you hit your ESC X key Elvis will wait... and wait... to see if maybe that ESC was X part of an arrow key's sequence. X X NOTE: this option is a generalization of the timeout option of X the real vi. X X X E5.17 KeywordPrgF X X Elvis has a special keyword lookup feature. You move the cursor X onto a word, and hit shift-K, and Elvis uses another program to X look up the word and display information about it. X X This option says which program gets run. X X The default value of this option is "ref", which is a program X that looks up the definition of a function in C. It looks up the X function name in a file called "refs" which is created by ctags. X X You can subtitute other programs, such as an English dictionary X program or the online manual. Elvis runs the program, using the X keyword as its only argument. The program should write information X to stdout. The program's exit status should be 0, unless you want X Elvis to print "<<< failed >>>". X X X E5.18 LiNesF X X This "read only" option shows how many lines you screen has. X X X E5.19 LIstF X X In nolist mode (the default), elvis displays text in a "normal" X manner -- with tabs expanded to an appropriate number of spaces, X etc. X X However, sometimes it is useful to have tab characters displayed X differently. In list mode, tabs are displayed as "^I", and a "$" X is displayed at the end of each line. X X X X X X X X X X X X X X Elvis 1.4 OPTIONS Page 5-6 X X X E5.20 MAgicF X X The search mechanism in Elvis can accept "regular expressions" X -- strings in which certain characters have special meaning. X X The magic option is normally on, which causes these characters X to be treated specially. X X If you turn the magic option off (:se noma), then all characters X except ^ and $ are treated literally. ^ and $ retain their special X meanings regardless of the setting of magic. X X X E5.21 MaKeF X X The :make command runs your "make" program. This option defines X the name of your "make" program. X X X E5.22 ModeLineF X X Elvis supports modelines. Modelines are lines near the X beginning or end of your text file which contain "ex:yowza:", where X "yowza" is any EX command. A typical "yowza" would be something X like "set ts=4 ca kp=spell". X X Normally these lines are ignored, for security reasons, but if X you have "set modeline" in your .exrc file then "yowza" is X executed. X X X E5.23 PAragraphsF X X The { and } commands move the cursor forward or backward in X increments of one paragraph. Paragraphs may be separated by blank X lines, or by a "dot" command of a text formatter. Different text X formatters use different "dot" commands. This option allows you to X configure Elvis to work with your text formatter. X X It is assumed that your formatter uses commands that start with X a "." character at the front of a line, and then have a one- or X two-character command name. X X The value of the paragraphs option is a string in which each X pair of characters is one possible form of your text formatter's X paragraph command. X X X E5.24 ReadOnlyF X X Normally, Elvis will let you write back any file to which you X have write permission. If you don't have write permission, then X you can only write the changed version of the file to a -1different-0 X file. X X X X X X X X X X Elvis 1.4 OPTIONS Page 5-7 X X X If you set the readonly option, then Elvis will pretend you X don't have write permission to -1any-0 file you edit. It is useful X when you really only mean to use Elvis to look at a file, not to X change it. This way you can't change it accidentally. X X This option is normally off, unless you use the "view" alias of X Elvis. "View" is like "vi" except that the readonly option is on. X X X E5.25 REportF X X Commands in Elvis may affect many lines. For commands that X affect a lot of lines, Elvis will output a message saying what was X done and how many lines were affected. This option allows you to X define what "a lot of lines" means. The default is 5, so any X command which affects 5 or more lines will cause a message to be X shown. X X X E5.26 SCrollF X X The ^U and ^D keys normally scroll backward or forward by half a X screenful, but this is adjustable. The value of this option says X how many lines those keys should scroll by. X X X E5.27 SEctionsF X X The [[ and ]] commands move the cursor backward or forward in X increments of 1 section. Sections may be delimited by a { X character in column 1 (which is useful for C source code) or by X means of a text formatter's "dot" commands. X X This option allows you to configure Elvis to work with your text X formatter's "section" command, in exectly the same way that the X paragraphs option makes it work with the formatter's "paragraphs" X command. X X X E5.28 SHellF X X When Elvis forks a shell (perhaps for the :! or :shell X commands) this is the program that is uses as a shell. This is X "/bin/sh" by default, unless you have set the SHELL (or COMSPEC, X for MS-DOS) environment variable, it which case the default value X is copied from the environment. X X X E5.29 ShiftWidthF X X The < and > commands shift text left or right by some uniform X number of columns. The shiftwidth option defines that "uniform X number". The default is 8. X X X X X X X X X X X Elvis 1.4 OPTIONS Page 5-8 X X X E5.30 ShowMatchF X X With showmatch set, in input mode every time you hit one of )}], X Elvis will momentarily move the cursor to the matching ({[. X X X E5.31 ShowMoDeF X X In visual mode, it is easy to forget whether you're in the X visual command mode or input/replace mode. Normally, the showmode X option is off, and you haven't a clue as to which mode you're in. X If you turn the showmode option on, though, a little message will X appear in the lower right-hand corner of your screen, telling you X which mode you're in. X X X E5.32 SideScrollF X X For long lines, Elvis scrolls sideways. (This is different from X the real vi, which wraps a single long line onto several rows of X the screen.) X X To minimize the number of scrolls needed, Elvis moves the screen X sideways by several characters at a time. The value of this option X says how many characters' widths to scroll at a time. X X Generally, the faster your screen can be redrawn, the lower the X value you will want in this option. X X X E5.33 SYncF X X If the system crashes during an edit session, then most of your X work can be recovered from the temporary file that elvis uses to X store changes. However, sometimes the OS will not copy changes to X the hard disk immediately, so recovery might not be possible. The X [no]sync option lets you control this. X X In nosync mode (which is the default, for UNIX), elvis lets the X operating system control when data is written to the disk. This is X generally faster. X X In sync mode (which is the default, for MS-DOS), elvis forces X all changes out to disk every time you make a change. This is X generally safer, but slower. It can also be a rather rude thing to X do on a multi-user system. X X X E5.34 TabStopF X X Tab characters are normally 8 characters wide, but you can X change their widths by means of this option. X X X X X X X X X X X X Elvis 1.4 OPTIONS Page 5-9 X X X E5.35 TErmF X X This "read only" option shows the name of the termcap entry that X Elvis is using for your terminal. X X X E5.36 VBellF X X If your termcap entry describes a visible alternative to ringing X your terminal's bell, then this option will say whether the visible X version gets used or not. Normally it will be. X X If your termcap does NOT include a visible bell capability, then X the vbell option will be off, and you can't turn it on. X X X E5.37 WArnF X X If you have modified a file but not yet written it back to disk, X then Elvis will normally print a warning before executing a ":!cmd" X command. However, in nowarn mode, this warning is not given. X X Elvis also normally prints a message after a successful search X that wrapped at EOF. The [no]warn option can also disable this X warning. X X X E5.38 WrapMarginF X X Normally (with wrapmargin=0) Elvis will let you type in X extremely long lines, if you wish. X X However, with warpmargin set to something other that 0 X (wrapmargin=10 is nice), Elvis will automatically cause long lines X to be "wrapped" on a word break for lines longer than wrapmargin's X setting. X X X E5.39 WrapScanF X X Normally, when you search for something, Elvis will find it no X matter where it is in the file. Elvis starts at the cursor X position, and searches forward. If Elvis hits EOF without finding X what you're looking for, then it wraps around to continue searching X from line 1. X X If you turn off the wrapscan option (:se nows), then when Elvis X hits EOF during a search, it will stop and say so. X X X X X X X X X X X X X X eof if test `wc -c doc/environ.doc <<\eof X X Elvis 1.4 ENVIRONMENT VARIABLES Page 11-1 X X XE11. ENVIRONMENT VARIABLESF X X Elvis examines several environment variables when it starts up. X The values of these variables are used internally for a variety of X purposes. You don't need to define all of these; on most systems, X Elvis only requires TERM to be defined. On MS-DOS systems, even X that is optional. X X X E11.1 TERM, TERMCAPF X X TERM tells Elvis the name of the termcap entry to use. TERMCAP X may contain either the entire termcap entry, or the full pathname X of the termcap file to search through. X X X E11.2 TMP, TEMPF X X These only work for MS-DOS and Atari TOS. Either of these X variables may be used to set the "directory" option, which controls X where temporary files are stored. If you define them both, then X TMP is used, and TEMP is ignored. X X X E11.3 EXINITF X X This variable may contain a colon-mode command, which will be X executed after all of the ".exrc" files but before interactive X editing begins. X X X E11.4 SHELL, COMSPECF X X You can use COMSPEC in MS-DOS, or SHELL in any other system, to X specify which shell should be used for executing commands and X expanding wildcards. X X X E11.5 HOMEF X X This variable should give the full pathname of your home X directory. Elvis needs to know the name of your home directory so X it can locate the ".exrc" file there. X X X X X X X X X X X X X X X X X X X eof if test `wc -c doc/regexp.doc <<\eof X X Elvis 1.4 REGULAR EXPRESSIONS Page 4-1 X X XE4. REGULAR EXPRESSIONSF X X Elvis uses regular expressions for searching and substututions. X X X E4.1 SyntaxF X X Elvis' regexp package treats the following one- or two-character X strings (called meta-characters) in special ways: X X \( \) Used to delimit subexpressions X ^ Matches the beginning of a line X $ Matches the end of a line X \< Matches the beginning of a word X \> Matches the end of a word X [ ] Matches any single character inside the brackets X * The preceding may be repeated 0 or more times X \+ The preceding may be repeated 1 or more times X \? The preceding is optional X X Anything else is treated as a normal character which must match X exactly. The special strings may all be preceded by a backslash to X force them to be treated normally. X X X E4.2 OptionsF X X Elvis has two options which affect the way regular expressions X are used. These options may be examined or set via the :set X command. X X The first option is called "[no]magic". This is a boolean X option, and it is "magic" (TRUE) by default. While in magic mode, X all of the meta-characters behave as described above. In nomagic X mode, only ^ and $ retain their special meaning. X X The second option is called "[no]ignorecase". This is a boolean X option, and it is "noignorecase" (FALSE) by default. While in X ignorecase mode, the searching mechanism will not distinguish X between an uppercase letter and its lowercase form. In X noignorecase mode, uppercase and lowercase are treated as being X different. X X Also, the "[no]wrapscan" option affects searches. X X X E4.3 SubstitutionsF X X The :s command has at least two arguments: a regular expression, X and a substitution string. The text that matched the regular X expression is replaced by text which is derived from the X substitution string. X X X X X X X X X X X X Elvis 1.4 REGULAR EXPRESSIONS Page 4-2 X X X Most characters in the substitution string are copied into the X text literally but a few have special meaning: X X & Insert a copy of the original text X ~ Insert a copy of the previous replacement text X \1 Insert a copy of that portion of the original text which X matched the first set of \( \) parentheses. X \2 - \9 Does the same for the second (etc.) pair of \( \). X \U Convert all chars of any later &, ~, or \# to uppercase X \L Convert all chars of any later &, ~, or \# to lowercase X \E End the effect of \U or \L X \u Convert the first char of the next &, ~ or \# to uppercase X \l Convert the first char of the next &, ~ or \# to lowercase X X These may be preceded by a backslash to force them to be treated X normally. If "nomagic" mode is in effect, then & and ~ will be X treated normally, and you must write them as \& and \~ form them to X have special meaning. X X X E4.4 ExamplesF X X This example changes every occurence of "utilize" to "use": X X :%s/utilize/use/g X X This example deletes all whitespace that occurs at the end of a X line anywhere in the file. (The brackets contain a single space X and a single tab.): X X :%s/[ ]\+$// X X This example converts the current line to uppercase: X X :s/.*/\U&/ X X This example underlines each letter in the current line, by X changing it into an "underscore backspace letter" sequence. (The X ^H is entered as "control-V backspace".): X X :s/[a-zA-Z]/_^H&/g X X This example locates the last colon in a line, and swaps the X text before the colon with the text after the colon. The first \( X \) pair is used to delineate the stuff before the colon, and the X second pair delineates the stuff after. In the substitution text, X \1 and \2 are given in reverse order, to perform the swap: X X :s/\(.*\):\(.*\)/\2:\1/ X X X X X X X X X X X X X eof if test `wc -c doc/internal.doc <<\eof X X Elvis 1.4 INTERNAL Page 8-1 X X XE8. INTERNALF X X You don't need to know the material in this section to use X elvis. You only need it if you intend to modify elvis. X X X E8.1 The temporary fileF X X The temporary file is divided into blocks of 1024 bytes each. X X When elvis starts up, the file is copied into the temporary X file. Small amounts of extra space are inserted into the temporary X file to insure that no text lines cross block boundaries; this X speeds up processing and simplifies storage management. The "extra X space" is filled with NUL characters; the input file must not X contain any NULs, to avoid confusion. X X The first block of the temporary file is an array of shorts X which describe the order of the blocks; i.e. header[1] is the X block number of the first block, and so on. This limits the X temporary file to 512 active blocks, so the largest file you can X edit is about 400K bytes long. I hope that's enough! X X When blocks are altered, they are rewritten to a -1different-0 block X in the file, and the in-core version of the header block is updated X accordingly. The in-core header block will be copied to the temp X file immediately before the next change... or, to undo this X change, swap the old header (from the temp file) with the new X (in-core) header. X X Elvis maintains another in-core array which contains the X line-number of the last line in every block. This allows you to go X directly to a line, given its line number. X X X E8.2 Implementation of EditingF X X There are three basic operations which affect text: X X * delete text - delete(from, to) X * add text - add(at, text) X * yank text - cut(from, to) X X To yank text, all text between two text positions is copied into X a cut buffer. The original text is not changed. To copy the text X into a cut buffer, you need only remember which physical blocks X that contain the cut text, the offset into the first block of the X start of the cut, the offset into the last block of the end of the X cut, and what kind of cut it was. (Cuts may be either character X cuts or line cuts; the kind of a cut affects the way it is later X "put".) This is implemented in the function cut(). X X To delete text, you must modify the first and last blocks, and X remove any reference to the intervening blocks in the header's X list. The text to be deleted is specified by two marks. This is X implemented in the function delete(). X X X X X X X X Elvis 1.4 INTERNAL Page 8-2 X X X To add text, you must specify the text to insert (as a X NUL-terminated string) and the place to insert it (as a mark). The X block into which the text is to be inserted may need to be split X into as many as four blocks, with new intervening blocks needed as X well... or it could be as simple as modifying a single block. X This is implemented in the function add(). X X Other interesting functions are paste() (to copy text from a cut X buffer into the file), modify() (for an efficient way to implement X a combined delete/add sequence), and input() (to get text from the X user & insert it into the file). X X When text is modified, an internal file-revision counter, called X "changes", is incremented. This counter is used to detect when X certain caches are out of date. (The "changes" counter is also X incremented when we switch to a different file, and also in one or X two similar situations -- all related to invalidating caches.) X X X E8.3 Marks and the CursorF X X Marks are places within the text. They are represented X internally as a long variable which is split into two bitfields: a X line number and a character index. Line numbers start with 1, and X character indexes start with 0. X X Since line numbers start with 1, it is impossible for a set mark X to have a value of 0L. 0L is therefore used to represent unset X marks. X X When you do the "delete text" change, any marks that were part X of the deleted text are unset, and any marks that were set to X points after it are adjusted. Similarly, marks are adjusted after X new text is inserted. X X The cursor is represented as a mark. X X X E8.4 Colon Command InterpretationF X X Colon commands are parsed, and the command name is looked up in X an array of structures which also contain a pointer to the function X that implements the command, and a description of the arguments X that the command can take. If the command is recognized and its X arguments are legal, then the function is called. X X Each function performs its task; this may cause the cursor to be X moved to a different line, or whatever. X X X E8.5 Screen ControlF X X The screen is updated via a package which looks like the X "curses" library, but isn't. It is actually much simpler. Most X curses operations are implemented as macros which copy characters X into a large I/O buffer, which is then written with a single large X write() call as part of the refresh() operation. X X X X X X X Elvis 1.4 INTERNAL Page 8-3 X X X The functions which modify text (namely add() and delete()) X remember where text has been modified. They do this by calling the X function redrawrange(). The screen redrawing function, redraw(), X uses these clues to help it reduce the amount of text that is X redrawn each time. X X X E8.6 PortabilityF X X To improve portability, Elvis collects as much of the X system-dependent definitions as possible into the config.h file. X This file begins with some preprocessor instructions which attempt X to determine which compiler and operating system you have. After X that, it conditionally defines some macros and constants for your X system. X X One of the more significant macros is ttyread(buf,n). This X macro is used to read raw characters from the keyboard. An attempt X to read may be cut short by a SIGALRM signal. For UNIX systems, X this simply reads bytes from stdin. For MSDOS, TOS, and OS9, X ttyread() is a function defined in curses.c. There is also a X ttywrite() macro. X X The tread() and twrite() macros are versions of read() and X write() that are used for text files. On UNIX systems, these are X equivelent to read() and write(). On MS-DOS, these are also X equivelent to read() and write(), since DOS libraries are generally X clever enough to convert newline characters automatically. For X Atari TOS, though, the MWC library is too stupid to do this, so we X had to do the conversion explicitly. X X Other macros may substitute index() for strchr(), or bcopy() for X memcpy(), or map the "void" data type to "int", or whatever. X X The file "tinytcap.c" contains a set of functions that emulate X the termcap library for a small set of terminal types. The X terminal-specific info is hard-coded into this file. It is only X used for systems that don't support real termcap. Another X alternative for screen control can be seen in the "curses.h" and X "pc.c" files. Here, macros named VOIDBIOS and CHECKBIOS are used X to indirectly call functions which perform low-level screen X manipulation via BIOS calls. X X The stat() function must be able to come up with UNIX-style X major/minor/inode numbers that uniquely identify a file or X directory. X X Please try to keep you changes localized, and wrap them in X #if/#endif pairs, so that elvis can still be compiled on other X systems. And PLEASE let me know about it, so I can incorporate X your changes into my latest-and-greatest version of elvis. X X X X X X X X X X X eof if test `wc -c doc/termcap.doc <<\eof X X Elvis 1.4 TERMCAP Page 10-1 X X XE10. TERMCAPF X X Elvis uses fairly standard termcap fields for most things. I X invented the cursor shape names but other than that there should be X no surprises. X X X E10.1 Required numeric fieldsF X X :co#: number of columns on the screen (characters per line) X :li#: number of lines on the screen X X X E10.2 Required string fieldsF X X :ce=: clear to end-of-line X :cl=: home the cursor & clear the screen X :cm=: move the cursor to a given row/column X :up=: move the cursor up one line X X X E10.3 Boolean fieldsF X X :am: auto margins - wrap when a char is written to the last column? X :pt: physical tabs? X X X E10.4 Optional string fieldsF X X :al=: insert a blank row on the screen X :dl=: delete a row from the screen X :cd=: clear to end of display X :ei=: end insert mode X :ic=: insert a blank character X :im=: start insert mode X :dc=: delete a character X :sr=: scroll reverse (insert a row at the top of the screen) X :vb=: visible bell X :ti=: terminal initialization string, to start full-screen mode X :te=: terminal termination, to end full-screen mode X :ks=: enables the cursor keypad X :ke=: disables the cursor keypad X X X E10.5 Optional strings received from the keyboardF X X :kd=: sequence sent by the key X :kl=: sequence sent by the key X :kr=: sequence sent by the key X :ku=: sequence sent by the key X :kP=: sequence sent by the key X :kN=: sequence sent by the key X :kh=: sequence sent by the key X :kH=: sequence sent by the key X X X X X X X X X X Elvis 1.4 TERMCAP Page 10-2 X X X Originally, termcap didn't have any names for the , X , , and keys. Although the capability names X shown in the table above are the most common, they are -1not-0 X universal. SCO Xenix uses :PU=:PD=:HM=:EN=: for those keys. Also, X if the four arrow keys happen to be part of a 3x3 keypad, then the X five non-arrow keys may be named :K1=: through :K5=:, so an IBM PC X keyboard may be described using those names instead. Elvis can any X of these names. X X X E10.6 Optional fields that describe character attributesF X X :so=: :se=: start/end standout mode (We don't care about :sg#:) X :us=: :ue=: start/end underlined mode X :md=: :me=: start/end boldface mode X :as=: :ae=: start/end alternate character set (italics) X :ug#: visible gap left by :us=:ue=:md=:me=:as=:ae=: X X X E10.7 Optional fields that affect the cursor's shapeF X X The :cQ=: string is used by elvis immediately before exiting to X undo the effects of the other cursor shape strings. If :cQ=: is X not given, then all other cursor shape strings are ignored. X X :cQ=: normal cursor X :cX=: cursor shape used for reading EX command -- steady underline X :cV=: cursor shape used for reading VI commands -- steady block X :cI=: cursor shape used during VI input mode -- blinking underline X :cR=: cursor shape used during VI replace mode -- blinking block X X If the capabilities above aren't given, then Elvis will try to X use the following values instead. X X :ve=: normal cursor, used as :cQ=:cX=:cI=:cR=: X :vs=: gaudy cursor, used as :cV=: X X X E10.8 An exampleF X X Here's the termcap entry I use on my Minix-ST system. Some of X the fields in it have nothing to do with Elvis. Some can only work X on my system; I have modified my kernel's screen driver. X X X mx|minix|minixst|ansi:\ X :is=\E[0~:co#80:li#25:bs:pt:\ X :cm=\E[%i%d;%dH:up=\E[A:do=^J:nd=\E[C:sr=\EM:\ X :cd=\E[J:ce=\E[K:cl=\E[H\E[J:\ X :al=\E[L:dl=\E[M:ic=\E[@:dc=\E[P:im=:ei=:\ X :so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:\ X :md=\E[1m:me=\E[m:as=\E[1;3m:ae=\E[m:\ X :ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:\ X :k1=\E[1~:k2=\E[2~:k3=\E[3~:k4=\E[4~:k5=\E[5~:\ X :k6=\E[6~:k7=\E[17~:k8=\E[18~:k9=\E[19~:k0=\E[20~:\ X :kU=\E[36~:kQ=\E[32~:kH=\E[28~:\ X :GV=3:GH=D:G1=?:G2=Z:G3=@:G4=Y:GC=E:GL=4:GR=C:GU=A:GD=B:\ X :cQ=\E[k:cX=\E[2;0k:cV=\E[16;0k:cI=\E[k:cR=\E[16;20k X X X X eof if test `wc -c doc/index.doc <<\eof X X X X X X X X X X X X X X X X X @@@@@@@ @ @ @ @@@ @@@@@ X @ @ @ @ @ @ @ X @ @ @ @ @ @ X @@@@@ @ @ @ @ @@@@@ X @ @ @ @ @ @ X @ @ @ @ @ @ @ X @@@@@@@ @@@@@@@ @ @@@ @@@@@ X X - a clone of vi/ex - X version 1.4 X X X X X X X X X X X X X X X X X X X X X X XAuthor: Steve Kirkendall X 14407 SW Teal Blvd., Apt C X Beaverton, OR 97005 X XE-Mail: kirkenda@cs.pdx.edu X XPhone: (503) 642-9905 X X X X X X X X X X X X X X X X ---=: C O N T E N T S :=--- X X X X 1. INTRODUCTION ................................................... 1-1 X 1.1 Compiling ................................................... 1-1 X 1.2 Overview of Elvis ........................................... 1-1 X X 2. VISUAL MODE COMMANDS ........................................... 2-1 X 2.1 Input Mode .................................................. 2-4 X 2.2 Arrow keys in Input Mode .................................... 2-4 X 2.3 Digraphs .................................................... 2-5 X 2.4 Abbreviations ............................................... 2-5 X 2.5 Auto-Indent ................................................. 2-5 X X 3. COLON MODE COMMANDS ............................................ 3-1 X 3.1 Line Specifiers ............................................. 3-2 X 3.2 Text Entry Commands ......................................... 3-3 X 3.3 Cut & Paste Commands ........................................ 3-3 X 3.4 Display Text Commands ....................................... 3-3 X 3.5 Global Operations Commands .................................. 3-4 X 3.6 Line Editing Commands ....................................... 3-4 X 3.7 Undo Command ................................................ 3-5 X 3.8 Configuration & Status Commands ............................. 3-5 X 3.9 Multiple File Commands ...................................... 3-6 X 3.10 Switching Files ............................................ 3-7 X 3.11 Working with a Compiler .................................... 3-7 X 3.12 Exit Commands .............................................. 3-7 X 3.13 File I/O Commands .......................................... 3-8 X 3.14 Directory Commands ......................................... 3-8 X 3.15 Debugging Commands ......................................... 3-8 X X 4. REGULAR EXPRESSIONS ............................................ 4-1 X 4.1 Syntax ...................................................... 4-1 X 4.2 Options ..................................................... 4-1 X 4.3 Substitutions ............................................... 4-1 X 4.4 Examples .................................................... 4-2 X X 5. OPTIONS ........................................................ 5-1 X 5.1 AutoIndent .................................................. 5-2 X 5.2 AutoPrint ................................................... 5-2 X 5.3 AutoWrite ................................................... 5-2 X 5.4 CC .......................................................... 5-2 X 5.5 CharAttr .................................................... 5-2 X 5.6 COlumns ..................................................... 5-3 X 5.7 DIGraph ..................................................... 5-3 X 5.8 DIRectory ................................................... 5-3 X 5.9 EDcompatible ................................................ 5-3 X 5.10 ErrorBells ................................................. 5-3 X 5.11 ExRefresh .................................................. 5-3 X 5.12 FlipCase ................................................... 5-4 X 5.13 HideFormat ................................................. 5-4 X 5.14 IgnoreCase ................................................. 5-4 X 5.15 InputMode .................................................. 5-4 X 5.16 KeyTime .................................................... 5-4 X 5.17 KeywordPrg ................................................. 5-5 X 5.18 LiNes ...................................................... 5-5 X 5.19 LIst ....................................................... 5-5 X X X X X X X X X 5.20 MAgic ...................................................... 5-6 X 5.21 MaKe ....................................................... 5-6 X 5.22 ModeLine ................................................... 5-6 X 5.23 PAragraphs ................................................. 5-6 X 5.24 ReadOnly ................................................... 5-6 X 5.25 REport ..................................................... 5-7 X 5.26 SCroll ..................................................... 5-7 X 5.27 SEctions ................................................... 5-7 X 5.28 SHell ...................................................... 5-7 X 5.29 ShiftWidth ................................................. 5-7 X 5.30 ShowMatch .................................................. 5-8 X 5.31 ShowMoDe ................................................... 5-8 X 5.32 SideScroll ................................................. 5-8 X 5.33 SYnc ....................................................... 5-8 X 5.34 TabStop .................................................... 5-8 X 5.35 TErm ....................................................... 5-9 X 5.36 VBell ...................................................... 5-9 X 5.37 WArn ....................................................... 5-9 X 5.38 WrapMargin ................................................. 5-9 X 5.39 WrapScan ................................................... 5-9 X X 6. CUT BUFFERS .................................................... 6-1 X 6.1 Filling ..................................................... 6-1 X 6.2 Pasting from a Cut Buffer ................................... 6-2 X 6.3 Macros ...................................................... 6-2 X 6.4 The Effect of Switching Files ............................... 6-3 X X 7. DIFFERENCES BETWEEN ELVIS & BSD VI/EX .......................... 7-1 X 7.1 Extensions .................................................. 7-1 X 7.2 Omissions ................................................... 7-3 X X 8. INTERNAL ....................................................... 8-1 X 8.1 The temporary file .......................................... 8-1 X 8.2 Implementation of Editing ................................... 8-1 X 8.3 Marks and the Cursor ........................................ 8-2 X 8.4 Colon Command Interpretation ................................ 8-2 X 8.5 Screen Control .............................................. 8-2 X 8.6 Portability ................................................. 8-3 X X 9. CFLAGS ......................................................... 9-1 X X 10. TERMCAP ....................................................... 10-1 X 10.1 Required numeric fields .................................... 10-1 X 10.2 Required string fields ..................................... 10-1 X 10.3 Boolean fields ............................................. 10-1 X 10.4 Optional string fields ..................................... 10-1 X 10.5 Optional strings received from the keyboard ................ 10-1 X 10.6 Optional fields that describe character attributes ......... 10-2 X 10.7 Optional fields that affect the cursor's shape ............. 10-2 X 10.8 An example ................................................. 10-2 X X 11. ENVIRONMENT VARIABLES ......................................... 11-1 X 11.1 TERM, TERMCAP .............................................. 11-1 X 11.2 TMP, TEMP .................................................. 11-1 X 11.3 EXINIT ..................................................... 11-1 X 11.4 SHELL, COMSPEC ............................................. 11-1 X 11.5 HOME ....................................................... 11-1 X X X X X X X X X X 12. VERSIONS ...................................................... 12-1 X 12.1 BSD UNIX ................................................... 12-1 X 12.2 System-V UNIX .............................................. 12-1 X 12.3 SCO Xenix .................................................. 12-2 X 12.4 Minix ...................................................... 12-2 X 12.5 Coherent ................................................... 12-2 X 12.6 MS-DOS ..................................................... 12-3 X 12.7 Atari TOS .................................................. 12-4 X 12.8 OS9/68k .................................................... 12-4 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X eof if test `wc -c doc/ctags.man <<\eof X.TH CTAGS 1 X.SH NAME Xctags - Generates "tags" and (optionally) "refs" files X.SH SYNOPSIS X\fBctags\fP [\fB-r\fP] \fIfiles\fP... X.SH DESCRIPTION X\fIctags\fP generates the "tags" and "refs" files Xfrom a group of C source files. XThe "tags" file is used by Elvis' ":tag" command, Xcontrol-] command, Xand -t option. XThe "refs" file is used by the \fIref(1)\fP program. X.PP XEach C source file is scanned for #define statements and Xglobal function definitions. XThe name of the macro or function becomes the name of a tag. XFor each tag, a line is added to the "tags" file which contains: X.RS X.nf X - the name of the tag X - a tab character X - the name of the file containing the tag X - a tab character X - a way to find the particular line within the file. X.RE X.fi X.PP XThe "refs" file is used by the \fIref(1)\fP program, which can be invoked Xvia Elvis' K command. XWhen ctags finds a global function definition, Xit copies the function header into the "refs" file. XThe first line is flush against the right margin, Xbut the argument definitions are indented. XThe ref program can search the "refs" file X.ul Xmuch Xfaster than it could search all of the C source files. X.PP XThe filenames list will typically be the names of all C source Xfiles in the current directory, like this: X.RS X.nf X$ ctags -r *.[ch] X.RE X.fi X.SH OPTIONS X.IP \fB-r\fP XThis causes \fIctags\fP to generate both "tags" and "refs". XWithout \fB-r\fP, it would only generate "tags". X.SH FILES X.IP tags XThe "tags" file. X.IP refs XThe "refs" file. X.SH "SEE ALSO" Xelvis(1), refs(1) X.SH BUGS XThis version of ctags doesn't parse ANSI-C source code very well. XIt has trouble recognizing the new-style function definitions. X.SH AUTHOR X.nf XSteve Kirkendall Xkirkenda@cs.pdx.edu X\&...uunet!tektronix!psueea!eecs!kirkenda X.fi eof if test `wc -c doc/elvis.man <<\eof X.TH ELVIS 1 X.SH NAME Xelvis, ex, vi, view, input - The editor X.SH SYNOPSIS X\fBelvis\fP [\fIflags\fP] [\fB+\fP\fIcmd\fP] [\fIfiles\fP...] X.SH DESCRIPTION X\fIElvis\fP is a text editor which emulates \fIvi\fP/\fIex\fP. X.PP XOn systems which pass the program name as an argument, such as Unix and Minix, Xyou may also install \fIelvis\fP under the names "ex", "vi", "view", and "input". XThese extra names would normally be links to elvis; Xsee the "ln" shell command. X.PP XWhen \fIelvis\fP is invoked as "vi", Xit behaves exactly as though it was invoked as "elvis". XHowever, if you invoke \fIelvis\fP as "view", Xthen the readonly option is set as though you had given it the "-R" flag. XIf you invoke \fIelvis\fP as "ex", Xthen \fIelvis\fP will start up in the colon command mode Xinstead of the visual command mode, Xas though you had given it the "-e" flag. XIf you invoke \fIelvis\fP as "input" or "edit", Xthen \fIelvis\fP will start up in input mode, Xas though the "-i" flag was given. X.SH OPTIONS X.IP \fB-r\fP XTo the real vi, this flag means that a previous edit should be recovered. X\fIElvis\fP, though, has a separate program, called \fIvirec(1)\fP, for recovering Xfiles. XWhen you invoke \fIelvis\fP with -r, \fIelvis\fP will tell you to run \fIvirec\fP. X.IP \fB-R\fP XThis sets the "readonly" option, Xso you won't accidentally overwrite a file. X.IP "\fB-t\fP \fItag\fP" XThis causes \fIelvis\fP to start editing at the given tag. X.IP "\fB-m\fP [\fIfile\fP]" X\fIElvis\fP will search through \fIfile\fP for something that looks like Xan error message from a compiler. XIt will then begin editing the source file that caused the error, Xwith the cursor sitting on the line where the error was detected. XIf you don't explicitly name a \fIfile\fP, then "errlist" is assumed. X.IP \fB-e\fP X\fIElvis\fP will start up in colon command mode. X.IP \fB-v\fP X\fIElvis\fP will start up in visual command mode. X.IP \fB-i\fP X\fIElvis\fP will start up in input mode. X.IP \fB+\fP\fIcommand\fP XIf you use the +\fIcommand\fP parameter, Xthen after the first file is loaded X\fIcommand\fP is executed as an EX command. XA typical example would be "elvis +237 foo", Xwhich would cause \fIelvis\fP to start editing foo and Xthen move directly to line 237. X.SH FILES X.IP /tmp/elv* XDuring editing, X\fIelvis\fP stores text in a temporary file. XFor UNIX, this file will usually be stored in the /tmp directory, Xand the first three characters will be "elv". XFor other systems, the temporary files may be stored someplace else; Xsee the version-specific section of the documentation. X.IP tags XThis is the database used by the \fI:tags\fP command and the \fB-t\fP option. XIt is usually created by the \fIctags(1)\fP program. X.SH "SEE ALSO" Xctags(1), ref(1), virec(1) X.PP X\fIElvis - A Clone of Vi/Ex\fP, the complete \fIelvis\fP documentation. X.SH BUGS XThere is no LISP support. XCertain other features are missing, too. X.PP XAuto-indent mode is not quite compatible with the real vi. XAmong other things, 0^D and ^^D don't do what you might expect. X.PP XLong lines are displayed differently. XThe real vi wraps long lines onto multiple rows of the screen, Xbut \fIelvis\fP scrolls sideways. X.SH AUTHOR X.nf XSteve Kirkendall Xkirkenda@cs.pdx.edu X\&...uunet!tektronix!psueea!eecs!kirkenda X.fi X.PP XMany other people have worked to port \fIelvis\fP to various operating systems. XTo see who deserves credit, run the \fI:version\fP command from within \fIelvis\fP, Xor look in the system-specific section of the complete documentation. eof if test `wc -c doc/ref.man <<\eof X.TH REF 1 X.SH NAME Xref - Display a C function header X.SH SYNOPSIS X\fBref\fP \fIfunction_name\fP X.SH DESCRIPTION X\fIRef\fP is a program which looks up the function header of a Xparticular function in any of a series of reference files. XThese reference files are produced by the \fIctags(1)\fP program. X.PP X\fIRef\fP is used by Elvis's shift-K command. X.PP XThe list of files checked includes "refs" in the current directory, Xand possibly others. XSee the source code for an accurate list. X.SH AUTHOR X.nf XSteve Kirkendall Xkirkenda@cs.pdx.edu X\&...uunet!tektronix!psueea!eecs!kirkenda X.fi eof if test `wc -c doc/refont.man <<\eof X.TH REFONT 1 X.SH NAME Xrefont - changes the notation used for fonts X.SH SYNOPSIS X\fBrefont\fP [\fIflags\fP] \fIfiles\fP... X.SH DESCRIPTION X\fIRefont\fP reads a text file which contains font selection codes embedded Xwithin it, Xand it writes the same text with a different notation for fonts. X.PP XFor example, the Elvis documentation uses Epson-compatible escape sequences Xto select different fonts. XYou could use the command "refont -b intro.doc >intro.b" to make a file Xthat uses overtyping to implement boldface or underlined text. X.SH OPTIONS X.IP \fB-b\fP XEmit text which uses the "backspace" notation for fonts. XEach underlined character will be preceded by an underscore character Xand a backspace character. XBold characters are sent twice, with a backspace in between. XThe UNIX \fImore\fR utility understands this notation. X.IP \fB-c\fP XEmit text which uses the "carriage-return" notation for fonts. XAn entire line of text is written, Xfollowed by a carriage return instead of a newline. XThen a space is sent for each normal character, Xan underscore is sent for each underlined or italic character, Xand each boldface character is sent a second time. XMany mainframe line printers accept this notation. X.IP \fB-d\fP XEmit text which uses nroff-style "dot" commands for fonts. XThis doesn't work very well. X.IP \fB-e\fP XEmit text using Epson-compatible escape sequences for fonts. XThis is useful as a "least common denominator" for font notations, Xbecause this is the only supported notation to use control-character sequences Xand also distinguish between italics and underlining. X.IP \fB-f\fP XEmit text which uses nroff's "\\fX" notation for fonts. XUnderlined text is denoted by "\\fU", Xboldface by "\\fB", Xitalics by "\\fI", Xand normal text by "\\fR". XThis is somewhat useful in conjunction with Elvis' "charattr" option. X.IP \fB-x\fP XEmit text which has had all font information stripped out. X.IP \fB-I\fP XWhen reading text, \fB-I\fP tells \fIrefont\fP to accept any of the above Xnotations for fonts. XWithout \fB-I\fP it will ignore the "dot" command and "\\fX" notations; Xthey will be treated as normal text. XIn other words, without \fB-I\fP the only things that could be recognized as Xfont changes are control-character sequences. X.IP \fB-F\fP XThis causes \fIrefont\fP to insert formfeed characters between input files. X.SH BUGS XSupport for the nroff-style "dot" commands is not very good. X.PP XWith \fB-b\fP/\fB-c\fP, both underlining and italics are implemented by Xovertyping the underscore character with a text character. XSince they are represented the same way, the distinction between underlining Xand italics is lost. X.SH AUTHOR X.nf XSteve Kirkendall Xkirkenda@cs.pdx.edu X\&...uunet!tektronix!psueea!eecs!kirkenda eof if test `wc -c doc/virec.man <<\eof X.TH VIREC 1 X.SH NAME Xvirec - Recover the modified version of a file after a crash X.SH SYNOPSIS X.nf X\fBvirec\fP [\fB-d\fP \fItmpdir\fP] \fItextfilename...\fP X\fBvirec\fP