📄 doc.sh
字号:
echo x - cflags.mssed '/^X/s///' > cflags.ms << '/'X.Go 9 "CFLAGS"X.PPX\*E uses many preprocessor symbols to control compilation.XSome of these control the sizes of buffers and such.XThe "-DNO_XXXX" options remove small sets of related features.X.PPXMost \*E users will probably want to keep all features available.XMinix-PC users, though, will have to sacrifice some sets because otherwiseX\*E would be too bulky to compile.XThe "asld" phase of the compiler craps out.X.IP "-DM_SYSV, -Dbsd, -DTOS, -DCOHERENT, -Damiga"XThese flags tell the compiler that \*E is being compiled forXSystem-V UNIX, BSD UNIX, Atari TOS, Coherent, or AmigaDos, respectively.XFor other systems, the config.h file can generally figure it out automatically.X.IP -DRAINBOWXFor MS-DOS systems, this causes support for the DEC Rainbow to be compiledXinto \*E.X.IP -DS5WINSIZEXSome versions of SysV UNIX don't support support the "winsize"Xstyle of screen-size testing,Xso elvis ignores window size changes by default.X.IPXHowever, many of the newer SysV systems defines "winsize" in theXfile "/usr/include/sys/ptem.h".XIf your SysV system has "winsize" then you should addX-DS5SWINSIZE to the CFLAGS setting.X.IP -DTERMIOSXPOSIX is a SysV-derived specification which uses a terminal controlXpackage called "termios", instead of "termio".XSome other SysV systems may also use termios.XYou can make elvis uses termios instead of the more common termioXby adding -DTERMIOS to CFLAGS.X(Note: This hasn't been tested very well.)X.IP -DNBUFS=\fInumber\fPX\*E keeps most of your text in a temporary file;Xonly a small amount is actually stored in RAM.XThis flag allows you to control how much of the file can be in RAM at any time.XThe default is 5 blocks, and the minimum is 3 blocks.X(See the -DBLKSIZE flag, below.)X.IPXMore RAM allows global changes to happen a little faster.X f you're just making many small changes in one section of a file, though,Xextra RAM won't help much.X.IP -DBLKSIZE=\fInumber\fPXThis controls the size of blocks that \*E uses internally.XThe value of BLKSIZE must be a power of two.XEvery time you double BLKSIZE, you quadruple the size of a text file thatX\*E can handle, but you also cause the temporary file to grow faster.XFor MS-DOS, Coherent, and Minix-PC, the default value is 1024, which allowsXyou to edit files up to almost 512K bytes long.XFor all other systems, the default value is 2048, which allows you to editXfiles that are nearly 2 megabytes long.X.IPXThe BLKSIZE also determines the maximum line length, and a few other limits.XBLKSIZE should be either 256, 512, 1024, or 2048.XValues other than these can lead to strange behaviour.X.IP -DTMPDIR=\fIstring\fPXThis sets the default value of the "directory" option, which specifies whereXthe temporary files should reside.XThe value of TMPDIR must be a string, so be sure your value includes theXquote characters on each end.X.IP "-DEXRC=\fIstr\fP, -DHMEXRC=\fIstr\fP, -DSYSEXRC=\fIstr\fP, -DEXINIT=\fIstr\fP"XThis lets you control the names of the initialization files.XTheir values must be strings, so be careful about quoting.X.IPXEXRC is the name of the initialization file in the current directory.XIts default value is ".exrc" on UNIX systems -- the same as the real vi.XSince that isn't a legal DOS filename, under DOS the default is "elvis.rc".XFor other systems, check the config.h file.X.IPXHMEXRC is the name of the initialization file in your home directory.XBy default, it is the same as EXRC.X\*E will automatically prepend the name of your home directory to HMEXRCXat run time, so don't give a full path name.X.IPXSYSEXRC is the name of a system-wide initialization file.XIt has no default value;Xif you don't define a value for it, thenXthe code that supports SYSEXRC just isn't compiled.XThe value of SYSEXRC should be a full pathname, in quotes.X.IPXEXINIT is the name of an environment variable that can contain initializationXcommands.XNormally, its value is "EXINIT".X.IP -DKEYWORDPRG=\fIstring\fPXThis flag determines the default value of the "keywordprg" option.XIts value must be a string, so be careful about quoting.XThe default value of this flag is "ref", which is a C reference program.X.IP "-DCC_COMMAND=\fIstring\fP -DMAKE_COMMAND=\fIstring\fP -DERRLIST=\fIstring\fP"XThese control the names of the C compiler, the "make" utility, and theXerror output file, respectively.XThey are only used if -DNO_ERRLIST is not given.X.IPXThe default value of CC_COMMAND depends on the Operating System and compilerXthat you use to compile elvis;Xfor UNIX, the default is "cc".XThe default values of MAKE_COMMAND and ERRLIST are "make" and "errlist",Xrespectively.X.IP -DMAXRCLEN=\fInumber\fPXThis determines how large a :@ macro command can be (measured in bytes).XThe default is 1000 bytes.XIf you increase this value significantly,Xthen you may need to allocate extra memory for the stack.XSee the "CHMEM" setting in the Makefile.X.IP -DSHELL=\fIstring\fPXThis is the default value of the "shell" option, and henceXthe default shell used from within \*E.XThis only controls the default;Xthe value you give here may be overridden at run-time by settingXan environment variable named SHELL (or COMSPEC for MS-DOS).XIts value must be a string constant, so be careful about quoting.X.IP -DTAGS=\fIstring\fPXThis sets the name of the "tags" file,Xwhich is used by the :tag command.XIts value must be a string constant, so be careful about quoting.X.IP "-DCS_IBMPC -DCS_LATIN1 -DCS_SPECIAL"XThe digraph table and flipcase option will normally start out empty.XHowever, if you add -DCS_IBMPC or -DCS_LATIN1 to your CFLAGS,Xthen they will start out filled with values that are appropriate for theXIBM PC character set or the ISO Latin-1 character set, respectively.X.IPXYou can also use -DCS_IBMPC and -DCS_SPECIAL together to get digraphsXthat produce the PC's graphic characters.X.IP "-DDEBUG -DEBUG2"X-DDEBUG adds the ":debug" and ":validate" commands,Xand also adds many internal consistency checks.XIt increases the size of the ".text" segment by about 6K.X.IPX-DDEBUG2 causes a line to be appended to a file called "debug.out"Xeverytime any change is made to the edit buffer.X.IP -DCRUNCHXThis flag removes some non-critical code, so that \*E is smaller.XFor example, it removes a short-cut from the regexp package, so thatXtext searches are slower.XAlso, screen updates are not as efficient.XA couple of obscure features are disabled by this, too.X.IP -DNO_MKEXRCXThis removes the ":mkexrc" command,Xso you have to create any .exrc files manually.XThe size of the .text segment will be reduced by about 600 bytes.X.IP -DNO_CHARATTRXPermanently disables the charattr option.XThis reduces the size of your ".text" segment by about 850 bytes.X.IP -DNO_RECYCLEXNormally, \*E will recycle space (from the temporary file) which containsXtotally obsolete text.XThis flag disables this recycling.XWithout recycling, the ".text" segment is about 1K smallerXthan it would otherwise be,Xbut the tmp file grows much faster.XIf you have a lot of free space on your hard disk,Xbut \*E is too bulky to run with recycling,Xthen try it without recycling.X.IPXWhen using a version of \*E that has been compiled with -DNO_RECYCLE,Xyou should be careful to avoid making many small changes to a fileXbecause each individual change will cause the tmp file to grow by at least 1k.XHitting "x" thirty times counts as thirty changes,Xbut typing "30x" counts as one change.XAlso, you should occasionally do a ":w" followed by a ":e" to start with aXfresh tmp file.X.IPXInterestingly, the real vi never recycles space from its temporary file.X.IP -DNO_SENTENCEXLeaves out the "(" and ")" visual mode commands.XAlso, the "[[", "]]", "{", and "}" commands will not recognize *roff macros.XThe sections and paragraphs options go away.XThis saves about 650 bytes in the ".text" segment.X.IP -DNO_CHARSEARCHXLeaves out the visual commands which locate a given characterXin the current line:X"f", "t", "F", "T", "," and ";".XThis saves about 900 bytes.X.IP -DNO_EXTENSIONSXLeaves out the "K" and "#" visual commands.XAlso, the arrow keys will no longer work in input mode.XRegular expressions will no longer recognize the \\{\\} operator.X(Other extensions are either inherent in the design of \*E,Xor are controlled by more specific flags,Xor are too tiny to be worth removing.)XThis saves about 250 bytes.X.IP -DNO_MAGICXPermanently disables the "magic" option, so that most meta-charactersXin a regular expression are *NOT* recognized.XThis saves about 3k of space in the ".text" segment, becauseXthe complex regular expression code can be replaced by much simpler code.X.IP -DNO_SHOWMODEXPermanently disables the "showmode" option, saving about 250 bytes.X.IP -DNO_CURSORSHAPEXNormally, \*E tries to adjust the shape of the cursor as a reminderXof which mode you're in.XThe -DNO_CURSORSHAPE flag disables this, saving about 150 bytes.X.IP -DNO_DIGRAPHXTo allow entry of non-ASCII characters, \*E supports digraphs.XA digraph is a single (non-ASCII) character which is entered as aXcombination of two other (ASCII) characters.XIf you don't need to input non-ASCII characters,Xor if your keyboard supports a better way of entering non-ASCII characters,Xthen you can disable the digraph code and save about 450 bytes.X.IP -DNO_ERRLISTX\*E adds a ":errlist" command, which is useful to programmers.XIf you don't need this feature, you can disable it via the -DNO_ERRLIST flag.XThis will reduce the .text segment by about 900 bytes, and the .bss segmentXby about 300 bytes.X.IP -DNO_ABBRXThe -DNO_ABBR flag disables the ":abbr" command,Xand reduces the size of \*E by about 250 bytes.X.IP -DNO_OPTCOLSXWhen \*E displays the current options settings via the ":set" command,Xthe options are normally sorted into columns.XThe -DNO_OPTCOLS flag causes the options to be sorted across the rows,Xwhich is much simpler for the computer.XThe -DNO_OPTCOLS flag will reduce the size of your .text segment by aboutX500 bytes.X.IP -DNO_MODELINESXThis removes all support for modelines.X.IP -DNO_TAGXThis disables tag lookup.XIt reduces the size of the .text segment by about 750 bytes.X.IP "-DNO_ALT_FKEY -DNO_CTRL_FKEY -DNO_SHIFT_FKEY -DNO_FKEY"XThese remove explicit support of function keys.X-DNO_ALT_FKEY removes support for the <alternate> versions function keys.X-DNO_CTRL_FKEY removes support for the <control> and <alternate> versions function keys.X-DNO_SHIFT_FKEY removes support for the <shift>, <control>, and <alternate> versions function keys.X-DNO_FKEY removes all support of function keys.X.IPX\*E's ":map" command normally allows you to use the special sequence "#<n>"Xto map function key <n>.XFor example, ":map #1 {!}fmt^M" will cause the <F1> key to reformat a paragraph.X\*E checks the :k1=: field in the termcap description of your terminalXto figure out what code is sent by the <F1> key.XThis is handy because it allows you to create a .exrc file which maps functionXkeys the same way regardless of what type of terminal you use.X.IPXThat behaviour is standard; most implementations of the real vi supports it too.X\*E extends this to allow you to use "#1s" to refer to <shift>+<F1>,X"#1c" to refer to <control>+<F1>, andX"#1a" to refer to <alt>+<F1>.XThe termcap description for the terminal should have fields namedX:s1=:c1=:a1=: respectively, to define the code sent by these key conbinations.X(You should also have :k2=:s2=:c2=:a2=: for the <F2> key, and so on.)X.IPXBut there may be problems.XThe terminfo database doesn't support :s1=:c1=:a1=:, so no terminfo terminalXdescription could ever support shift/control/alt function keys;Xso you might as well add -DNO_SHIFT_FKEY to CFLAGS if you're using terminfo.X.IPXNote that, even if you have -DNO_FKEYS, you can still configure \*E to useXyour function keys my mapping the literal character codes sent by the key.XYou just couldn't do it in a terminal-independent way.XTERM_925X.IP "-DTERM_AMIGA -DTERM_VT100 -DTERM_VT52 etc."XThe tinytcap.c file contains descriptions of several terminal types.XFor each system that uses tinytcap, a reasonable subset of the availableXdescriptions is actually compiled into \*E.XIf you wish to enlarge this subset, then you can add the appropriate -DTERM_XXXXflag to your CFLAGS settings.X.IPXFor a list of the available terminal types, check the tinytcap.c file.X.IP -DINTERNAL_TAGSXNormally, \*E uses the "ref" program to perform tag lookup.XThis is more powerful than the real vi's tag lookup,Xbut it can be much slower.X.IPXIf you add -DINTERNAL_TAGS to your CFLAGS setting,Xthen \* will use its own internal tag lookup code, which is faster.X.IP -DPRSVDIR=\fIdirectory\fRXThis controls where preserved files will be placed.XAn appropriate default has been chosen for each Operating System,Xso you probably don't need to worry about it.X.IP -DFILEPERMS=\fInumber\fRXThis affects the attributes of files that are created by \*E;Xit is used as the second argument to the creat() function.XThe default is 0666 which (on UNIX systems at least) means thatXanybody can read or write the new file, but nobody can execute it.XOn UNIX systems, the creat() call modifies this via the umask setting.X.IP -DKEYBUFSIZE=\fInumber\fRXThis determines the size of the type-ahead buffer that elvis uses.XIt also limits the size of keymaps that it can handle.XThe default is 1000 characters, which should be plenty./echo x - cutbufs.mssed '/^X/s///' > cutbufs.ms << '/'X.Go 6 "CUT BUFFERS"X.PPXWhen \*E deletes text, it stores that text in a cut buffer.XThis happens in both visual mode and EX mode.XThere is no practical limit to how much text a cut buffer can hold.X.PPXThere are 36 cut buffers:X26 named buffers ("a through "z),X9 anonymous buffers ("1 through "9),Xand 1 extra cut buffer (".).X.PPXIn EX mode, the :move and :copy commands use a cut buffer to temporarilyXhold the text to be moved/copied.X.NH 2XPutting text into a Cut BufferX.PPXIn visual mode, text is copied into a cut buffer when you use theXd, y, c, C, s, or x commands.XThere are also a few others.X.PPXBy default, the text goes into the "1 buffer.XThe text that used to be in "1 gets shifted into "2,X"2 gets shifted into "3, and so on.XThe text that used to be in "9 is lost.XThis way, the last 9 things you deleted are still accessible.X.PPXYou can also put the text into a named buffer -- "a through "z.XTo do this, you should type the buffer's nameX(two keystrokes: a double-quote and a lowercase letter)Xbefore the command that will cut the text.XWhen you do this, "1 through "9 are not affected by the cut.X.PPXYou can append text to one of the named buffers.XTo do this, type the buffer's name in uppercaseX(a double-quote and an uppercase letter)Xbefore the d/y/c/C/s/x command.X.PPXThe ". buffer is special.XIt isn't affected by the d/y/c/C/s/x command.XInstead, it stores the text that you typed inXthe last time you were in input mode.XIt is used to implement the . visual command,Xand ^A in input mode.X.PPXIn EX mode (also known as colon mode),Xthe :delete, :change, and :yank commands all copy text into a cut buffer.XLike the visual commands, these EX commands normally use the "1 buffer,Xbut you can use one of the named buffers by giving its name after the command.XFor example,X.sp 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -