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

📄 doc.sh

📁 操作系统源代码
💻 SH
📖 第 1 页 / 共 5 页
字号:
Xthe number of lines included in the range.X.PPXThe \fBf\fRile command tells you the name of the file,Xwhether it has been modified,Xthe number of lines in the file,Xand the current line number.XYou can also use it to change the name of the current file.X.PPXThe \fBso\fRurce command reads a sequence of colon mode commands from a file,Xand interprets them.X.PPXThe \fB@\fR command executes the contents of a cut-buffer as EX commands.X.PPXThe \fBcol\fRor command only works under MS-DOS, or if you have an ANSI-compatibleXcolor terminal.XIt allows you to set the foreground and background colorsXfor different types of text:Xnormal, bold, italic, underlined, standout, pop-up menu, and visible selection.XBy default, it changes the "normal" colors;Xto change other colors, the first argument to the :color command should beXthe first letter of the type of text you want.XThe syntax for the colors themselves is fairly intuitive.XFor example, ":color light cyan on blue" causes normal text to be displayedXin light cyan on a blue background, andX":color b bright white" causes bold text to be displayed in bright white onXa blue background.XThe background color always defaults to the current background color ofXnormal text.XYour first :color command \fImust\fP specify both the foreground and backgroundXfor normal text.X.NH 2XMultiple File CommandsX.if n .ul 0X.IDX.psXargs [files]Xnext[!] [files]XNext[!]Xprevious[!]Xrewind[!]X.DEX.PPXWhen you invoke \*E from your shell's command line,Xany filenames that you give to \*E as arguments are stored in the args list.XThe \fBar\fRgs command will display this list, or define a new one.X.PPXThe \fBn\fRext command switches from the current file to the next oneXin the args list.XYou may specify a new args list here, too.X.PPXThe \fBN\fRext and \fBpre\fRvious commandsX(they're really aliases for the same command)Xswitch from the current file to the preceding file in the args list.X.PPXThe \fBrew\fRind command switches from the current file to the first fileXin the args list.X.NH 2XSwitching FilesX.if n .ul 0X.IDX.psXedit[!] [file]Xtag[!] tagnameX.DEX.PPXThe \fBe\fRdit command allows to switch from the current file to some other file.XThis has nothing to do with the args list, by the way.X.PPXThe \fBta\fRg command looks up a given tagname in a file called "tags".XThis tells it which file the tag is in, and how to find it in that file.X\*E then switches to the tag's file and finds the tag.X.NH 2XWorking with a CompilerX.if n .ul 0X.IDX.psXcc [files]Xmake [target]Xerrlist[!] [errlist]X.DEX.PPXThe \fBcc\fR and \fBmak\fRe commands execute your compiler or "make" utilityXand redirect any error messages into a file called "errlist".XBy default, cc is run on the current file.X(You should write it before running cc.)XThe contents of the "errlist" file are then scanned for error messages.XIf an error message is found, then the cursor is moved to the line whereXthe error was detected,Xand the description of the error is displayed on the status line.X.PPXAfter you've fixed one error, the \fBer\fRrlist command will moveXthe cursor to the next error.XIn visual command mode,Xhitting `*' will do this, too.X.PPXYou can also create an "errlist" file from outside of \*E,Xand use "\*E -m" to start elvis and have the cursor moved to theXfirst error.XNote that you don't need to supply a filename with "\*E -m" becauseXthe error messages always say which source file an error is in.X.PPXNote:XWhen you use errlist repeatedly to fix several errors in a single file,Xit will attempt to adjust the reported line numbers to allow for linesXthat you have inserted or deleted.XThese adjustments are made with the assumption that you will work thoughXthe file from the beginning to the end.X.NH 2XExit CommandsX.if n .ul 0X.IDX.psXquit[!]XwqXxitX.DEX.PPXThe \fBq\fRuit command exits from the editor without saving your file.X.PPXThe \fBwq\fR command writes your file out, then then exits.X.PPXThe \fBx\fRit command is similar to the \fBwq\fR command, except thatX\fBx\fRit won't bother to write your file if you haven't modified it.X.NH 2XFile I/O CommandsX.if n .ul 0X.IDX.psX[line] read fileX[line][,line] write[!] [[>>]file]X.DEX.PPXThe \fBr\fRead command gets text from another file and inserts itXafter the specified line.XIt can also read the output of a program;Xsimply precede the program name by a '!' and use it in place of the file name.X.PPXThe \fBw\fRrite command writes the whole file, or just part of it,Xto some other file.XThe !, if present, will permit the lines to be written even if you've setXthe readonly option.XIf you precede the filename by >> then the lines will be appended to the file.XYou can send the lines to the standard input of a program by replacing theXfilename with a '!' followed by the command and its arguments.X.PPXNote: Be careful not to confuse ":w!filename" and ":w !command".XTo write to a program, you must have at least one blank before the '!'.X.NH 2XDirectory CommandsX.if n .ul 0X.IDX.psXcd [directory]Xchdir [directory]XshellX.DEX.PPXThe \fBcd\fR and \fBchd\fRir commandsX(really two names for one command)Xswitch the current working directory.X.PPXThe \fBsh\fRell command starts an interactive shell.X.NH 2XDebugging CommandsX.if n .ul 0X.IDX.psX[line][,line] debug[!]Xvalidate[!]X.DEX.PPXThese commands are only available if you compile \*E with the -DDEBUG flag.X.PPXThe de\fBb\fRug command lists statistics for the blocks which containXthe specified range of lines.XIf the ! is present, then the contents of those blocks is displayed, too.X.PPXThe \fBva\fRlidate command checks certain variables for internal consistency.XNormally it doesn't output anything unless it detects a problem.XWith the !, though, it will always produce *some* output./echo x - index.mssed '/^X/s///' > index.ms << '/'X.XS 1XINTRODUCTIONXWhat E\s-2LVIS\s+2 does,XCopyright,XHow to compile E\s-2LVIS\s+2,XOverviewX.XA 2XVISUAL MODE COMMANDSXNormal interactive editing,XInput mode,XArrow keys,XDigraphs,XAbbreviations,XAuto-indentationX.XA 3XCOLON MODE COMMANDSXLine specifiers,XText entry,XCut & paste,XDisplay text,XGlobal operations,XLine editing,XUndo,XConfiguration & status,XMultiple files,XSwitching files,XWorking with a compiler,XExiting,XFile I/O,XDirectory & shell,XDebuggingX.XA 4XREGULAR EXPRESSIONSXSyntax,XOptions,XSubstitutions,XExamplesX.XA 5XOPTIONSXAutoindent,XAutoprint,Xetc.X.XA 6XCUT BUFFERSXPutting text into a cut buffer,XPasting from a cut buffer,XMacros,XThe effect of switching filesX.XA 7XDIFFERENCES BETWEEN E\s-2LVIS\s+2 AND THE REAL VI/EXXExtensions,XOmissionsX.XA 8XINTERNALXFor programmers only,XThe temporary file,XImplementation of editing,XMarks and the cursor,XColon command interpretation,XScreen control,XPortabilityX.XA 9XCFLAGSX.XA 10XTERMCAPX.XA 11XENVIRONMENT VARIABLESX.XA 12XVERSIONSX.XA 13XQUESTIONS & ANSWERSX.XEX.PXX.sp 0.3iX.ce 1XUNIX-style "man" pages appear at the end of this manual./echo x - internal.mssed '/^X/s///' > internal.ms << '/'X.Go 8 "INTERNAL"X.PPXYou don't need to know the material in this section to use \*E.XYou only need it if you intend to modify \*E.X.PPXYou should also check out the CFLAGS, TERMCAP, ENVIRONMENT VARIABLES,XVERSIONS, and QUIESTIONS & ANSWERS sections of this manual.X.NH 2XThe temporary fileX.PPXThe temporary file is divided into blocks of 1024 bytes each.XThe functions in "blk.c" maintain a cache of the five most recently used blocks,Xto minimize file I/O.X.PPXWhen \*E starts up, the file is copied into the temporary fileXby the function \fBtmpstart()\fR in "tmp.c".XSmall amounts of extra space are inserted into the temporary file toXinsure that no text lines cross block boundaries.XThis speeds up processing and simplifies storage management.XThe extra space is filled with NUL characters.Xthe input file must not contain any NULs, to avoid confusion.XThis also limits lines to a length of 1023 characters or less.X.PPXThe data blocks aren't necessarily stored in sequence.XFor example, it is entirely possible that the data block containingXthe first lines of text will be stored after the block containing theXlast lines of text.X.PPXIn RAM, \*E maintains two lists: one that describes the "proper"Xorder of the disk blocks, and another that records the line number ofXthe last line in each block.XWhen \*E needs to fetch a given line of text, it uses these tablesXto locate the data block which contains that line.X.PPXBefore each change is made to the file, these lists are copied.XThe copies can be used to "undo" the change.XAlso, the first listX-- the one that lists the data blocks in their proper order --Xis written to the first data block of the temp file.XThis list can be used during file recovery.X.PPXWhen blocks are altered, they are rewritten to a \fIdifferent\fR block in the file,Xand the order list is updated accordingly.XThe original block is left intact, so that "undo" can be performed easily.X\*E will eventually reclaim the original block, when it is no longer needed.X.NH 2XImplementation of EditingX.PPXThere are three basic operations which affect text:X.IDX\(bu delete text	- delete(from, to)X\(bu add text	- add(at, text)X\(bu yank text	- cut(from, to)X.DEX.PPXTo yank text, all text between two text positions is copied into a cut buffer.XThe original text is not changed.XTo copy the text into a cut buffer,Xyou need only remember which physical blocks that contain the cut text,Xthe offset into the first block of the start of the cut,Xthe offset into the last block of the end of the cut,Xand what kind of cut it was.X(Cuts may be either character cuts or line cuts;Xthe kind of a cut affects the way it is later "put".)XYanking is implemented in the function \fBcut()\fR,Xand pasting is implemented in the function \fBpaste()\fR.XThese functions are defined in "cut.c".X.PPXTo delete text, you must modify the first and last blocks, andXremove any reference to the intervening blocks in the header's list.XThe text to be deleted is specified by two marks.XThis is implemented in the function \fBdelete()\fR.X.PP

⌨️ 快捷键说明

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