📄 preferences.html
字号:
<PRE><B>Terminate with Line Break on Save</B></PRE>Some UNIX tools expect that files end with a line feed. If this option isactivated, NEdit will append one if required.</P><P><PRE><B>Sort Open Prev. Menu</B></PRE>Option to order the File -> Open Previous menu alphabetically, versus inorder of last access.</P><P><PRE><B>Popups Under Pointer</B></PRE>Display pop-up dialogs centered on the current mouse position, as opposed tocentered on the parent window. This generally speeds interaction, and isessential for users who set their window managers so keyboard focusfollows the mouse.</P><P><PRE><B>Warnings</B></PRE>Options for controlling the popping up of warning dialogs:</P><P><I>File Modified Externally</I> -Pop up a warning dialog when files get changed external to NEdit.</P><P><I>Check Modified File Contents</I> -If external file modification warnings are requested, also check the filecontents iso. only the modification date.</P><P><I>Exit Warnings</I> -Ask before exiting when two or more files are open in an NEdit session.</P><P><PRE><B>Initial Window Size</B></PRE>Default size for new windows.</P><P><H3>Changing Font(s)</H3></P><P>The font used to display text in NEdit is set under Preferences -> Text Font(for the current window), or Preferences -> Default Settings Text Font (forfuture windows). These dialogs also allow you to set fonts for syntaxhighlighting. If you don't intend to use syntax highlighting, you can ignoremost of the dialog, and just set the field labeled Primary Font.</P><P>Unless you are absolutely certain about the types of files that you will beediting with NEdit, you should choose a fixed-spacing font. Many, if notmost, plain-text files are written expecting to be viewed with fixedcharacter spacing, and will look wrong with proportional spacing. NEdit'sfilling, wrapping, and rectangular operations will also work strangely if youchoose a proportional font.</P><P>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 thecharacteristics already selected. It is therefore important to know that youcan unselect characteristics from the lists by clicking on the selected itemsa second time.</P><P>Fonts for syntax highlighting should ideally match the primary font in bothheight and spacing. A mismatch in spacing will result in similar distortionsas choosing a proportional font: column alignment will sometimes look wrong,and rectangular operations, wrapping, and filling will behave strangely. Amismatch in height will cause windows to re-size themselves slightly whensyntax highlighting is turned on or off, and increase the inter- line spacingof the text. Unfortunately, on some systems it is hard to find sets of fontswhich match exactly in height.</P><P><H3>Customizing Menus</H3></P><P>You can add or change items in the Shell, Macro, and window background menusunder Preferences -> Default Settings -> Customize Menus. When you chooseone of these, you will see a dialog with a list of the currentuser-configurable items from the menu on the left. To change an existingitem, select it from the list, and its properties will appear in theremaining fields of the dialog, where you may change them. Selecting theitem "New" from the list allows you to enter new items in the menu.</P><P>Hopefully most of the characteristics are self explanatory, but here are afew things to note:</P><P>Accelerator keys are keyboard shortcuts which appear on the right hand sideof the menus, and allow you avoid pulling down the menu and activate thecommand with a single keystroke. Enter accelerators by typing the keysexactly as you would to activate the command.</P><P>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 themenu is pulled down.</P><P>In the Shell Command field of the Shell Commands dialog, the % characterexpands to the name (including directory path) of the file in the window. Toinclude a % character in the command, use %%.</P><P>The Menu Entry field can contain special characters for constructinghierarchical sub-menus, and for making items which appear only in certainlanguage modes. The right angle bracket character ">" creates a sub-menu. The name of the item itself should be the last element of the path formedfrom successive sub-menu names joined with ">". Menu panes are called in toexistence simply by naming them as part of a Menu Entry name. To put severalitems 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>cand 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:</P><P><PRE> +---++---++---+ |a >||b >||c | +---++---+|d | +---+</PRE></P><P>To qualify a menu entry with a language mode, simply add an at-sign "@" atthe end of the menu command, followed (no space) by a language mode name. Tomake a menu item which appears in several language modes, append additional@s and language mode names. For example, an item with the menu entry:</P><P><PRE> Make C Prototypes@C@C++</PRE></P><P>would appear only in C and C++ language modes, and:</P><P><PRE> Make Class Template@C++</PRE></P><P>would appear only in C++ mode.</P><P>Menu items with no qualification appear in all language modes.</P><P>If a menu item is followed by the single language qualification "@*", thatitem will appear only if there are no applicable language-specific items ofthe same name in the same submenu. For example, if you have the followingthree entries in the same menu:</P><P><PRE> Make Prototypes@C@C++ Make Prototypes@Java Make Prototypes@*</PRE></P><P>The first will be available when the language mode is C or C++, the secondwhen the language mode is Java, and for all other language modes (includingthe "Plain" non-language mode). If the entry:</P><P><PRE> Make Prototypes</PRE></P><P>also exists, this will always appear, meaning that the menu will always havetwo "Make Prototypes" entries, whatever the language mode.</P><P><H3>The NEdit Preferences File</H3></P><P>The NEdit saved preferences file is an X resource file, and its contents canbe moved into another X resource file (see <A HREF="resources.html#X_Resources">X Resources</A>). One reason fordoing so would be to attach server specific preferences, such as a defaultfont to a particular X server. Another reason for moving preferences into theX resource file would be to keep preferences menu options and resourcesettable options together in one place.Though the files are the same format, additional resources should not be addedto the preference file since NEdit modifies this file by overwriting itcompletely. Note also that the contents of the preference file takeprecedence over the values of X resources.Using Save Defaults after moving the contents of your preference file to your.Xdefaults file will re-create the preference file, interfering with theoptions that you have moved.The location of NEdit's preferences file depends on your environment:</P><P><UL> <li>The default place for the file is '$HOME/.nedit/nedit.rc',</li> <li>if the variable $NEDIT_HOME is set in your environment it is located at '$NEDIT_HOME/nedit.rc',</li> <li>you may also use old-style run control files; in this case, the preferences are stored in $HOME/.nedit.</li></UL></P><P>(For VMS, the file is in '$NEDIT_HOME/nedit.rc' if $NEDIT_HOME is set, in'SYS$LOGIN:.nedit' otherwise.)</P><P><H3>Sharing Customizations with Other NEdit Users</H3></P><P>If you have written macro or shell menu commands, highlight patterns, orsmart-indent macros that you want to share with other NEdit users, you canmake a file which they can load into their NEdit environment.</P><P>To load such a file, start NEdit with the command:</P><P><PRE> nedit -import <file></PRE></P><P>In the new NEdit session, verify that the imported patterns or macros do whatyou want, then select Preferences -> Save Defaults. Saving incorporates thechanges into the nedit preferences file, so the next time you run NEdit, youwill not have to import the distribution file.</P><P>Loading a customization file is automated, but creating one is not. Toproduce a file to be imported by other users, you must make a copy of your ownNEdit configuration file, and edit it, by hand, to remove everything but thefew items of interest to the recipient. Leave only the individualresource(s), and within those resources, only the particular macro, pattern,style, etc, that you wish to exchange.</P><P>For example, to share a highlighting pattern set, you would include thepatterns, any new styles you added, and language mode information only if thepatterns are intended to support a new language rather than updating anexisting one. For example:</P><P><PRE> 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</PRE></P><P>Resources are in the format of X resource files, but the format of textwithin multiple-item resources like highlight patterns, language modes,macros, styles, etc., are private to NEdit. Each resource is a string whichends at the first newline character not escaped with \, so you must becareful about how you treat ends of lines. While you can generally just cutand paste indented sections, if something which was originally in the middleof a resource string is now at the end, you must remove the \ linecontinuation character(s) so it will not join the next line into theresource. Conversely, if something which was originally at the end of aresource 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 toend, and possibly newline character(s) (\n) to make sure that it is properlyseparated from the next item.<P><HR></P><P></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -