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

📄 nedit.html

📁 nedit 是一款linux下的开发源码的功能强大的编辑器
💻 HTML
📖 第 1 页 / 共 5 页
字号:
use different colors or fonts, you can change these by selecting Preferences-&#62; Default Settings -&#62; Syntax Highlighting -&#62; Text Drawing Styles. Highlighting patterns are connected with font and color information through acommon set of styles so that colorings defined for one language will besimilar across others, and patterns within the same language which are meantto appear identical can be changed in the same place.  To understand whichstyles are used to highlight the language you are interested in, you may needto look at "<A HREF="#Highlighting_Patterns">Highlighting Patterns</A>" section, as well.</P><P>Syntax highlighting is CPU intensive, and under some circumstances can affectNEdit's responsiveness.  If you have a particularly slow system, or work withvery large files, you may not want to use it all of the time.  Syntaxhighlighting introduces two kinds of delays.  The first is an initial parsingdelay, proportional to the size of the file.  This delay is also incurredwhen pasting large sections of text, filtering text through shell commands,and other circumstances involving changes to large amounts of text.  Thesecond kind of delay happens when text which has not previously been visibleis scrolled in to view.  Depending on your system, and the highlight patternsyou are using, this may or may not be noticeable.  A typing delay is alsopossible, but unlikely if you are only using the built-in patterns.<P><HR></P><P><A NAME="Finding_Declarations_(ctags)"></A><H2> Finding Declarations (ctags) </H2></P><P><A NAME="ctags"></A>NEdit can process tags files generated using the Unix ctags command or theExuberant Ctags program.  Ctags creates index files correlating names offunctions and declarations with their locations in C, Fortran, or Pascal sourcecode files. (See the ctags manual page for more information).  Ctags produces afile called "tags" which can be loaded by NEdit.  NEdit can manage any numberof tags files simultaneously.  Tag collisions are handled with a popup menu tolet the user decide which tag to use.  In 'Smart' mode NEdit will automaticallychoose the desired tag based on the scope of the file or module. Once loaded,the information in the tags file enables NEdit to go directly to thedeclaration of a highlighted function or data structure name with a singlecommand.  To load a tags file, select "Load Tags File" from the File menu andchoose a tags file to load, or specify the name of the tags file on the NEditcommand line:</P><P><PRE>      nedit -tags tags</PRE></P><P>NEdit can also be set to load a tags file automatically when it starts up. Setting the X resource nedit.tagFile to the name of a tag file tells NEdit tolook for that file at startup time (see "<A HREF="#Customizing_NEdit">Customizing NEdit</A>").  The file namecan be either a complete path name, in which case NEdit will always load thesame tags file, or a file name without a path or with a relative path, inwhich case NEdit will load it starting from the current directory.  Thesecond option allows you to have different tags files for different projects,each automatically loaded depending on the directory you're in when you startNEdit.  Setting the name to "tags" is an obvious choice since this is thename that ctags uses. NEdit normally evaluates relative path tag filespecifications every time a file is opened. All accessible tag files areloaded at this time. To disable the automatic loading of tag files specifiedas relative paths, set the X resource nedit.alwaysCheckRelativeTagsSpecs toFalse.</P><P>To unload a tags file, select "Un-load Tags File" from the File menu andchoose from the list of tags files.  NEdit will keep track of tags file updatesby checking the timestamp on the files, and automatically update the tagscache. </P><P>To find the definition of a function or data structure once a tags file isloaded, select the name anywhere it appears in your program (see "<A HREF="#Selecting_Text">Selecting Text</A>") and choose "Find Definition" from the Search menu.<P><HR></P><P><A NAME="Calltips"></A><H2> Calltips </H2></P><P>Calltips are little yellow boxes that pop up to remind you what the argumentsand return type of a function are.  More generally, they're a UI mechanism topresent a small amount of crucial information in a prominent location.  To display a calltip, select some text and choose "Show Calltip" from the Searchmenu.  To kill a displayed calltip, hit Esc.</P><P>Calltips get their information from one of two places -- either a tags file (see"<A HREF="#Finding_Declarations_(ctags)">Finding Declarations (ctags)</A>") or a calltips file.  First, any loaded calltips files are searched for a definition, and if nothing is found then the tags database is searched.  If a tag is found that matches the hilighted text thena calltip is displayed with the first few lines of the definition -- usually enough to show you what the arguments of a function are.</P><P>You can load a calltips file by using choosing "Load Calltips File" from theFile menu.  You can unload a calltips file by selecting it from the "Unload Calltips File" submenu of the File menu.  You can also choose one ormore default calltips files to be loaded for each language mode using the "Default calltips file(s)" field of the Language Modes dialog.</P><P>The calltips file format is very simple.  calltips files are organized in blocksseparated by blank lines.  The first line of the block is the key, which is theword that is matched when a calltip is requested.  The rest of the block isdisplayed as the calltip.  </P><P>Almost any text at all can appear in a calltip key or a calltip.  There are nospecial characters that need to be escaped.  The only issues to note are thattrailing whitespace is ignored, and you cannot have a blank line inside acalltip.  (Use a single period instead --  it'll be nearly invisible.)  You shouldalso avoid calltip keys that begin and end with '*' characters, since those areused to mark special blocks.</P><P>There are five special block types--comment, include, language, alias, and version--which are distinguished by their first lines, "* comment *", "* include *", "* language *", "* alias *", and "* version *" respectively (without quotes).</P><P>Comment blocks are ignored when reading calltips files.</P><P>Include blocks specify additional calltips files to load, one per line.  The ~character can be used for your $HOME directory, but other shell shortcuts like* and ? can't be used. Include blocks allow you to make a calltips file for yourproject that includes, say, the calltips files for C, Motif, and Xt.</P><P>Language blocks specify which language mode the calltips should be used with. When a calltip is requested it won't match tips from languages other than thecurrent language mode.  Language blocks only affect the tips listed after theblock.</P><P>Alias blocks allow a calltip to have multiple keys.  The first line of the blockis the key for the calltip to be displayed, and the rest of the lines areadditional keys, one per line, that should also show the calltip.</P><P>Version blocks are ignored for the time being.</P><P>You can use calltips in your own macros using the calltip() and kill_calltip()macro subroutines and the $calltip_ID macro variable.  See the <A HREF="#Macro_Subroutines">Macro Subroutines</A> section for details.<P><HR></P><P><A NAME="Regular_Expressions"></A><H1> Regular Expressions </H1></P><P><A NAME="Basic_Regular_Expression_Syntax"></A><H2> Basic Regular Expression Syntax </H2></P><P>Regular expressions (regex's) are useful as a way to match inexact sequencesof characters.  They can be used in the `Find...' and `Replace...' searchdialogs and are at the core of Color Syntax Highlighting patterns.  To specifya regular expression in a search dialog, simply click on the `RegularExpression' radio button in the dialog.</P><P>A regex is a specification of a pattern to be matched in the searched text. This pattern consists of a sequence of tokens, each being able to match asingle character or a sequence of characters in the text, or assert that aspecific position within the text has been reached (the latter is called ananchor.)  Tokens (also called atoms) can be modified by adding one of a numberof special quantifier tokens immediately after the token.  A quantifier tokenspecifies how many times the previous token must be matched (see below.)</P><P>Tokens can be grouped together using one of a number of grouping constructs,the most common being plain parentheses.  Tokens that are grouped in this wayare also collectively considered to be a regex atom, since this new largeratom may also be modified by a quantifier.</P><P>A regex can also be organized into a list of alternatives by separating eachalternative with pipe characters, `|'.  This is called alternation.  A matchwill be attempted for each alternative listed, in the order specified, until amatch results or the list of alternatives is exhausted (see <A HREF="#alternation">Alternation</A>section below.)</P><P><H3>The 'Any' Character</H3></P><P>If a dot (`.') appears in a regex, it means to match any character exactlyonce.  By default, dot will not match a newline character, but this behaviorcan be changed (see help topic <A HREF="#Parenthetical_Constructs">Parenthetical Constructs</A>, under theheading, Matching Newlines).</P><P><H3>Character Classes</H3></P><P>A character class, or range, matches exactly one character of text, but thecandidates for matching are limited to those specified by the class.  Classescome in two flavors as described below:</P><P><PRE>     [...]   Regular class, match only characters listed.     [^...]  Negated class, match only characters NOT listed.</PRE></P><P>As with the dot token, by default negated character classes do not matchnewline, but can be made to do so.</P><P>The characters that are considered special within a class specification aredifferent than the rest of regex syntax as follows. If the first character ina class is the `]' character (second character if the first character is `^')it is a literal character and part of the class character set.  This alsoapplies if the first or last character is `-'.  Outside of these rules, twocharacters separated by `-' form a character range which includes all thecharacters between the two characters as well.  For example, `[^f-j]' is thesame as `[^fghij]' and means to match any character that is not `f', `g',`h', `i', or `j'.</P><P><H3>Anchors</H3></P><P>Anchors are assertions that you are at a very specific position within thesearch text.  NEdit regular expressions support the following anchor tokens:</P><P><PRE>     ^    Beginning of line     $    End of line     &#60;    Left word boundary     &#62;    Right word boundary     \B   Not a word boundary</PRE></P><P>Note that the \B token ensures that the left and right characters are bothdelimiter characters, or that both left and right characters arenon-delimiter characters.  Currently word anchors check only one character,e.g. the left word anchor `&#60;' only asserts that the left character is a worddelimiter character.  Similarly the right word anchor checks the rightcharacter.</P><P><H3>Quantifiers</H3></P><P>Quantifiers specify how many times the previous regular expression atom maybe matched in the search text.  Some quantifiers can produce a largeperformance penalty, and can in some instances completely lock up NEdit.  Toprevent this, avoid nested quantifiers, especially those of the maximalmatching type (see below.)</P><P>The following quantifiers are maximal matching, or "greedy", in that theymatch as much text as possible.</P><P><PRE>     *   Match zero or more     +   Match one  or more     ?   Match zero or one</PRE></P><P>The following quantifiers are minimal matching, or "lazy", in that they matchas little text as possible.</P><P><PRE>     *?   Match zero or more     +?   Match one  or more     ??   Match zero or one</PRE></P><P>One final quantifier is the counting quantifier, or brace quantifier. Ittakes the following basic form:</P><P><PRE>     {min,max}  Match from `min' to `max' times the                previous regular expression atom.</PRE></P><P>If `min' is omitted, it is assumed to be zero.  If `max' is omitted, it isassumed to be infinity.  Whether specified or assumed, `min' must be lessthan or equal to `max'.  Note that both `min' and `max' are limited to65535.  If both are omitted, then the construct is the same as `*'.   Notethat `{,}' and `{}' are both valid brace constructs.  A single numberappearing without a comma, e.g. `{3}' is short for the `{min,min}' construct,or to match exactly `min' number of times.</P><P>The quantifiers `{1}' and `{1,1}' are accepted by the syntax, but areoptimized away since they mean to match exactly once, which is redundantinformation.  Also, for efficiency, certain combinations of `min' and `max'are converted to either `*', `+', or `?' as follows:</P><P><PRE>     {} {,} {0,}    *     {1,}           +     {,1} {0,1}     ?</PRE></P><P>Note that {0} and {0,0} are meaningless and will generate an error message atregular expression compile time.</P><P>Brace quantifiers can also be "lazy".  For example {2,5}? would try to match2 times if possible, and will only match 3, 4, or 5 times if that is what isnecessary to achieve an overall match.</P><P><H3>Alternation</H3></P><P>A series of alternative patterns to match can be specified by separating them<A NAME="alternation"></A>with vertical pipes, `|'.  An example of alternation would be `a|be|sea'. This will match `a', or `b

⌨️ 快捷键说明

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