Notepad++ User Manual

repository·master·Indexed 42 days ago

https://github.com/notepad-plus-plus/npp-usermanual

Comprehensive guidance for the Notepad++ text editor, covering core editing, advanced features like macros and auto-completion, syntax highlighting, plugins, and system configurations. Includes documentation for application v8.x.

Tokens
116.4K
Snippets
201
Records
514
Agent score
54%

What's inside Notepad++

  1. Overview of Notepad++ User Manual topics

    master

    The Notepad++ User Manual covers a wide range of features and configurations, including:

    • Core Editing: Getting started, Working with Files, Editing, Searching, and Views.
    • Advanced Features: Function List, Auto-Completion, Macros (Task Automation), and Running External Commands.
    • Syntax & Customization: Syntax Highlighting (Built-in and User Defined), Themes, and Preferences.
    • Extensibility: Plugins and Plugin Communication.
    • System & Environment: Sessions, Workspaces, and Projects, Command Line Arguments, Configuration Files, and Localization.
    • Integration: Right Click - Edit with Notepad++ (Shell Extension) and Upgrading.
  2. Overview of Searching and Replacing in Notepad++

    master

    Notepad++ provides several mechanisms for searching and replacing text, marking results, and navigating through matches.

    Key capabilities include:

    • Search and Replace: Standard text manipulation.
    • Marking: Adding bookmarks to lines containing search results or highlighting the textual results themselves.
    • Counting: Generating a total count of matches found.

    There are three primary built-in search mechanisms:

    1. Standard Dialog-based Searching: Using the Find, Replace, Find in Files, and Mark dialogs.
    2. Dialog-free Navigation: Using Next and Previous commands to move through matches without opening a dialog.
    3. Incremental Search: A specialized search mode for rapid navigation.

    Note on Shortcuts: All keyboard shortcuts listed in the manual are default values. You can view or modify them using the Shortcut Mapper in the Preferences menu.

  3. Overview of the Notepad++ Menu Bar

    master

    The Notepad++ menu bar provides access to all core functionalities. Key menus include:

    • File: Generic file operations (open, close, etc.).
    • Edit: Commands for editing the active file.
    • Search: Search, Replace, and Bookmark tools.
    • View: Manipulate editor views and panel visibility.
    • Encoding: Interpret file bytes as specific text encodings (ANSI, UTF-8, etc.).
    • Language: Syntax highlighting for built-in and User Defined Languages.
    • Settings: Preferences, Style Configurator, and shortcut key sequences.
    • Tools: Built-in utilities like cryptographic hash functions.
    • Macro: Automation of repetitive tasks.
    • Run: Execution of external commands.
    • Plugins: Access to installed plugins and the Plugins Admin.
    • Window: Management and arrangement of open files/tabs.
    • ?: Help, updates, and debug information.

    Additionally, the far right of the menu bar contains icons for:

    • +: Create a new file.
    • ▼: Choose from open files.
    • X: Close the active tab.

    Note: Starting in v8.4.5, these icons can be hidden via Settings > Preferences > General > Menu.

  4. Manage multiple files using Sessions, Workspaces, or Project Panels

    master

    Notepad++ provides three native systems for managing groups of files:

    1. Sessions: A specific set of files that can be opened all at once. A session stores file paths, active files, view positions, selections, bookmarks, and language settings. Files in a session do not need to be in the same directory.
    2. Folder as Workspace: A tree-based interface that allows you to browse and access files within a specific Windows directory.
    3. Project Panels: A tree-based interface for accessing related files that may be scattered across different directories in your filesystem.

    You can also use various plugins to extend these capabilities.

  5. Supported Programming Languages and Syntax Highlighting

    master

    Notepad++ supports approximately 90 programming languages with built-in features including syntax highlighting, syntax folding, auto-completion, and function lists.

    If a language is not supported, you can:

    1. Define it using the User Defined Languages System.
    2. Write or use a lexer plugin.

    Performance Note: Starting in v8.3, Notepad++ disables syntax highlighting for files larger than 200MB to prevent performance degradation. This threshold can be configured in Settings > Preferences > Performance (available from v8.4.7 onwards).

  6. What is the Function List Panel

    master

    The Function List Panel displays all functions or methods found in the current active file. Double-clicking a function name in the panel navigates the editor directly to that location.

    It uses a regular-expression (regex) engine to parse files. Users can customize or add support for new languages by providing XML definition files containing regex rules.

  7. Trigger Ghost Typing via the About Notepad++ dialog

    master

    In addition to command-line arguments, you can trigger Ghost Typing using the UI:

    1. Type the name of an Easter Egg into a Notepad++ document.
    2. Select (highlight) the name.
    3. Open the About Notepad++ dialog (via the ? menu or the F1 shortcut).

    Instead of opening the dialog, Notepad++ will create a new document tab and perform Ghost Typing for the selected name (or a random choice if applicable).

    Note: This behavior can be disabled by creating a zero-byte configuration file named noEasterEggs.xml.

  8. Use Branch Reset `(?|...)` to manage capture group numbering

    master

    The Branch Reset construct (?|expression) allows multiple alternatives within an alternation to share the same capture group numbering.

    In a standard alternation, each capture group increments a global counter. In a branch reset, each alternative resets the counter, so that capture groups appearing after the (?|...) construct continue numbering based on the largest group number found within the branches, rather than the sum of all groups in all branches.

    Note: The (?|...) construct itself is not a capture group and does not consume a group number.

    # Example without branch-reset (groups increment continuously)
    (?x) ( a )  (?: x ( y ) z | (p (q) r) | (t) u (v) ) ( z )
    
    # Example with branch-reset (groups reset per branch)
    (?x) ( a )  (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z )
  9. Communicate between plugins using NPPM_MSGTOPLUGIN

    master

    The NPPM_MSGTOPLUGIN message enables inter-plugin communication. Plugin X can send a message to Plugin Y if it knows Plugin Y's complete module name (including .dll extension).

    Plugin Y receives a CommunicationInfo structure containing an internalMsg (an integer defined by the receiving plugin), the srcModuleName of the caller, and a void * info pointer for custom data exchange.

    struct CommunicationInfo {
    	long internalMsg;
    	const wchar_t * srcModuleName;
    	void * info; // defined by plugin
    };
    
    // Usage: Send message to 'MyPlugin.dll'
    // wParam: L"MyPlugin.dll"
    // lParam: Pointer to CommunicationInfo
    SendMessage(hPlugin, NPPM_MSGTOPLUGIN, (WPARAM)destModuleName, (LPARAM)&info);
  10. Use Numbered Recursion `(?n)` to reuse subexpressions

    master

    Numbered recursion allows you to execute a previously defined subexpression at a new location in your pattern without duplicating the code. This is different from a backreference; a backreference refers to the value matched by a group, while a numbered recursion refers to the regex pattern itself.

    Syntax:

    • (?n): Refers to the $n^{th}$ subexpression. If $n$ is negative, it counts from the end.
    • (?0) or (?R): Backtrack to the start of the pattern (whole-match recursion).
    • (?&name) or (?P>name): Named recursion (backtrack to a subexpression named name).

    Use Case: Matching balanced structures like braces {}.

    Note: In PCRE, recursive subpattern calls are treated as atomic groups. Once a recursive call matches, it will not be re-entered even if the surrounding pattern fails.

    # Find balanced {} with any number of spaces inside or out
    {\h*(?0)*\h*}\h*
  11. Configure the File Tree and Leaf Bundle Menus

    master

    The theme supports two ways to render menus:

    File tree menu (Default)

    By default, the theme renders pages from the content/docs section as a tree structure. You can control the order and titles using title and weight in the page front matter.

    Leaf bundle menu

    You can define a custom menu using a leaf bundle.

    1. Create a file at content/menu/index.md (or your configured path).
    2. Use headless = true in the front matter.
    3. Define the menu structure using Markdown links and sub-items.
    4. Enable it in your site configuration by setting BookMenuBundle to the path of your menu file (e.g., BookMenuBundle = '/menu').
    +++
    headless = true
    +++
    
    - [Book Example]({{< relref "/docs/" >}})
      - [Page One]({{< relref "/docs/page-one" >}})
      - [Page Two]({{< relref "/docs/page-two" >}})
    - [Blog]({{< relref "/posts" >}})
  12. Use Macros for task automation

    master

    Notepad++ allows you to record a sequence of editing actions and replay them later to automate repetitive tasks. Macros can be played once or multiple times (e.g., running through an entire document).

    Key behaviors to note:

    • Caret Sensitivity: Macros are sensitive to the current position of the caret and typically operate relative to its current position.
    • Persistence: You can save macros for future use.
    • Customization: You can assign specific keystrokes to macros using the Shortcut Mapper for faster access.