📄 help.etx
字号:
---------------------- Though general in appearance, NEdit has many features intended specifically for programmers. Major programming-related topics are listed in separate sections under the heading: "Features for Programming": Syntax_Highlighting_, Tabs/Emulated_Tabs_, Finding_Declarations_(ctags)_, Calltips_, and Auto/Smart_Indent_. Minor topics related to programming are discussed below:3>Language Modes When NEdit initially reads a file, it attempts to determine whether the file is in one of the computer languages that it knows about. Knowing what language a file is written in allows NEdit to assign highlight patterns and smart indent macros, and to set language specific preferences like word delimiters, tab emulation, and auto-indent. Language mode can be recognized from both the file name and from the first 200 characters of content. Language mode recognition and language-specific preferences are configured in: Preferences -> Default Settings -> Language Modes.... You can set the language mode manually for a window, by selecting it from the menu: Preferences -> Language Modes.3>Backlighting [EXPERIMENTAL] NEdit can be made to set the background color of particular classes of characters to allow easy identification of those characters. This is particularly useful if you need to be able to distiguish between tabs and spaces in a file where the difference is important. The colors used for backlighting are specified by a resource, "nedit*backlightCharTypes". You can turn backlighting on and off through the Preferences -> Apply Backlighting menu entry. If you prefer to have backlighting turned on for all new windows, use the Preferences -> Default Settings -> Apply Backlighting menu entry. This settings can be saved along with other preferences using Preferences -> Save Defaults. **Important:** In future versions of NEdit, the backlighting feature will be extended and reworked such that it becomes easier to configure. The current way of controlling it through a resource is generally considered to be below NEdit's usability standards. These future changes are likely to be incompatible with the current format of the "nedit*backlightCharTypes" resource, though. Therefore, it is expected that there will be no automatic migration path for users who customize the resource.3>Line Numbers To find a particular line in a source file by line number, choose Goto Line #... from the Search menu. You can also directly select the line number text in the compiler message in the terminal emulator window (xterm, decterm, winterm, etc.) where you ran the compiler, and choose Goto Selected from the Search menu. To find out the line number of a particular line in your file, turn on Statistics Line in the Preferences menu and position the insertion point anywhere on the line. The statistics line continuously updates the line number of the line containing the cursor. To go to a specific column on a given line, choose Goto Line #... from the Search menu and enter a line number and a column number separated by a comma. (e.g. Enter "100,12" for line 100 column 12.) If you want to go to a column on the current line just leave out the line number. (e.g. Enter ",45" to go the column 45 on the current line.)3>Matching Parentheses To help you inspect nested parentheses, brackets, braces, quotes, and other characters, NEdit has both an automatic parenthesis matching mode, and a Goto Matching command. Automatic parenthesis matching is activated when you type, or move the insertion cursor after a parenthesis, bracket, or brace. It momentarily highlights either the opposite character ('Delimiter') or the entire expression ('Range') when the opposite character is visible in the window. To find a matching character anywhere in the file, select it or position the cursor after it, and choose Goto Matching from the Search menu. If the character matches itself, such as a quote or slash, select the first character of the pair. NEdit will match {, (, [, <, ", ', `, /, and \. Holding the Shift key while typing the accelerator key (Shift+Ctrl+M, by default), will select all of the text between the matching characters. When syntax highlighting is enabled, the matching routines can optionally make use of the syntax information for improved accuracy. In that case, a brace inside a highlighted string will not match a brace inside a comment, for instance. 3>Opening Included Files The Open Selected command in the File menu understands the C preprocessor's #include syntax, so selecting an #include line and invoking Open Selected will generally find the file referred to, unless doing so depends on the settings of compiler switches or other information not available to NEdit.3>Interface to Programming Tools Integrated software development environments such as SGI's CaseVision and Centerline Software's Code Center, can be interfaced directly with NEdit via the client server interface. These tools allow you to click directly on compiler and runtime error messages and request NEdit to open files, and select lines of interest. The easiest method is usually to use the tool's interface for character-based editors like vi, to invoke nc, but programmatic interfaces can also be derived using the source code for nc. There are also some simple compile/review, grep, ctree, and ctags browsers available in the NEdit contrib directory on ftp.nedit.org. ----------------------------------------------------------------------Tabs/Emulated Tabs------------------3>Changing the Tab Distance Tabs are important for programming in languages which use indentation to show nesting, as short-hand for producing white-space for leading indents. As a programmer, you have to decide how to use indentation, and how or whether tab characters map to your indentation scheme. Ideally, tab characters map directly to the amount of indent that you use to distinguish nesting levels in your code. Unfortunately, the Unix standard for interpretation of tab characters is eight characters (probably dating back to mechanical capabilities of the original teletype), which is usually too coarse for a single indent. Most text editors, NEdit included, allow you to change the interpretation of the tab character, and many programmers take advantage of this, and set their tabs to 3 or 4 characters to match their programming style. In NEdit you set the hardware tab distance in Preferences -> Tabs... for the current window, or Preferences -> Default Settings -> Tabs... (general), or Preferences -> Default Settings -> Language Modes... (language-specific) to change the defaults for future windows. Changing the meaning of the tab character makes programming much easier while you're in the editor, but can cause you headaches outside of the editor, because there is no way to pass along the tab setting as part of a plain-text file. All of the other tools which display, print, and otherwise process your source code have to be made aware of how the tabs are set, and must be able to handle the change. Non-standard tabs can also confuse other programmers, or make editing your code difficult for them if their text editors don't support changes in tab distance.3>Emulated Tabs An alternative to changing the interpretation of the tab character is tab emulation. In the Tabs... dialog(s), turning on Emulated Tabs causes the Tab key to insert the correct number of spaces and/or tabs to bring the cursor the next emulated tab stop, as if tabs were set at the emulated tab distance rather than the hardware tab distance. Backspacing immediately after entering an emulated tab will delete the fictitious tab as a unit, but as soon as you move the cursor away from the spot, NEdit will forget that the collection of spaces and tabs is a tab, and will treat it as separate characters. To enter a real tab character with "Emulate Tabs" turned on, use Ctrl+Tab. It is also possible to tell NEdit not to insert ANY tab characters at all in the course of processing emulated tabs, and in shifting and rectangular insertion/deletion operations, for programmers who worry about the misinterpretation of tab characters on other systems. ----------------------------------------------------------------------.. ** NOTE **.... The following Tabs Dialog and Customize Window Title Dialog sections.. should only appear in the online documentation, and not in any of .. the other possible forms. The rationale is that they are not directly.. obtained from the Help menu, but are buried in preference dialogs..... ? help~.. Tabs Dialog.. -----------.. .. The Tabs dialog controls both the operation of the Tab key, and.. the interpretation of tab characters within a file... .. The first field, Tab Spacing, controls how NEdit responds to.. tab characters in a file. On most Unix and VMS systems the.. conventional interpretation of a tab character is to advance the.. text position to the nearest multiple of eight characters (a tab.. spacing of 8). However, many programmers of C and other.. structured languages, when given the choice, prefer a tab.. spacing of 3 or 4 characters. Setting a three or four character.. hardware tab spacing is useful and convenient as long as your.. other software tools support it. Unfortunately, on Unix and VMS.. systems, system utilities, such as more, and printing software.. can't always properly display files with other than eight.. character tabs... .. Selecting "Emulate Tabs" will cause the Tab key to insert the.. correct number of spaces or tabs to reach the next tab stop, as.. if the tab spacing were set at the value in the "Emulated tab.. spacing" field. Backspacing immediately after entering an.. emulated tab will delete it as a unit, but as soon as you move.. the cursor away from the spot, NEdit will forget that the.. collection of spaces and tabs is a tab, and will treat it as.. separate characters. To enter a real tab character with.. "Emulate Tabs" turned on, use Ctrl+Tab... .. In generating emulated tabs, and in Shift Left, Paste Column,.. and some rectangular selection operations, NEdit inserts blank.. characters (spaces or tabs) to preserve the alignment of.. non-blank characters. The bottom toggle button in the Tabs.. dialog instructs NEdit whether to insert tab characters as.. padding in such situations. Turning this off, will keep NEdit.. from automatically inserting tabs. Some software developers.. prefer to keep their source code free of tabs to avoid its.. misinterpretation on systems with different tab character.. conventions... ----------------------------------------------------------------------.... Customize Window Title Dialog.. -----------------------------.. .. The Customize Window Title dialog allows you to customize .. and test the way information will be displayed in each window's .. title field... .. **Definition of the title**.. .. The upper half of the dialog can be used to select the various .. components that should be displayed in the title. The layout can be .. fine-tuned by editing the printf() like format string below the .. component buttons: additional characters can be entered, or the .. order can be changed... .. The following sequences are interpreted in the format string:.. .. %c ClearCase view tag (only relevant when NEdit is .. used together with ClearCase).. %[n]d directory, with one optional numeric digit n .. specifying the maximum number of trailing directory .. components to display. Skipped components are .. replaced by an ellipsis (...)... %f file name, without the path name.. %h host name.. %s NEdit server name (server mode only).. %[*]S file status, either verbose (%S) or brief (%*S)... In verbose mode the file status is spelled out: .. read-only, locked, and modified. In brief mode, .. abbreviations and an asterisk are used for the .. respective states: RO, LO, *... %u user name.. .. The format string and the component buttons are continously synchronized... .. The default format is:.. .. {%c} [%s] %f (%S) - %d.. .. The resulting title will only contain elements with .. a value. Hence, the title is compressed as follows:.. .. * Elements with no value are removed. .. .. * Empty parenthesis pairs i.e. (), [] or {}, or parenthesis.. pairs containing only space(s), are removed... .. * Sequences of spaces are replaced with one space... .. * Leading spaces and dashes are removed. .. .. * Trailing spaces and dashes are removed. .. .. If the server name and the ClearCase view tag are identical, only .. the first one specified in the format string will be displayed... .. **Previewing the settings**.. .. The lower part of the dialog can be used to test the selected title.. under various conditions. For some of the components that are selected .. for display, various states can be enforced on the preview. .. .. For instance, components that are not always active (such the .. NEdit server name) can be turned on or off in the preview... .. ~ helpAuto/Smart Indent
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -