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

📄 nedit.html

📁 nedit 是一款linux下的开发源码的功能强大的编辑器
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<HTML><HEAD><TITLE>Nirvana Editor (NEdit) Help Documentation</TITLE></HEAD><BODY><P><A NAME="Nirvana_Editor_(NEdit)_Help_Documentation"></A><H1> Nirvana Editor (NEdit) Help Documentation </H1></P><P><A NAME="Table_of_Contents"></A><H2> Table of Contents </H2></P><P><PRE>    <A HREF="#Getting_Started">Getting Started</A>                    </PRE></P><P><PRE>    Basic Operation                     Macro/Shell Extensions      <A HREF="#Selecting_Text">Selecting Text</A>                      <A HREF="#Shell_Commands_and_Filters">Shell Commands and Filters</A>      <A HREF="#Finding_and_Replacing_Text">Finding and Replacing Text</A>          <A HREF="#Learn/Replay">Learn/Replay</A>      <A HREF="#Cut_and_Paste">Cut and Paste</A>                       <A HREF="#Macro_Language">Macro Language</A>      <A HREF="#Using_the_Mouse">Using the Mouse</A>                     <A HREF="#Macro_Subroutines">Macro Subroutines</A>      <A HREF="#Keyboard_Shortcuts">Keyboard Shortcuts</A>                  <A HREF="#Highlighting_Information">Highlighting Information</A>      <A HREF="#Shifting_and_Filling">Shifting and Filling</A>                <A HREF="#Range_Sets">Range Sets</A>      <A HREF="#File_Format">File Format</A>                         <A HREF="#Action_Routines">Action Routines</A>                                        Customizing    Features for Programming              <A HREF="#Customizing_NEdit">Customizing NEdit</A>      <A HREF="#Programming_with_NEdit">Programming with NEdit</A>              <A HREF="#Preferences">Preferences</A>      <A HREF="#Tabs/Emulated_Tabs">Tabs/Emulated Tabs</A>                  <A HREF="#X_Resources">X Resources</A>      <A HREF="#Auto/Smart_Indent">Auto/Smart Indent</A>                   <A HREF="#Key_Binding">Key Binding</A>      <A HREF="#Syntax_Highlighting">Syntax Highlighting</A>                 <A HREF="#Highlighting_Patterns">Highlighting Patterns</A>      <A HREF="#Finding_Declarations_(ctags)">Finding Declarations (ctags)</A>        <A HREF="#Smart_Indent_Macros">Smart Indent Macros</A>      <A HREF="#Calltips">Calltips</A></PRE></P><P><PRE>    Regular Expressions                 <A HREF="#NEdit_Command_Line">NEdit Command Line</A>      <A HREF="#Basic_Regular_Expression_Syntax">Basic Regular Expression Syntax</A>   <A HREF="#Client/Server_Mode">Client/Server Mode</A>      <A HREF="#Metacharacters">Metacharacters</A>                    <A HREF="#Crash_Recovery">Crash Recovery</A>      <A HREF="#Parenthetical_Constructs">Parenthetical Constructs</A>          <A HREF="#Version">Version</A>      <A HREF="#Advanced_Topics">Advanced Topics</A>                   <A HREF="#Distribution_Policy">Distribution Policy</A>      <A HREF="#Example_Regular_Expressions">Example Regular Expressions</A>       <A HREF="#Mailing_Lists">Mailing Lists</A>                                        <A HREF="#Problems/Defects">Problems/Defects</A></PRE></P><P><A NAME="Getting_Started"></A><H2> Getting Started </H2></P><P>Welcome to NEdit!</P><P>NEdit is a standard GUI (Graphical User Interface) style text editor forprograms and plain-text files.  Users of Macintosh and MS Windows based texteditors should find NEdit a familiar and comfortable environment.  NEditprovides all of the standard menu, dialog, editing, and mouse support, aswell as all of the standard shortcuts to which the users of modern GUI basedenvironments are accustomed.  For users of older style Unix editors, welcometo the world of mouse-based editing!</P><P>Help sections of interest to new users are listed under the "Basic Operation"heading in the top-level Help menu:</P><P><PRE>      <A HREF="#Selecting_Text">Selecting Text</A>      <A HREF="#Finding_and_Replacing_Text">Finding and Replacing Text</A>      <A HREF="#Cut_and_Paste">Cut and Paste</A>      <A HREF="#Using_the_Mouse">Using the Mouse</A>      <A HREF="#Keyboard_Shortcuts">Keyboard Shortcuts</A>      <A HREF="#Shifting_and_Filling">Shifting and Filling</A></PRE></P><P>Programmers should also read the introductory section under the "Features forProgramming" section:</P><P><PRE>      <A HREF="#Programming_with_NEdit">Programming with NEdit</A></PRE></P><P>If you get into trouble, the Undo command in the Edit menu can reverse anymodifications that you make.  NEdit does not change the file you are editinguntil you tell it to Save.</P><P><H3>Editing an Existing File</H3></P><P>To open an existing file, choose Open... from the file menu. Select the filethat you want to open in the pop-up dialog that appears and click on OK.  Youmay open any number of files at the same time.  Each file will appear in itsown editor window.  Using Open... rather than re-typing the NEdit command andrunning additional copies of NEdit, will give you quick access to all of thefiles you have open via the Windows menu, and ensure that you don'taccidentally open the same file twice.  NEdit has no "main" window.  Itremains running as long as at least one editor window is open.</P><P><H3>Creating a New File</H3></P><P>If you already have an empty (Untitled) window displayed, just begin typingin the window.  To create a new Untitled window, choose New from the Filemenu.  To give the file a name and save its contents to the disk, choose Saveor Save As... from the File menu.</P><P><H3>Backup Files</H3></P><P>NEdit maintains periodic backups of the file you are editing so that you canrecover the file in the event of a problem such as a system crash, networkfailure, or X server crash.  These files are saved under the name `~filename`(on Unix) or `_filename` (on VMS), where filename is the name of the file youwere editing.  If an NEdit process is killed, some of these backup files mayremain in your directory.  (To remove one of these files on Unix, you mayhave to prefix the `~' (tilde) character with a (backslash) to prevent theshell from interpreting it as a special character.)</P><P><H3>Shortcuts</H3></P><P>As you become more familiar with NEdit, substitute the control and functionkeys shown on the right side of the menus for pulling down menus with themouse.</P><P>Dialogs are also streamlined so you can enter information quickly and withoutusing the mouse*.  To move the keyboard focus around a dialog, use the taband arrow keys.  One of the buttons in a dialog is usually drawn with athick, indented, outline.  This button can be activated by pressing Return orEnter.  The Cancel or Dismiss button can be activated by pressing escape. For example, to replace the string "thing" with "things" type:</P><P><PRE>      &#60;ctrl-r&#62;thing&#60;tab&#62;things&#60;return&#62;</PRE></P><P>To open a file named "whole_earth.c", type:</P><P><PRE>      &#60;ctrl-o&#62;who&#60;return&#62;</PRE></P><P>(how much of the filename you need to type depends on the other files in thedirectory).  See the section called "<A HREF="#Keyboard_Shortcuts">Keyboard Shortcuts</A>" for more details.</P><P>* Users who have set their keyboard focus mode to "pointer" should set"Popups Under Pointer" in the Default Settings menu to avoid the additionalstep of moving the mouse into the dialog.<P><HR></P><P><A NAME="Basic_Operation"></A><H1> Basic Operation </H1></P><P><A NAME="Selecting_Text"></A><H2> Selecting Text </H2></P><P>NEdit has two general types of selections, primary (highlighted text), andsecondary (underlined text). Selections can cover either a simple range oftext between two points in the file, or they can cover a rectangular area ofthe file. Rectangular selections are only useful with non-proportional (fixedspacing) fonts.</P><P>To select text for copying, deleting, or replacing, press the left mousebutton with the pointer at one end of the text you want to select, and dragit to the other end. The text will become highlighted. To select a wholeword, double click (click twice quickly in succession). Double clicking andthen dragging the mouse will select a number of words. Similarly, you canselect a whole line or a number of lines by triple clicking or tripleclicking and dragging. Quadruple clicking selects the whole file. Afterreleasing the mouse button, you can still adjust a selection by holding downthe shift key and dragging on either end of the selection. To delete theselected text, press delete or backspace. To replace it, begin typing.</P><P>To select a rectangle or column of text, hold the Ctrl key while dragging themouse. Rectangular selections can be used in any context that normalselections can be used, including cutting and pasting, filling, shifting,dragging, and searching. Operations on rectangular selections automaticallyfill in tabs and spaces to maintain alignment of text within and to the rightof the selection. Note that the interpretation of rectangular selections byFill Paragraph is slightly different from that of other commands, the sectiontitled "<A HREF="#Shifting_and_Filling">Shifting and Filling</A>" has details.</P><P>The middle mouse button can be used to make an additional selection (calledthe secondary selection). As soon as the button is released, the contents ofthis selection will be copied to the insert position of the window where themouse was last clicked (the destination window). This position is marked by acaret shaped cursor when the mouse is outside of the destination window.  Ifthere is a (primary) selection, adjacent to the cursor in the window, the newtext will replace the selected text. Holding the shift key while making thesecondary selection will move the text, deleting it at the site of thesecondary selection, rather than copying it.</P><P>Selected text can also be dragged to a new location in the file using themiddle mouse button. Holding the shift key while dragging the text will copythe selected text, leaving the original text in place. Holding the controlkey will drag the text in overlay mode.</P><P>Normally, dragging moves text by removing it from the selected position atthe start of the drag, and inserting it at a new position relative to to themouse. Dragging a block of text over existing characters, displaces thecharacters to the end of the selection. In overlay mode, characters which areoccluded by blocks of text being dragged are simply removed. When draggingnon-rectangular selections, overlay mode also converts the selection torectangular form, allowing it to be dragged outside of the bounds of theexisting text.</P><P>The section "<A HREF="#Using_the_Mouse">Using the Mouse</A>" sumarizes the mouse commands for making primaryand secondary selections. Primary selections can also be made via keyboardcommands, see "<A HREF="#Keyboard_Shortcuts">Keyboard Shortcuts</A>".<P><HR></P><P><A NAME="Finding_and_Replacing_Text"></A><H2> Finding and Replacing Text </H2></P><P>The Search menu contains a number of commands for finding and replacing text.</P><P>The Find... and Replace... commands present dialogs for entering text forsearching and replacing.  These dialogs also allow you to choose whether youwant the search to be sensitive to upper and lower case, or whether to usethe standard Unix pattern matching characters (regular expressions). Searches begin at the current text insertion position.</P><P>Find Again and Replace Again repeat the last find or replace command withoutprompting for search strings.  To selectively replace text, use the twocommands in combination: Find Again, then Replace Again if the highlightedstring should be replaced, or Find Again again to go to the next string.</P><P>Find Selection searches for the text contained in the current primaryselection (see <A HREF="#Selecting_Text">Selecting Text</A>).  The selected text does not have to be in thecurrent editor window, it may even be in another program.  For example, ifthe word dog appears somewhere in a window on your screen, and you want tofind it in the file you are editing, select the word dog by dragging themouse across it, switch to your NEdit window and choose Find Selection fromthe Search menu.</P><P>Find Incremental is yet another variation on searching, where every charactertyped triggers a new search.  Incremental searching is generally the quickestway to find something in a file, because it gives you the immediate feedbackof seeing how your search is progressing, so you never need to type more thanthe minimally sufficient search string to reach your target.</P><P><H3>Searching Backwards</H3></P><P>Holding down the shift key while choosing any of the search or replacecommands from the menu (or using the keyboard shortcut), will search in thereverse direction.  Users who have set the search direction using the buttonsin the search dialog, may find it a bit confusing that Find Again and ReplaceAgain don't continue in the same direction as the original search (forexperienced users, consistency of the direction implied by the shift key ismore important).</P><P><H3>Selective Replacement</H3></P><P>To replace only some occurrences of a string within a file, choose Replace...from the Search menu, enter the string to search for and the string tosubstitute, and finish by pressing the Find button.  When the firstoccurrence is highlighted, use either Replace Again (^T) to replace it, orFind Again (^G) to move to the next occurrence without replacing it, andcontinue in such a manner through all occurrences of interest.</P><P>To replace all occurrences of a string within some range of text, select therange (see <A HREF="#Selecting_Text">Selecting Text</A>), choose Replace... from the Search menu, type thestring to search for and the string to substitute, and press the "R. inSelection" button in the dialog.  Note that selecting text in the Replace...dialog will unselect the text in the window.<P><HR></P><P><A NAME="Cut_and_Paste"></A><H2> Cut and Paste </H2></P><P>The easiest way to copy and move text around in your file or between windows,is to use the clipboard, an imaginary area that temporarily stores text anddata.  The Cut command removes the selected text (see <A HREF="#Selecting_Text">Selecting Text</A>) fromyour file and places it in the clipboard.  Once text is in the clipboard, thePaste command will copy it to the insert position in the current window.  Forexample, to move some text from one place to another, select it by draggingthe mouse over it, choose Cut to remove it, click the pointer to move theinsert point where you want the text inserted, then choose Paste to insertit.  Copy copies text to the clipboard without deleting it from your file. You can also use the clipboard to transfer text to and from other Motifprograms and X programs which make proper use of the clipboard.</P><P>There are many other methods for copying and moving text within NEdit windowsand between NEdit and other programs.  The most common such method isclicking the middle mouse button to copy the primary selection (to theclicked position).  Copying the selection by clicking the middle mouse buttonin many cases is the only way to transfer data to and from many X programs. Holding the Shift key while clicking the middle mouse button moves the text,deleting it from its original position, rather than copying it.  Othermethods for transferring text include secondary selections, primary selectiondragging, keyboard-based selection copying, and drag and drop.  These aredescribed in detail in the sections: "<A HREF="#Selecting_Text">Selecting Text</A>", "<A HREF="#Using_the_Mouse">Using the Mouse</A>", 

⌨️ 快捷键说明

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