⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex.rm

📁 早期freebsd实现
💻 RM
📖 第 1 页 / 共 4 页
字号:
`\(ua', `[', or `\-' in.I stringyou must escape them with a preceding `\e'..NH 2Combining regular expression primitives.PPThe concatenation of two regular expressions matches the leftmost andthen longest stringwhich can be divided with the first piece matching the first regularexpression and the second piece matching the second.Any of the (single character matching) regular expressions mentionedabove may be followed by the character `*' to form a regular expressionwhich matches any number of adjacent occurrences (including 0) of charactersmatched by the regular expression it follows..PPThe character `\s+2~\s0' may be used in a regular expression,and matches the text which defined the replacement partof the last.I substitutecommand.A regular expression may be enclosed between the sequences`\e(' and `\e)' with side effects in the.I substitutereplacement patterns..NH 2Substitute replacement patterns.PPThe basic metacharacters for the replacement pattern are`&' and `~'; these aregiven as `\e&' and `\e~' when.I nomagicis set.Each instance of `&' is replaced by the characterswhich the regular expression matched.The metacharacter `~' stands, in the replacement pattern,for the defining text of the previous replacement pattern..PPOther metasequences possible in the replacement patternare always introduced by the escaping character `\e'.The sequence `\e\fIn\fR' is replaced by the text matchedby the \fIn\fR-th regular subexpression enclosed between`\e(' and `\e)'.\(dg.FS\(dg When nested, parenthesized subexpressions are present,\fIn\fR is determined by counting occurrences of `\e(' starting from the left..FEThe sequences `\eu' and `\el' cause the immediately following character inthe replacement to be converted to upper- or lower-case respectivelyif this character is a letter.The sequences `\eU' and `\eL' turn such conversion on, either until`\eE' or `\ee' is encountered, or until the end of the replacement pattern..de LC.br.sp .1i.ne 4.LP.ta 3i...NH 1Option descriptions.PP.LC\fBautoindent\fR, \fBai\fR	default: noai.ZPCan be used to ease the preparation of structured program text.At the beginning of each.I append ,.I changeor.I insertcommandor when a new line is.I openedor created by an.I append ,.I change ,.I insert ,or.I substituteoperation within.I openor.I visualmode,.I exlooks at the line being appended after,the first line changedor the line inserted before and calculates the amount of white spaceat the start of the line.It then aligns the cursor at the level of indentation so determined..IPIf the user then types lines of text in,they will continue to be justified at the displayed indenting level.If more white space is typed at the beginning of a line,the following line will start aligned with the first non-white characterof the previous line.To back the cursor up to the preceding tab stop one can hit\fB^D\fR.The tab stops going backwards are defined at multiples of the.I shiftwidthoption.You.I cannotbackspace over the indent,except by sending an end-of-file with a \fB^D\fR..IPSpecially processed in this mode is a line with no characters addedto it, which turns into a completely blank line (the whitespace provided for the.I autoindentis discarded.)Also specially processed in this mode are lines beginning withan `\(ua' and immediately followed by a \fB^D\fR.This causes the input to be repositioned at the beginning of the line,but retaining the previous indent for the next line.Similarly, a `0' followed by a \fB^D\fRrepositions at the beginning but withoutretaining the previous indent..IP.I Autoindentdoesn't happen in.I globalcommands or when the input is not a terminal..LC\fBautoprint\fR, \fBap\fR	default: ap.ZPCauses the current line to be printed after each.I delete ,.I copy ,.I join ,.I move ,.I substitute ,.I t ,.I undoorshift command.This has the same effect as supplying a trailing `p'to each such command..I Autoprintis suppressed in globals,and only applies to the last of many commands on a line..LC\fBautowrite\fR, \fBaw\fR	default: noaw.ZPCauses the contents of the buffer to be written to the current fileif you have modified it and give a.I next,.I rewind,.I stop,.I tag,or.I !command, or a \fB^\(ua\fR (switch files) or \fB^]\fR (tag goto) commandin.I visual.Note, that the.I editand.I excommands do.B notautowrite.In each case, there is an equivalent way of switching when autowriteis set to avoid the.I autowrite(\fIedit\fRfor.I next ,.I rewind!for .I rewind ,.I stop!for.I stop ,.I tag!for.I tag ,.I shellfor.I ! ,and\fB:e\ #\fR and a \fB:ta!\fR command from within.I visual)..LC\fBbeautify\fR, \fBbf\fR	default: nobeautify.ZPCauses all control characters except tab, newline and form-feedto be discarded from the input.A complaint is registered the first time abackspace character is discarded..I Beautifydoes not apply to command input..LC\fBdirectory\fR, \fBdir\fR	default: dir=/tmp.ZPSpecifies the directory in which.I explaces its buffer file.If this directory in notwritable, then the editor will exit abruptly when it fails to beable to create its buffer there..LC\fBedcompatible\fR	default: noedcompatible.ZPCauses the presence of absence of.B gand.B csuffixes on substitute commands to be remembered, and to be toggledby repeating the suffices.  The suffix.B rmakes the substitution be as in the.I ~command, instead of like.I &..LC\fBerrorbells\fR, \fBeb\fR	default: noeb.ZPError messages are preceded by a bell.*.FS* Bell ringing in.I openand.I visualon errors is not suppressed by setting.I noeb..FEIf possible the editor always places the error message in a standout mode of theterminal (such as inverse video) instead of ringing the bell..LC\fBhardtabs\fR, \fBht\fR	default: ht=8.ZPGives the boundaries on which terminal hardware tabs are set (oron which the system expands tabs)..LC\fBignorecase\fR, \fBic\fR	default: noic.ZPAll upper case characters in the text are mapped to lower case in regularexpression matching.In addition, all upper case characters in regular expressions are mappedto lower case except in character class specifications..LC\fBlisp\fR	default: nolisp.ZP\fIAutoindent\fR indents appropriately for.I lispcode, and the \fB( ) { } [[\fR and \fB]]\fR commands in.I openand.I visualare modified to have meaning for \fIlisp\fR..LC\fBlist\fR	default: nolist.ZPAll printed lines will be displayed (more) unambiguously,showing tabs and end-of-lines as in the.I listcommand..LC\fBmagic\fR	default: magic for \fIex\fR and \fIvi\fR\(dg.FS\(dg \fINomagic\fR for \fIedit\fR..FE.ZPIf.I nomagicis set, the number of regular expression metacharacters is greatly reduced,with only `\(ua' and `$' having special effects.In addition the metacharacters`~'and`&'of the replacement pattern are treated as normal characters.All the normal metacharacters may be made.I magicwhen.I nomagicis set by preceding them with a `\e'..LC\fBmesg\fR	default: mesg.ZPCauses write permission to be turned off to the terminalwhile you are in visual mode, if.I nomesgis set..LC\fBmodeline\fR	default: nomodeline.ZPIf.I modelineis set, then the first 5 lines and the last five lines of the filewill be checked for ex command lines and the comands issued.To be recognized as a command line, the line must have the string.B ex:or.B vi:preceeded by a tab or a space.  This string may be anywhere in theline and anything after the .I :is interpeted as editor commands.  This option defaults to off becauseof unexpected behavior when editting files such as.I /etc/passwd..LC\fBnumber, nu\fR	default: nonumber.ZPCauses all output lines to be printed with theirline numbers.In addition each input line will be prompted for by supplying the line numberit will have..LC\fBopen\fR	default: open.ZPIf \fInoopen\fR, the commands.I openand.I visualare not permitted.This is set for.I editto prevent confusion resulting from accidental entry to open or visual mode..LC\fBoptimize, opt\fR	default: optimize.ZPThroughput of text is expedited by setting the terminalto not do automatic carriage returnswhen printing more than one (logical) line of output,greatly speeding output on terminals without addressablecursors when text with leading white space is printed..LC\fBparagraphs,\ para\fR	default: para=IPLPPPQPP\0LIbp.ZPSpecifies the paragraphs for the \fB{\fR and \fB}\fR operations in.I openand .I visual.The pairs of characters in the option's value are the namesof the macros which start paragraphs..LC\fBprompt\fR	default: prompt.ZPCommand mode input is prompted for with a `:'..LC\fBredraw\fR	default: noredraw.ZPThe editor simulates (using great amounts of output), an intelligentterminal on a dumb terminal (e.g. during insertions in.I visualthe characters to the right of the cursor position are refreshedas each input character is typed.)Useful only at very high speed..LC\fBremap\fP	default: remap.ZPIf on, macros are repeatedly tried until they are unchanged.For example, if.B ois mapped to.B O ,and.B Ois mapped to.B I ,then if.I remapis set,.B owill map to.B I ,but if.I noremapis set, it will map to.B O ..LC\fBreport\fR	default: report=5\(dg.FS\(dg 2 for \fIedit\fR..FE.ZPSpecifies a threshold for feedback from commands.Any command which modifies more than the specified number of lineswill provide feedback as to the scope of its changes.For commands such as.I global ,.I open ,.I undo ,and.I visualwhich have potentially more far reaching scope,the net change in the number of lines in the buffer ispresented at the end of the command, subject to this same threshold.Thus notification is suppressed during a.I globalcommand on the individual commands performed..LC\fBscroll\fR	default: scroll=\(12 window.ZPDetermines the number of logical lines scrolled when an end-of-fileis received from a terminal input in command mode,and the number of lines printed by a command mode.I zcommand (double the value of.I scroll )..LC\fBsections\fR	default: sections=SHNHH\0HU.ZPSpecifies the section macros for the \fB[[\fR and \fB]]\fR operationsin.I openand.I visual.The pairs of characters in the options's value are the namesof the macros which start paragraphs..LC\fBshell\fR, \fBsh\fR	default: sh=/bin/sh.ZPGives the path name of the shell forked for the shell escape command `!', and by the.I shellcommand.The default is taken from SHELL in the environment, if present..LC\fBshiftwidth\fR, \fBsw\fR	default: sw=8.ZPGives the width a software tab stop,used in reverse tabbing with \fB^D\fR when using.I autoindentto append text,and by the shift commands..LC\fBshowmatch, sm\fR	default: nosm.ZPIn.I openand.I visualmode, when a \fB)\fR or \fB}\fR is typed, move the cursor to the matching\fB(\fR or \fB{\fR for one second if this matching character is on thescreen.  Extremely useful with.I lisp..LC\fBslowopen, slow\fR	terminal dependent.ZPAffects the display algorithm used in.I visualmode, holding off display updating during input of new text to improvethroughput when the terminal in use is both slow and unintelligent.See.I "An Introduction to Display Editing with Vi"for more details..LC\fBtabstop,\ ts\fR	default: ts=8.ZPThe editor expands tabs in the input file to be on.I tabstopboundaries for the purposes of display..LC\fBtaglength,\ tl\fR	default: tl=0.ZPTags are not significant beyond this many characters.A value of zero (the default) means that all characters are significant..LC\fBtags\fR	default: tags=tags /usr/lib/tags.ZPA path of files to be used as tag files for the.I tagcommand.A requested tag is searched for in the specified files, sequentially.By default, files called.B tagsare searched for in the current directory and in /usr/lib(a master file for the entire system)..LC\fBterm\fR	from environment TERM.ZPThe terminal type of the output device..LC\fBterse\fR	default: noterse.ZPShorter error diagnostics are produced for the experienced user..LC\fBwarn\fR	default: warn.ZPWarn if there has been `[No write since last change]' before a `!'command escape..LC\fBwindow\fR	default: window=speed dependent.ZPThe number of lines in a text window in the.I visualcommand.The default is 8 at slow speeds (600 baud or less),16 at medium speed (1200 baud),and the full screen (minus one line) at higher speeds..LC\fBw300,\ w1200\, w9600\fR.ZPThese are not true options but set.B windowonly if the speed is slow (300), medium (1200), or high (9600),respectively.They are suitable for an EXINITand make it easy to change the 8/16/full screen rule..LC\fBwrapscan\fR, \fBws\fR	default: ws.ZPSearches using the regular expressions in addressingwill wrap around past the end of the file..LC\fBwrapmargin\fR, \fBwm\fR	default: wm=0.ZPDefines a margin for automatic wrapover of text during input in.I openand.I visualmodes.  See.I "An Introduction to Text Editing with Vi"for details..LC\fBwriteany\fR, \fBwa\fR	default: nowa.IPInhibit the checks normally made before.I writecommands, allowing a write to any file which the system protectionmechanism will allow..NH 1Limitations.PPEditor limits that the user is likely to encounter are as follows:1024 characters per line,256 characters per global command list,128 characters per file name,128 characters in the previous inserted and deleted text in.I openor.I visual,100 characters in a shell escape command,63 characters in a string valued option,and 30 characters in a tag name, anda limit of 250000 lines in the file is silently enforced..PPThe.I visualimplementation limits the number of macros defined with map to32, and the total number of characters in macros to be less than 512..LP.LP.I Acknowledgments.Chuck Haley contributed greatly to the early development of.I ex.Bruce Englar encouraged the redesign which led to.I exversion 1.Bill Joy wrote versions 1 and 2.0 through 2.7,and created the framework that users see in the present editor.Mark Horton added macros and other features and made theeditor work on a large number of terminals and Unix systems.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -