📄 ex.summary
字号:
\fR"ch9" [Modified] 3 lines ...\*c.fiT}.SP(1,$)\fBglobal g \fBglobal/\fIpattern\fB/\fIcommands T{.nf:\fBg/nonsense/d\fR\*c.fiT}\fR(1,$)\fBglobal! g!\fR or \fBv T{Searches the entire buffer (unless a smallerrange is specified by line-number prefixes) andexecutes \fIcommands\fR on every line withan expression matching \fIpattern\fR.The second form, abbreviatedeither \fBg!\fR or \fBv\fR,executes \fIcommands\fR on lines that \fIdonot\fR contain the expression \fIpattern\fR.T} \^.SP\fR(.)\fBinsert i T{Inserts new lines of text immediately before the specified line.Differs from.I appendonly in that text is placed before, rather than after, the indicated line.In other words, \fB1i\fR has the same effect as \fB0a\fR.T} T{.nf:\fB1iThese lines of text willbe added prior to line 1.\&.\fR:.fiT} \^.SP\fR(.,.+1)\fBjoin j T{Join lines together, adjusting white space (spacesand tabs) as necessary.T} T{.nf:\fB2,5j\fRResulting line is printed:.fiT} \^.TE.bp.TScp10 cp10 cp10 cp10ltw(1.0i) lt2w(0.40i)fB ltw(3.0i) ltw(1.8i).Name Abbr Description Examples.sp 1.75\fR(.,.)\fBlist l T{\fRPrints lines in a moreunambiguous way than the \fIprint\fRcommand does. The end of a line,for example, is marked with a ``$'',and tabs printed as ``^I''.T} T{.nf:\fB9l\fRThis is line 9$\*c.fiT}.TE.sp 0.5v.TSltw(1.0i) lt2w(0.40i)fB ltw(3.0i) ltw(1.8i).\fR(.,.)\fBmove \fIaddr\fB m T{\fRMoves the specified linesto a position after the lineindicated by \fIaddr\fR.T} T{.nf\fR:\fB12,15m 25\fRNew current line is printed\*c.fiT}.SP\fR(.,.)\fBnumber nu T{Prints each line precededby its buffer line number.T} T{.nf\fR:\fBnu\0\0\fR10\0 This is line 10\*c.fiT}.SP\fR(.)\fBopen o T{Too involved to discuss here,but if you enter open modeaccidentally, pressthe \s-2ESC\s0 key followed by\fBq\fR toget back into normal editorcommand mode.\fIEdit\fP is designed toprevent accidental use ofthe open command.T} .SP\fBpreserve pre T{Saves a copy of the current buffer contents as though the system hadjust crashed. This is for use in an emergency when a.I writecommand has failed and you don't know how else to save your work.\(dgT} T{.nf:\fBpreserve\fRFile preserved.:.fiT}.SP\fR(.,.)\fBprint p Prints the text of line(s). T{.nf:\fB+2,+3p\fRThe second and third linesafter the current line:.fiT}.TE.FS\(dg Seek assistance from a consultant as soon as possibleafter saving a file with the.I preservecommand, because the file is saved on system storage space for only one week..FE.SP.nf.TSltw(1.0i) lt2w(0.40i)fB ltw(3.0i) ltw(1.8i).T{.nf\fBquitquit!.fiT} T{.nfqq!T} T{.fi\fREnds the editing session.You will receive awarning if you have changed the buffersince last writing its contentsto the file. In this event youmust either type \fBw\fR to write,or type \fBq!\fR to exit fromthe editor without saving your changes.T} T{.nf\fR:\fBq\fRNo write since last change:\fBq!\fR%.fiT}.SP\fR(.)\fBread \fIfile\fP r T{.fi\fRPlaces a copy of \fIfile\fR in thebuffer after the specified line.Address 0 is permissible and causesthe copy of \fIfile\fR to be placedat the beginning of the buffer.The \fIread\fP command does noterase any text already in the buffer.If no line number is specified,\fIfile\fR is placed after thecurrent line.T} T{.nf\fR:\fB0r newfile\fR"newfile" 5 lines, 86 characters\*c.fiT}.SP\fBrecover \fIfile\fP rec T{.fiRetrieves a copy of the editor bufferafter a system crash, editor crash,phone line disconnection, or\fIpreserve\fR command.T}.SP\fR(.,.)\fBsubstitute s T{.nf\fBsubstitute/\fIpattern\fB/\fIreplacement\fB/substitute/\fIpattern\fB/\fIreplacement\fB/gc.fi\fRReplaces the first occurrence of \fIpattern\fRon a linewith \fIreplacement\fP.Including a \fBg\fR after the commandchanges all occurrences of \fIpattern\fPon the line.The \fBc\fR option allows the user toconfirm each substitution before it ismade; see the manual for details.T} T{.nf:\fB3p\fRLine 3 contains a misstake:\fBs/misstake/mistake/\fRLine 3 contains a mistake\*c.fiT}.TE.bp.TScp10 cp10 cp10 cp10ltw(1.0i) lt2w(0.40i)fB ltw(3.0i) ltw(1.8i).Name Abbr Description Examples.sp 1.75\fBundo u T{.fi\fRReverses the changes made inthe buffer by the last buffer-editingcommand.Note that this example containsa notification about the number oflines affected.T} T{.nf\fR:\fB1,15d\fR15 lines deletednew line number 1 is printed:\fBu\fR15 more lines in file ...old line number 1 is printed\*c.fiT}.SP\fR(1,$)\fBwrite \fIfile\fR w T{.fi\fRCopies data from the buffer ontoa permanent file. If no \fIfile\fRis named, the current filenameis used.The file is automatically createdif it does not yet exist.A response containing the number oflines and characters in the fileindicates that the writehas been completed successfully.The editor's built-in protectionsagainst overwriting existing fileswill in some circumstancesinhibit a write.The form \fBw!\fR forces thewrite, confirming thatan existing file is to be overwritten.T} T{.nf\fR:\fBw\fR"file7" 64 lines, 1122 characters:\fBw file8\fR"file8" File exists ...:\fBw! file8\fR"file8" 64 lines, 1122 characters\*c.fiT}\fR(1,$)\fBwrite! \fIfile\fP w! \^ \^.TE.sp 0.5v.TSltw(1.0i) lt2w(0.40i)fB ltw(3.0i) ltw(1.8i).\fR(.)\fBz \fIcount\fP z T{.fi\fRPrints a screen full of text startingwith the line indicated;or, if \fIcount\fR is specified,prints that number of lines.Variants of the \fIz\fR commandare described in the manual.T} .SP\fB!\fIcommand T{.fiExecutes the remainder of the lineafter \fB!\fR as a \*U command.The buffer is unchanged by this, andcontrol is returned to the editor whenthe execution of \fIcommand\fR is complete.T} T{.nf\fR:\fB!date\fRFri Jun 9 12:15:11 PDT 1978!\*c.fiT}.SP\fRcontrol-d T{.fiPrints the next \fIscroll\fR of text,normally half of a screen. See themanual for details of the \fIscroll\fRoption.T}.SP\fR(.+1)<cr> T{.fiAn address alone followed by a carriagereturn causes the line to be printed.A carriage return by itself prints theline following the current line.T} T{.nf:\fR<cr>the line after the current line\*c.fiT}.TE.sp 0.5v.TSltw(1.0i) lt2w(0.40i)fB ltw(3.0i) ltw(1.8i).\fB/\fIpattern\fB/ T{.fi\fRSearches for the next line in which\fIpattern\fR occurs and prints it.T} T{.nf\fR:\fB/This pattern/\fRThis pattern next occurs here.\*c.fiT}.SP\fB// T{Repeats the most recent search.T} T{.nf\fR:\fB//\fRThis pattern also occurs here.\*c.fiT}.SP\fB?\fIpattern\fB? T{Searches in the reverse directionfor \fIpattern\fP.T} .SP\fB?? T{Repeats the most recent search,moving in the reverse directionthrough the buffer.T}.TE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -