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

📄 less.nro

📁 早期freebsd实现
💻 NRO
📖 第 1 页 / 共 3 页
字号:
.IP -x\fIn\fPSets tab stops every \fIn\fP positions.The default for \fIn\fP is 8..IP -y\fIn\fPSpecifies a maximum number of lines to scroll forward.If it is necessary to scroll forward more than \fIn\fP lines,the screen is repainted instead.The -c or -C option may be used to repaint from the top ofthe screen if desired.By default, any forward movement causes scrolling..IP -[z]\fIn\fPChanges the default scrolling window size to \fIn\fP lines.The default is one screenful.The z and w commands can also be used to change the window size.The "z" may be omitted, as in "-\fIn\fP" for compatibility with.I more..IP +If a command line option begins with \fB+\fP,the remainder of that option is taken to be an initial command to.I less.For example, +G tells.I lessto start at the end of the file rather than the beginning,and +/xyz tells it to start at the first occurrence of "xyz" in the file.As a special case, +<number> acts like +<number>g; that is, it starts the display at the specified line number(however, see the caveat under the "g" command above).If the option starts with ++, the initial command applies toevery file being viewed, not just the first one.The + command described previouslymay also be used to set (or change) an initial command for every file..SH "KEY BINDINGS"You may define your own .I lesscommands by using the program .I lesskey(1)to create a file called ".less" in your home directory.This file specifies a set of command keys and an actionassociated with each key.See the.I lesskeymanual page for more details..SH "NATIONAL CHARACTER SETS"There are three types of characters in the input file:.IP "normal characters"can be displayed directly to the screen..IP "control characters"should not be displayed directly, but are expected to be foundin ordinary text files (such as backspace and tab)..IP "binary characters"cannot be displayed directly and are not expected to be foundin text files..PPBy default, .I lessuses the ASCII character set.In the ASCII character set, characterswith values between 128 and 255 are treated as binary.The LESSCHARSET environment variable may be used to selectanother character set.If it is set to the value "latin1",the ISO 8859/1 character set is assumed.Latin-1 is the same as ASCII, except characters between 128 and 255 aretreated as normal characters.The only valid values for LESSCHARSET currently are "ascii" and "latin1"..PPIn special cases, it may be desired to tailor.I lessto use a character set other than the ones definable by LESSCHARSET.In this case, the environment variable LESSCHARDEF can be usedto define a character set.It should be set to a string where each character in the string representsone character in the character set.The character "." is used for a normal character, "c" for control,and "b" for binary.A decimal number may be used for repetition.For example, "bccc4b." would mean character 0 is binary,1, 2 and 3 are control, 4, 5, 6 and 7 are binary, and 8 is normal.All characters after the last are taken to be the same as the last,so characters 9 through 255 would be normal.(This is an example, and does not necessarily represent any real character set.).PPSetting LESSCHARDEF to "8bcccbcc18b95.b" is the same as settingLESSCHARSET to "ascii".Setting LESSCHARDEF to "8bcccbcc18b95.33b." is the same as settingLESSCHARSET to "latin1"..PPControl and binary characters are displayed in blinking mode.Each such character is displayed in caret notation if possible(e.g. ^A for control-A).  Caret notation is used only if inverting the 0100 bit results in a normal printable character.Otherwise, the character is displayed as an octal number precededby a backslash.This octal format can be changed by setting the LESSBINFMT environment variableto a printf-style format string; the default is '\\%o'.The blinking mode display of control and binary characters canbe changed or disabled by preceding the LESSBINFMT format string with a "*" and one character to select the mode:"*k" is blinking, "*d" is bold, "*u" is underlined,and "*n" is normal (no special display attribute).For example, if LESSBINFMT is "*u[%x]", binary charactersare displayed in underlined hexadecimal surrounded by brackets..SH "PROMPTS"The -P option allows you to tailor the prompt to your preference.The string given to the -P option replaces the specified prompt string.Certain characters in the string are interpreted specially.The prompt mechanism is rather complicated to provide flexibility,but the ordinary user need not understand the details of constructingpersonalized prompt strings..spA percent sign followed by a single character is expandedaccording to what the following character is:.IP "%b\fIX\fP"Replaced by the byte offset into the current input file.The b is followed by a single character (shown as \fIX\fP above)which specifies the line whose byte offset is to be used.If the character is a "t", the byte offset of the top line in thedisplay is used,an "m" means use the middle line,a "b" means use the bottom line,a "B" means use the line just after the bottom line,and a "j" means use the "target" line, as specified by the -j option..IP "%B"Replaced by the size of the current input file..IP "%E"Replaced by the name of the editor (from the EDITOR environment variable).See the discussion of the LESSEDIT feature below..IP "%f"Replaced by the name of the current input file..IP "%i"Replaced by the index of the current file in the list ofinput files..IP "%l\fIX\fP"Replaced by the line number of a line in the input file.The line to be used is determined by the \fIX\fP, as with the %b option..IP "%L"Replaced by the line number of the last line in the input file..IP "%m"Replaced by the total number of input files..IP "%p\fIX\fP"Replaced by the percent into the current input file.The line used is determined by the \fIX\fP as with the %b option..IP "%s"Same as %B..IP "%t"Causes any trailing spaces to be removed.Usually used at the end of the string, but may appear anywhere..IP "%x"Replaced by the name of the next input file in the list..PPIf any item is unknown (for example, the file size if inputis a pipe), a question mark is printed instead..PPThe format of the prompt string can be changeddepending on certain conditions.A question mark followed by a single character acts like an "IF":depending on the following character, a condition is evaluated.If the condition is true, any characters following the question markand condition character, up to a period, are included in the prompt.If the condition is false, such characters are not included.A colon appearing between the question mark and theperiod can be used to establish an "ELSE": any characters betweenthe colon and the period are included in the string if and only ifthe IF condition is false.Condition characters (which follow a question mark) may be:.IP "?a"True if any characters have been included in the prompt so far..IP "?b\fIX\fP"True if the byte offset of the specified line is known..IP "?B"True if the size of current input file is known..IP "?e"True if at end-of-file..IP "?f"True if there is an input filename(that is, if input is not a pipe)..IP "?l\fIX\fP"True if the line number of the specified line is known..IP "?L"True if the line number of the last line in the file is known..IP "?m"True if there is more than one input file..IP "?n"True if this is the first prompt in a new input file..IP "?p\fIX\fP"True if the percent into the current input fileof the specified line is known..IP "?s"Same as "?B"..IP "?x"True if there is a next input file(that is, if the current input file is not the last one)..PPAny characters other than the special ones(question mark, colon, period, percent, and backslash)become literally part of the prompt.Any of the special characters may be included in the prompt literallyby preceding it with a backslash..PPSome examples:.sp?f%f:Standard input..spThis prompt prints the filename, if known;otherwise the string "Standard input"..sp?f%f .?ltLine %lt:?pt%pt\\%:?btByte %bt:-....spThis prompt would print the filename, if known.The filename is followed by the line number, if known,otherwise the percent if known, otherwise the byte offset if known.Otherwise, a dash is printed.Notice how each question mark has a matching period,and how the % after the %ptis included literally by escaping it with a backslash..sp?n?f%f\ .?m(file\ %i\ of\ %m)\ ..?e(END)\ ?x-\ Next\\:\ %x..%t.spThis prints the filename if this is the first prompt in a file,followed by the "file N of N" message if there is morethan one input file.Then, if we are at end-of-file, the string "(END)" is printedfollowed by the name of the next file, if there is one.Finally, any trailing spaces are truncated.This is the default prompt.For reference, here are the defaults forthe other two prompts (-m and -M respectively).Each is broken into two lines here for readability only..nf.sp?n?f%f\ .?m(file\ %i\ of\ %m)\ ..?e(END)\ ?x-\ Next\\:\ %x.:	?pB%pB\\%:byte\ %bB?s/%s...%t.sp?f%f\ .?n?m(file\ %i\ of\ %m)\ ..?ltline\ %lt?L/%L.\ :byte\ %bB?s/%s.\ .	?e(END)\ ?x-\ Next\\:\ %x.:?pB%pB\\%..%t.sp.fiAnd here is the default message produced by the = command:.nf.sp?f%f\ .?m(file\ %i\ of\ %m)\ .?ltline\ %lt?L/%L.\ .	byte\ %bB?s/%s.\ ?e(END)\ :?pB%pB\\%..%t.fi.PPThe prompt expansion features are also used for another purpose:if an environment variable LESSEDIT is defined, it is usedas the command to be executed when the v command is invoked.The LESSEDIT string is expanded in the same way as the prompt strings.The default value for LESSEDIT is:.nf.sp	%E\ ?lm+%lm.\ %f.sp.fiNote that this expands to the editor name, followed by a + and theline number, followed by the file name.If your editor does not accept the "+linenumber" syntax, or has otherdifferences in invocation syntax, the LESSEDIT variable can be changed to modify this default..SH "ENVIRONMENT VARIABLES".IP COLUMNSSets the number of columns on the screen.Takes precedence over the number of columns specified by the TERM variable..IP EDITORThe name of the editor (used for the v command)..IP HOMEName of the user's home directory (used to find a .less file)..IP LESSFlags which are passed to .I lessautomatically..IP LESSBINFMTFormat for displaying non-printable, non-control characters..IP LESSCHARDEFDefines a character set..IP LESSCHARSETSelects a predefined character set..IP LESSEDITEditor prototype string (used for the v command).See discussion under PROMPTS..IP LESSHELPName of the help file..IP LINESSets the number of lines on the screen.Takes precedence over the number of lines specified by the TERM variable..IP SHELLThe shell used to execute the ! command, as well as to expand filenames..IP TERMThe type of terminal on which.I lessis being run..SH "SEE ALSO"lesskey(1).SH WARNINGSThe = command and prompts (unless changed by -P)report the line number of the line at the top of the screen,but the byte and percent of the line at the bottom of the screen..PPIf the :e command is used to name more than one file,and one of the named files has been viewed previously,the new files may be entered into the list in an unexpected order..PPThe handling of national character sets is nonstandard as well asinsufficient for multibyte characters.It will probably change in a later release.

⌨️ 快捷键说明

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