{% extends "base.html" %} {% block title %}Preferences (29){% endblock %} {% block content %}
The Preferences menu allows you to set options for both the current editing window, and default values for newly created windows and future NEdit sessions. Options in the Preferences menu itself (not in the Default Settings sub-menu) take effect immediately and refer to the current window only. Options in the Default Settings sub-menu provide initial settings for future windows created using the New or Open commands; options affecting all windows are also set here.
Preferences set in the Default Settings sub-menu are saved in a file that NEdit reads at startup time, cf. Autoload Files, by selecting Save Defaults.
Momentarily highlight matching parenthesis, brackets, and braces, or the range between them, when one of these characters is typed, or when the insertion cursor is positioned after it. Delimiter only highlights the matching delimiter, while Range highlights the whole range of text between the matching delimiters
Optionally, the matching can make use of syntax information if syntax highlighting is enabled. Alternatively, the matching is purely character based. In general, syntax based matching results in fewer false matches
Options in the Preferences → Default Settings menu have the same meaning as those in the top-level Preferences menu, except that they apply to future NEdit windows and future NEdit sessions if saved with the Save Defaults command. Additional options which appear in this menu are:
Options for controlling the behavior of Find and Replace commands:
-DREPLACE_SCOPE
FLAG TO SELECT AN ALTERNATIVE REPLACE DIALOG LAYOUT.]Initial setting for the scope in the Replace/Find dialog, when a selection exists. It can be either "In Window", "In Selection", or "Smart". "Smart" results in "In Window" if the size of the selection is smaller than 1 line, and to "In Selection" otherwise.
Options for controlling the tabbed interface:
<Options for controlling the popping up of warning dialogs:
The font used to display text in NEdit is set under Preferences → Text Font (for the current window), or Preferences → Default Settings Text Font (for future windows). These dialogs also allow you to set fonts for syntax highlighting. If you don't intend to use syntax highlighting, you can ignore most of the dialog, and just set the field labeled Primary Font.
Unless you are absolutely certain about the types of files that you will be editing with NEdit, you should choose a fixed-spacing font. Many, if not most, plain-text files are written expecting to be viewed with fixed character spacing, and will look wrong with proportional spacing. NEdit's filling, wrapping, and rectangular operations will also work strangely if you choose a proportional font.
Note that in the font browser (the dialog brought up by the Browse... button), the subset of fonts which are shown is narrowed depending on the characteristics already selected. It is therefore important to know that you can unselect characteristics from the lists by clicking on the selected items a second time.
Fonts for syntax highlighting should ideally match the primary font in both height and spacing. A mismatch in spacing will result in similar distortions as choosing a proportional font: column alignment will sometimes look wrong, and rectangular operations, wrapping, and filling will behave strangely. A mismatch in height will cause windows to re-size themselves slightly when syntax highlighting is turned on or off, and increase the inter-line spacing of the text. Unfortunately, on some systems it is hard to find sets of fonts which match exactly in height.
You can add or change items in the Shell, Macro, and window background menus under Preferences → Default Settings → Customize Menus. When you choose one of these, you will see a dialog with a list of the current user-configurable items from the menu on the left. To change an existing item, select it from the list, and its properties will appear in the remaining fields of the dialog, where you may change them. Selecting the item "New" from the list allows you to enter new items in the menu.
Hopefully most of the characteristics are self explanatory, but here are a few things to note:
Accelerator keys are keyboard shortcuts which appear on the right hand side of the menus, and allow you avoid pulling down the menu and activate the command with a single keystroke. Enter accelerators by typing the keys exactly as you would to activate the command.
Mnemonics are a single letter which should be part of the menu item name, which allow users to traverse and activate menu items by typing keys when the menu is pulled down.
In the Shell Command field of the Shell Commands dialog, the % character expands to the name (including directory path) of the file in the window. To include a % character in the command, use %%.
The Menu Entry field can contain special characters for constructing hierarchical sub-menus, and for making items which appear only in certain language modes. The right angle bracket character ">" creates a sub-menu. The name of the item itself should be the last element of the path formed from successive sub-menu names joined with ">". Menu panes are called in to existence simply by naming them as part of a Menu Entry name. To put several items in the same sub-menu, repeat the same hierarchical sequence for each. For example, in the Macro Commands dialog, two items with menu entries: a>b>c and a>b>d would create a single sub menu under the macro menu called "a", which would contain a single sub-menu, b, holding the actual items, c and d:
+---++---++---+ |a >||b >||c | +---++---+|d | +---+
To qualify a menu entry with a language mode, simply add an at-sign "@" at the end of the menu command, followed (no space) by a language mode name. To make a menu item which appears in several language modes, append additional @s and language mode names. For example, an item with the menu entry:
Make C Prototypes@C@C++
would appear only in C and C++ language modes, and:
Make Class Template@C++
would appear only in C++ mode.
Menu items with no qualification appear in all language modes.
If a menu item is followed by the single language qualification "@*", that item will appear only if there are no applicable language-specific items of the same name in the same submenu. For example, if you have the following three entries in the same menu:
Make Prototypes@C@C++
Make Prototypes@Java
Make Prototypes@*
The first will be available when the language mode is C or C++, the second when the language mode is Java, and for all other language modes (including the "Plain" non-language mode). If the entry:
Make Prototypes
also exists, this will always appear, meaning that the menu will always have two "Make Prototypes" entries, whatever the language mode.
At startup time, NEdit automatically reads the preferences file `nedit.rc', the autoload macro file `autoload.nm', and the history data base `nedit.history'. The preferences file contains saved preferences (menu settings) in the format of an X resource file. The autoload macro file is a macro file containing macro commands and definitions that NEdit will execute at startup. (NEdit doesn't create this file automatically.) Moreover, NEdit saves a list of the recently opened files, which appear under the Open Previous menu, in the history data base.
By default the location of these files is '$HOME/.nedit/'. A different directory can be given by letting the environment variable NEDIT_HOME point to it.
Notice that NEdit still supports the older names for these files, which are `$HOME/.nedit', `$HOME/.neditmacro', and `$HOME/.neditdb', respectively. This old naming scheme will be used if NEdit detects that `$HOME/.nedit' is a regular file and NEDIT_HOME isn't set.
(For VMS, the location of these files is '$NEDIT_HOME/' if NEDIT_HOME is set, and 'SYS$LOGIN:' otherwise.)
The contents of the preferences file can be moved into another X resource file (see X Resources). One reason for doing so would be to attach server specific preferences, such as a default font, to a particular X server. Another reason for moving preferences into an X resource file would be to keep preferences menu options and X resource settable options together in one place. Though the files are the same format, additional resources should not be added to the preferences file, since NEdit modifies that file by overwriting it completely. Note also that the contents of the preferences file takes precedence over the values in an X resource file. Using Save Defaults after moving the contents of your preferences file to your .Xdefaults file will re-create the preferences file, interfering with the options that you have moved.
If you have written macro or shell menu commands, highlight patterns, or smart-indent macros that you want to share with other NEdit users, you can make a file which they can load into their NEdit environment.
To load such a file, start NEdit with the command:
nedit -import <file>
In the new NEdit session, verify that the imported patterns or macros do what you want, then select Preferences → Save Defaults. Saving incorporates the changes into the NEdit preferences file, so the next time you run NEdit, you will not have to import the distribution file.
Loading a customization file is automated, but creating one is not. To produce a file to be imported by other users, you must make a copy of your own preferences file, and edit it, by hand, to remove everything but the few items of interest to the recipient. Leave only the individual resource(s), and within those resources, only the particular macro, pattern, style, etc, that you wish to exchange.
For example, to share a highlighting pattern set, you would include the patterns, any new styles you added, and language mode information only if the patterns are intended to support a new language rather than updating an existing one. For example:
nedit.highlightPatterns:\
My Language:1:0{\n\
Comment:"#":"$"::Comment::\n\
Loop Header:"^[ \\t]*loop:":::Loop::\n\
}
nedit.languageModes: My Language:.my::::::
nedit.styles: Loop:blue:Bold
Resources are in the format of X resource files, but the format of text within multiple-item resources like highlight patterns, language modes, macros, styles, etc., are private to NEdit. Each resource is a string which ends at the first newline character not escaped with \, so you must be careful about how you treat ends of lines. While you can generally just cut and paste indented sections, if something which was originally in the middle of a resource string is now at the end, you must remove the \ line continuation character(s) so it will not join the next line into the resource. Conversely, if something which was originally at the end of a resource is now in the middle, you'll have to add continuation character(s) to make sure that the resource string is properly continued from beginning to end, and possibly newline character(s) (\n) to make sure that it is properly separated from the next item.
{% endblock %} {% block prev %}28.html{% endblock %} {% block next %}30.html{% endblock %}