The Preferences menu allows you to set options for both the current editing window, and default values for newly created windows and future NEdit-ng sessions. Options in the Preferences menu itself (not in Preferences → Default Settings) take effect immediately and refer to the current window only. Options in Preferences → Default Settings provide initial settings for future windows created using the File → New or File → Open commands; options affecting all windows are also set here.

Preferences set in Preferences → Default Settings are saved in files that NEdit-ng reads at startup time (see The NEdit-ng Autoload Files below), by selecting Preferences → Save Defaults.

Preferences Menu

  • Default Settings
    Menu of initial settings for future windows. Generally the same as the options in the main part of the menu, but apply as defaults for future windows created during this NEdit-ng session. These settings can be saved using the Save Defaults command below, to be loaded automatically each time NEdit-ng is started.

  • Save Defaults
    Save the default options as set under Default Settings for future NEdit-ng sessions

  • Statistics Line
    Show the full file name, line number, and length of the file being edited

  • Incremental Search Line
    Keep the incremental search bar (Search → Find Incremental) permanently displayed at the top of the window

  • Show Line Numbers
    Display line numbers to the left of the text

  • Language Mode
    Tells NEdit-ng what language (if any) to assume, for selecting language-specific features such as highlight patterns and smart indent macros, and setting language specific preferences like word delimiters, tab emulation, and auto-indent. See Programming with NEdit-ng for more information

  • Auto Indent
    Setting Auto Indent "on" maintains a running indent (pressing the Return key will line up the cursor with the indent level of the previous line). If smart indent macros are available for the current language mode, smart indent can be selected and NEdit-ng will attempt to guess proper language indentation for each new line, details at Auto/Smart Indent

  • Wrap
    Choose between two styles of automatic wrapping or none. Auto Newline wrap, wraps text at word boundaries when the cursor reaches the right margin, by replacing the space or tab at the last word boundary with a newline character. Continuous Wrap wraps long lines which extend past the right margin. Continuous Wrap mode is typically used to produce files where newlines are omitted within paragraphs, to make text filling automatic (a kind of poor-man's word processor). Text of this style is common on Macs and PCs but is not necessarily supported very well under Unix (except in programs which deal with e-mail, for which it is often the format of choice)

  • Wrap Margin
    Set margin for Auto Newline Wrap, Continuous Wrap, and Fill Paragraph. Lines may, be wrapped at the right margin of the window, or the margin can be set at a specific column

  • Tab Stops
    Set the tab distance (number of characters between tab stops) for tab characters, and control tab emulation and use of tab characters in padding and emulated tabs

  • Text Font...
    Change the font used to display text. See below for more information

  • Highlight Syntax
    If NEdit-ng recognizes the language being edited, and highlighting patterns are available for that language, use fonts and colors to enhance viewing of the file. (See Syntax Highlighting for more information.)

  • Make Backup Copy
    On Save, write a backup copy of the file as it existed before the Save command with the extension .bck

  • Incremental Backup
    Periodically make a backup copy of the file being edited under the name ~filename (see Crash Recovery)

  • Show Matching (..)
    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

  • Overtype
    In overtype mode, new characters entered replace the characters in front of the insertion cursor, rather than being inserted before them

  • Read Only
    Lock the file against accidental modification. This temporarily prevents the file from being modified in this NEdit-ng session. Note that this is different from setting the file protection

Preferences → Default Settings Menu

Options in Preferences → Default Settings have the same meaning as those in the top-level Preferences menu, except that they apply to future NEdit-ng windows and future NEdit-ng sessions if saved with Preferences → Save Defaults. Additional options which appear in this menu are:

  • Language Modes
    Define language recognition information (for determining language mode from file name or content) and set language specific preferences.

  • Tag Collisions
    How to react to multiple tags for the same name. Tags are described in Finding Declarations (ctags). In Show All mode, all matching tags are displayed in a dialog. In Smart mode, if one of the matching tags is in the current window, that tag is chosen, without displaying the dialog.

  • Command Shell...
    Set the shell used to run programs from the shell_command() macro function and from the Shell menu. This defaults to the user's login shell.

  • Colors...
    Change the colors used to display text. The "Matching (..)" fields change the colors that matching parens, brackets and braces are flashed when the "Show Matching (..)" option is enabled. Note that the foreground colors for plain text, selected text, and matching paren flashing only apply when syntax highlighting is disabled. When syntax highlighting is enabled, text (even text that appears plain) will always be colored according to its highlighting style. (For information on changing syntax highlighting styles and matching patterns use see Syntax Highlighting.)

  • Customize Menus
    Add/remove items from the Shell, Macro, and window background menus (see below).

  • Customize Window Title
    Opens a dialog where the information to be displayed in the window's title field can be defined and tested. The dialog contains a Help button, providing further information about the options available.

  • Searching
    Options for controlling the behavior of Search → Find and Search → Replace commands:

    • Verbose
      Presents search results in dialog form, asks before wrapping a search back around the beginning (or end) of the file (unless Beep On Search Wrap is turned on).

    • Wrap Around
      Search and Replace operations wrap around the beginning (or end) of the file.

    • Beep On Search Wrap
      Beep when Search and Replace operations wrap around the beginning (or end) of the file (only if Wrap Around is turned on).

    • Keep Dialogs Up
      Don't close Replace and Find boxes after searching.

    • Default Search Style
      Initial setting for search type in Find and Replace dialogs.

    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.

  • Syntax Highlighting
    Program and configure enhanced text display for new or supported languages. (See Syntax Highlighting.)

  • Tabbed Editing
    Options for controlling the tabbed interface:

    • Open File in New Tab
      Open files in new tabs, else open files in new windows.

    • Show Tab Bar
      Show/Hide the tab bar.

    • Hide Tab Bar when only one Document is open

    • Next/Prev Tabs Across Windows
      Suppose there are two windows with three tabs in the first window and two tabs in the second window. Enabling this option, if you are on the third tab in the first window, hitting Ctrl + PageDown would switch to the first tab in the second window (instead of switching to the first tab in the first window).

    • Sort Tabs Alphabetically

  • Show Tooltips
    Show file name and path in a tooltip when moving the mouse pointer over a tab. (See Tabbed Editing.)

  • Terminate with Line Break on Save
    Some programs expect text files to end with a newline. If this option is activated, NEdit-ng will append one if not already present.

  • Sort Open Prev.
    Menu Option to order File → Open Previous alphabetically, versus in order of last access.

  • Popups Under Pointer
    Display pop-up dialogs centered on the current mouse position, as opposed to centered on the parent window. This generally speeds interaction, and is essential for users who set their window managers so keyboard focus follows the mouse.

  • Auto-Scroll Near Window Top/Bottom
    When this option is enabled the window will automatically scroll when the cursor comes 4 lines from the top or bottom of the window (except at the beginning of the file). The number of lines can be customized with the nedit.autoScrollVPadding setting in the config.ini file.

  • Warnings
    Options for controlling the popping up of warning dialogs:

    • File Modified Externally
      Pop up a warning dialog when files get changed external to NEdit-ng.

    • Check Modified File Contents
      If external file modification warnings are requested, also check the file contents iso. only the modification date.

    • On Exit
      Ask before exiting when two or more files are open in an NEdit-ng session or before closing a window with two or more tabs.

  • Initial Window Size
    Default size for new windows.

Changing The Display Font

The font used to display text in NEdit-ng is set under Preferences → Text Font (for the current window), or Preferences → Default Settings Text Font (for future windows). NEdit-ng shows a list of the monospaced fonts that are available on your system in this dialog.

Customizing Menus

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. These are specified by placing & in the name immediately before the desired letter. For example, T&est will have e as its mnemonic.

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.

The NEdit-ng Autoload Files

At startup time, NEdit-ng automatically reads the following files:

  • config.ini
    General configuration
    Contains saved preferences (menu settings) in the format of a Windows ini file.
  • style.qss
    An optional Qt style sheet
    A Qt style sheet can be used to adjust the appearance of the NEdit-ng application.
  • theme.xml
    A highlighting theme file Holds the text drawing styles defined using the Preferences → Default Settings → Syntax Highlighting → Text Drawing Styles dialog.
  • autoload.nm
    An optional autoload macro file May provide macro commands and definitions for NEdit-ng to execute at startup (NEdit-ng doesn't create this file automatically).
  • history The history database A list of recently opened files, which appear under File → Open Previous.

These files are normally located in $HOME/.config/nedit-ng but may be elsewhere if the Qt Generic Config Location is different.

Sharing Customizations with Other NEdit-ng Users

If you have written Macro or Shell menu commands, highlight patterns, or smart-indent macros that you want to share with other NEdit-ng users, you can make a file which they can load into their NEdit-ng environment.

To load such a file, start NEdit-ng with the command:

nedit-ng -import <file>

In the new NEdit-ng session, verify that the imported patterns or macros do what you want, then select Preferences → Save Defaults. Saving incorporates the changes into the NEdit-ng preferences file, so the next time you run NEdit-ng, 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 values(s), and within those values, 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

Values are in the format of Windows ini files, but the format of text within multiple-item values like highlight patterns, language modes, macros, styles, etc., are private to NEdit-ng.

NOTE: Future versions of NEdit-ng are expected to change this internal format to be spit among several YAML files for easier user editing and management.