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

📄 ex.rm

📁 早期freebsd实现
💻 RM
📖 第 1 页 / 共 4 页
字号:
An offset relative to the current buffer line.\(dg.FS\(dgThe forms `.+3' `+3' and `+++' are all equivalent;if the current line is line 100 they all address line 103..FE.IP \fB/\fIpat\fR\fB/\fR\ \fB?\fIpat\fR\fB?\fR 20Scan forward and backward respectively for a line containing \fIpat\fR, aregular expression (as defined below).  The scans normally wrap around the endof the buffer.If all that is desired is to print the next line containing \fIpat\fR, thenthe trailing \fB/\fR or \fB?\fR may be omitted.If \fIpat\fP is omitted or explicitly empty, then the lastregular expression specified is located.\(dd.FS\(dd The forms \fB\e/\fP and \fB\e?\fP scanusing the last regular expression used in a scan; after a substitute\fB//\fP and \fB??\fP would scan using the substitute's regular expression..FE.IP \fB\(aa\(aa\fP\ \fB\(aa\fP\fIx\fP 20Before each non-relative motion of the current line `\fB.\fP',the previous current line is marked with a tag, subsequently referred to as`\(aa\(aa'.This makes it easy to refer or return to this previous context.Marks may also be established by the.I markcommand, using single lower case letters.I xand the marked lines referred to as`\(aa\fIx\fR'..NH 2Combining addressing primitives.PPAddresses to commands consist of a series of addressing primitives,separated by `,' or `;'.Such address lists are evaluated left-to-right.When addresses are separated by `;' the current line `\fB.\fR'is set to the value of the previous addressing expressionbefore the next address is interpreted.If more addresses are given than the command requires,then all but the last one or two are ignored.If the command takes two addresses, the first addressed line mustprecede the second in the buffer.\(dg.FS\(dg Null address specifications are permitted in a list of addresses,the default in this case is the current line `.';thus `,100' is equivalent to `\fB.\fR,100'.It is an error to give a prefix address to a command which expects none..FE.NH 1Command descriptions.PPThe following form is a prototype for all.I excommands:.DS\fIaddress\fR \fBcommand\fR \fI! parameters count flags\fR.DEAll parts are optional; the degenerate case is the empty command which printsthe next line in the file.  For sanity with use from within.I visualmode,.I exignores a ``:'' preceding any command..PPIn the following command descriptions, thedefault addresses are shown in parentheses,which are.I not,however,part of the command..LC\fBabbreviate\fR \fIword rhs\fP	abbr: \fBab\fP.ZPAdd the named abbreviation to the current list.When in input mode in visual, if.I wordis typed as a complete word, it will be changed to.I rhs ..LC( \fB.\fR ) \fBappend\fR	abbr: \fBa\fR.br\fItext\fR.br\&\fB.\fR.ZPReads the input text and places it after the specified line.After the command, `\fB.\fR'addresses the last line input or thespecified line if no lines were input.If address `0' is given,text is placed at the beginning of the buffer..LC\fBa!\fR.br\fItext\fR.br\&\fB.\fR.ZPThe variant flag to.I appendtoggles the setting for the.I autoindentoption during the input of.I text..LC\fBargs\fR.ZPThe members of the argument list are printed, with the current argumentdelimited by `[' and `]'..ig.PP\fBcd\fR \fIdirectory\fR.ZPThe.I cdcommand is a synonym for.I chdir....LC( \fB.\fP , \fB.\fP ) \fBchange\fP \fIcount\fP	abbr: \fBc\fP.br\fItext\fP.br\&\fB.\fP.ZPReplaces the specified lines with the input \fItext\fP.The current line becomes the last line input;if no lines were input it is left as for a\fIdelete\fP..LC\fBc!\fP.br\fItext\fP.br\&\fB.\fP.ZPThe variant toggles.I autoindentduring the.I change..ig.LC\fBchdir\fR \fIdirectory\fR.ZPThe specified \fIdirectory\fR becomes the current directory.If no directory is specified, the current value of the.I homeoption is used as the target directory.After a.I chdirthe current file is not considered to have beenedited so that write restrictions on pre-existing files apply....LC( \fB.\fP , \fB.\fP )\|\fBcopy\fP \fIaddr\fP \fIflags\fP	abbr: \fBco\fP.ZPA.I copyof the specified lines is placed after.I addr,which may be `0'.The current line`\fB.\fR'addresses the last line of the copy.The command.I tis a synonym for.I copy..LC( \fB.\fR , \fB.\fR )\|\fBdelete\fR \fIbuffer\fR \fIcount\fR \fIflags\fR	abbr: \fBd\fR.ZPRemoves the specified lines from the buffer.The line after the last line deleted becomes the current line;if the lines deleted were originally at the end,the new last line becomes the current line.If a named.I bufferis specified by giving a letter,then the specified lines are saved in that buffer,or appended to it if an upper case letter is used..LC\fBedit\fR \fIfile\fR	abbr: \fBe\fR.br\fBex\fR \fIfile\fR.ZPUsed to begin an editing session on a new file.The editorfirst checks to see if the buffer has been modified since the last.I writecommand was issued.If it has been,a warning is issued and thecommand is aborted.Thecommand otherwise deletes the entire contents of the editor buffer,makes the named file the current file and prints the new filename.After insuring that this file is sensible\(dg.FS\(dg I.e., that it is not a binary file such as a directory,a block or character special file other than.I /dev/tty,a terminal,or a binary or executable file(as indicated by the first word)..FEthe editor reads the file into its buffer..IPIf the read of the file completes without error,the number of lines and characters read is typed.If there were any non-\s-2ASCII\s0 charactersin the file they are stripped of their non-\s-2ASCII\s0high bits,and any null characters in the file are discarded.If none of these errors occurred, the file is considered.I edited.If the last line of the input file is missing the trailingnewline character, it will be supplied and a complaint will be issued.This command leaves the current line `\fB.\fR' at the last line read.\(dd.FS\(dd If executed from within.I openor.I visual,the current line is initially the first line of the file..FE.LC\fBe!\fR \fIfile\fR.ZPThe variant form suppresses the complaint about modifications havingbeen made and not written from the editor buffer, thusdiscarding all changes which have been made before editing the new file..LC\fBe\fR \fB+\fIn\fR \fIfile\fR.ZPCauses the editor to begin at line.I nrather than at the last line;\fIn\fR may also be an editor command containing no spaces, e.g.: ``+/pat''..LC\fBfile\fR	abbr: \fBf\fR.ZPPrints the current file name,whether it has been `[Modified]' since the last.I write command,whether it is.I "read only" ,the current line,the number of lines in the buffer,and the percentage of the way through the buffer of the current line.*.FS* In the rare case that the current file is `[Not edited]' this isnoted also; in this case you have to use the form \fBw!\fR to write tothe file, since the editor is not sure that a \fBwrite\fR will notdestroy a file unrelated to the current contents of the buffer..FE.LC\fBfile\fR \fIfile\fR.ZPThe current file name is changed to.I filewhich is considered `[Not edited]'..LC( 1 , $ ) \fBglobal\fR /\fIpat\|\fR/ \fIcmds\fR	abbr: \fBg\fR.ZPFirst marks each line among those specified which matchesthe given regular expression.Then the given command list is executed with `\fB.\fR' initiallyset to each marked line..IPThe command list consists of the remaining commands on the currentinput line and may continue to multiple lines by ending all but thelast such line with a `\e'.If.I cmds(and possibly the trailing \fB/\fR delimiter) is omitted, each line matching.I patis printed..I Append,.I insert,and.I changecommands and associated input are permitted;the `\fB.\fR' terminating input may be omitted if it would be on thelast line of the command list..I Openand.I visualcommands are permitted in the command list and take input from the terminal..IPThe.I globalcommand itself may not appear in.I cmds.The.I undocommand is also not permitted there,as.I undoinstead can be used to reverse the entire.I globalcommand.The options.I autoprintand.I autoindentare inhibited during a.I global,(and possibly the trailing \fB/\fR delimiter) and the value of the.I reportoption is temporarily infinite,in deference to a \fIreport\fR for the entire global.Finally, the context mark `\'\'' is set to the value of`.' before the global command begins and is not changed during a globalcommand,except perhaps by an.I openor.I visualwithin the.I global..LC\fBg!\fR \fB/\fIpat\fB/\fR \fIcmds\fR	abbr: \fBv\fR.IPThe variant form of \fIglobal\fR runs \fIcmds\fR at each line not matching\fIpat\fR..LC( \fB.\fR )\|\fBinsert\fR	abbr: \fBi\fR.br\fItext\fR.br\&\fB.\fR.ZPPlaces the given text before the specified line.The current line is left at the last line input;if there were none input it is left at the line before the addressed line.This command differs from.I appendonly in the placement of text..KS.LC\fBi!\fR.br\fItext\fR.br\&\fB.\fR.ZPThe variant toggles.I autoindentduring the.I insert..KE.LC( \fB.\fR , \fB.\fR+1 ) \fBjoin\fR \fIcount\fR \fIflags\fR	abbr: \fBj\fR.ZPPlaces the text from a specified range of linestogether on one line.White space is adjusted at each junction to provide at leastone blank character, two if there was a `\fB.\fR' at the end of the line,or none if the first following character is a `)'.If there is already white space at the end of the line,then the white space at the start of the next line will be discarded..LC\fBj!\fR.ZPThe variant causes a simpler.I joinwith no white space processing; the characters in the lines are simplyconcatenated..LC( \fB.\fR ) \fBk\fR \fIx\fR.ZPThe.I kcommand is a synonym for.I mark.It does not require a blank or tab before the following letter..LC( \fB.\fR , \fB.\fR ) \fBlist\fR \fIcount\fR \fIflags\fR.ZPPrints the specified lines in a more unambiguous way:tabs are printed as `^I'and the end of each line is marked with a trailing `$'.The current line is left at the last line printed..LC\fBmap\fR \fIlhs\fR \fIrhs\fR.ZPThe.I mapcommand is used to define macros for use in.I visualmode..I Lhsshould be a single character, or the sequence ``#n'', for n a digit,referring to function key \fIn\fR.  When this character or function keyis typed in.I visualmode, it will be as though the corresponding \fIrhs\fR had been typed.On terminals without function keys, you can type ``#n''.See section 6.9 of the ``Introduction to Display Editing with Vi''for more details..LC( \fB.\fR ) \fBmark\fR \fIx\fR.ZPGives the specified line mark.I x,a single lower case letter.The.I xmust be preceded by a blank or a tab.The addressing form `\'x' then addresses this line.The current line is not affected by this command..LC( \fB.\fR , \fB.\fR ) \fBmove\fR \fIaddr\fR	abbr: \fBm\fR.ZPThe.I movecommand repositions the specified lines to be after.I addr .The first of the moved lines becomes the current line..LC\fBnext\fR	abbr: \fBn\fR.ZPThe next file from the command line argument list is edited..LC\fBn!\fR.ZPThe variant suppresses warnings about the modifications to the buffer nothaving been written out, discarding (irretrievably) any changes which mayhave been made..LC\fBn\fR \fIfilelist\fR.br\fBn\fR \fB+\fIcommand\fR \fIfilelist\fR.ZPThe specified.I filelistis expanded and the resulting list replaces thecurrent argument list;the first file in the new list is then edited.If.I commandis given (it must contain no spaces), then it is executed after editing the first such file..LC( \fB.\fR , \fB.\fR ) \fBnumber\fR \fIcount\fR \fIflags\fR	abbr: \fB#\fR or \fBnu\fR.ZPPrints each specified line preceded by its buffer linenumber.The current line is left at the last line printed..KS.LC( \fB.\fR ) \fBopen\fR \fIflags\fR	abbr: \fBo\fR.br( \fB.\fR ) \fBopen\fR /\fIpat\|\fR/ \fIflags\fR.ZPEnters intraline editing \fIopen\fR mode at each addressed line.If.I patis given,then the cursor will be placed initially at the beginning of thestring matched by the pattern.To exit this mode use Q.See.I "An Introduction to Display Editing with Vi"for more details..KE.LC\fBpreserve\fR.ZPThe current editor buffer is saved as though the system had just crashed.This command is for use only in emergencies when a.I writecommand has resulted in an error and you don't know how to save your work.After a.I preserveyou should seek help..LC( \fB.\fR , \fB.\fR )\|\fBprint\fR \fIcount\fR	abbr: \fBp\fR or \fBP\fR.ZPPrints the specified lineswith non-printing characters printed as control characters `^\fIx\fR\|';delete (octal 177) is represented as `^?'.The current line is left at the last line printed..LC( \fB.\fR )\|\fBput\fR \fIbuffer\fR	abbr: \fBpu\fR.ZPPuts backpreviously.I deletedor.I yankedlines.Normally used with.I deleteto effect movement of lines,or with.I yankto effect duplication of lines.If no.I bufferis specified, then the last.I deletedor.I yankedtext is restored.*.FS* But no modifying commands may intervene between the.I deleteor.I yankand the.I put,nor may lines be moved between files without using a named buffer..FEBy using a named buffer, text may be restored that was saved there at anyprevious time..LC\fBquit\fR	abbr: \fBq\fR.ZPCauses .I exto terminate.No automatic write of the editor buffer to a file is performed.However,.I exissues a warning message if the file has changedsince the last.I writecommand was issued, and does not.I quit.\(dg.FS\(dg \fIEx\fRwill also issue a diagnostic if there are more files in the argumentlist..FENormally, you will wish to save your changes, and you should give a \fIwrite\fR command;if you wish to discard them, use the \fBq!\fR command variant..LC\fBq!\fR.ZPQuits from the editor, discarding changes to the buffer without complaint..LC( \fB.\fR ) \fBread\fR \fIfile\fR	abbr: \fBr\fR.ZPPlaces a copy of the text of the given file in theediting buffer after the specified line.If no .I fileis given the current file name is used.The current file name is not changed unless there is none in whichcase.I filebecomes the current name.The sensibility restrictions for the .I edit

⌨️ 快捷键说明

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