Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

NPP User Manual (Notepad ++)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22
At a glance
Powered by AI
The document provides an overview of the main features and functions of Notepad++ such as file management, session management, editing, document properties, and more.

Sessions in Notepad++ are a set of files opened in the application. They store information like open files, active file, selection, bookmarks, and language. Sessions allow opening a set of related files with one action.

Primarily editing in Notepad++ is done using the keyboard to change text, insert, and delete as needed. However, Notepad++ provides many tools to assist editing like automating repetitive tasks or speeding up development.

npp-user-manual

Table of Contents
1. Introduction
2. File Management
3. Session Management
4. Editing
5. Document Properties
6. Searching
7. Display
8. Macros
9. Commands
10. Windows Dialog
11. GUI Elements
12. Switching between Documents
13. Languages
14. Settings
15. Plugins
16. Command Line
17. Control Files
18. Shell Extension
19. Upgrading
20. Further Help

npp-user-manual

Notepad++ User Manual


Notepad++ User Manual This document is dedicated to the countless lost hours of both people having to search for simple
answers, and people having to answer questions that shouldn't have to be asked in the first place. Documentation is always
hard to get, good documentation nearly impossible.
This markup is based in the default appearance of Microsoft Windows. This can be different on your own system, but the
names (text) should always the same. This is especially important on the screenshots. They are only for reference, your
appearance of Notepad++ can be quite different.
All the images used in this helpfile assume the default settings. If you change any of these settings, you'll have to look for
the other image instead, this is most noticeable with the toolbar (the position of images will always remain the same).
Also, when talking about the left and right mouse buttons, the logical left and right is meant. These are the same as the
physical left and right mouse buttons in the case of a right-handed setup. However, if you have a left-handed setup you will
probably have the buttons swapped so act accordingly. This means in general you do what you normally do for most
actions, Notepad++ mostly follows the standard Windows application behavior.
Likewise, the layout is discussed as it is displayed in a left-to-right order. On right-to-left systems (such as Hebrew)
translated versions of Notepad++ can have the display order reversed, adjust accordingly as well.

Introduction

npp-user-manual

See the sub-sections to see other methods to manage your files.

File Management

npp-user-manual

Sessions are a set of files opened in Notepad++.


They store the open files, the active file (and which view, see the section about Multi-View), the current selection and
position in the file, the current bookmarks (see Bookmarks) and the current language (see the section about Languages).
Using sessions, you can open a set of (related) files with one action.

Session Management

npp-user-manual

Primarily editing files is done by simply using the keyboard (or the standard Input Method Editor (IME) for eastern asian
language) to change the contents, inserting and deleting text as needed.
However, Notepad++ has many tools and aids to assist in editing files, mainly to automate repetitive tasks or speed up
development.
Notepad++ is based on the Scintilla edit control and relies on it to perform many editing tasks, supplementing it if useful.

Editing

npp-user-manual

A document has certain characteristics in the way its stored on your hard-disk. These following subjects control some of
those aspects.
Note: both the default Newline format and the encoding of new files can be set, see New document settings for more
details.
The current properties of a document, like its character count, selection statistics and such, are available through the View > Summary.
which contains the following information:
Fully qualified active document path
Creation date
Last modification date
Byte size of document
Character count of the document, blanks excluded
Character count of the document
Line count
Size of selection (characters, bytes and ranges)
Note that the character count and byte count are not a function of each other in UTF-8 (see Encoding).

Document Properties

npp-user-manual

There are multiple methods to search (and replace) text in files. You can also mark search results with bookmarks, or
highlight them.

Searching

npp-user-manual

The subjects described here control the appearance of the text in the screen.

Display

npp-user-manual

Notepad++ is capable of recording some of your actions you perform while editing a document, and replaying those later on
to avoid having to repeat that sequence of actions. This is called a macro and can save a great deal of time. Macro's can
be played once, or multiple times, even as long as is required to run through an entire document. You can save them for
later use and assign keystrokes to them for fast access (See Shortcut Mapper). Macro's are sensitive to the current position
of the cursor and will (normally speaking) operate relative on it.
To record a macro, select Macro->Start Recording or press the button on the toolbar. Notepad++ will now keep track of the
changes you make on a document or certain actions you perform.
To stop recording, select Macro->Stop Recording or select the button on the toolbar. As an exception to most commands,
you can toggle this behavior with a special shortcut combination that is not listed in the menu but solely in the Shortcut
mapper (see Settings, Shortcutmapper). By default, this is the combination Ctrl-Shift-R.
After the recording is stopped, it will be stored in a temporary buffer. If you haven't performed any actions, this buffer will be
cleared. If you start recording another macro without saving your earlier work, it will be lost.
To play the macro in the buffer, select Macro->Playback or press the button. This will perform the macro once at the current
position.
To save the macro in the buffer, select Macro->Save current recorded macro or press the button. A dialog will pop up
asking for a name of the macro and the default key combination. These can later be changed (and deleted) using the
Shortcutmapper (see Shortcut Mapper). When saved, the macro will be available from the Macro menu or the Macro
playlist.
To play the current macro in the buffer or any saved macro once or multiple times, select Macro->Run a macro multiple
times... or press the button. A dialog will pop up allowing you to select what macro to perform (buffer macro or any saved
macro) and how many times. You can also opt to perform the macro until the cursor reaches the end of the current file
(starting from its current position). Note that if no macro's are available, this dialog is inaccessible.
To edit or delete an existing macro shortcut, you can use the Shortcut mapper, which displays all shortcuts of all kinds, and
allows changing or removing a key binding. The interface is also available through the Macro -> Modify shortcut / Delete
macro entry on the Macros menu. Note that the contents of a macro definition can be edited only in the shortcuts.xml file.

Macros

10

npp-user-manual

Commands allow you to execute applications from Notepad++, for example to open your current file in a browser or
compile it with some external compiler. You can pass the program command line parameters based on the current status of
your document.
To run a new command:
Sselect Run->Run.... A dialog will pop up asking for the path to the program and possible any command line parameters.
You can use the browse button to search for your program. The drop down list provides recently run programs. The
command line arguments can also be based on the status of the current document, and are always enclosed in $(...),
where can be:
FULL_CURRENT_PATH the fully qualified path to the current document. CURRENT_DIRECTORY The directory the
current document resides in. FILE_NAME The filename of the document, without the directory. NAME_PART The filename
without the extension. EXT_PART The extension of the current document. NPP_DIRECTORY The directory that contains
the notepad++.exe executable that is currently running.
CURRENT_WORD The currently selected text in the document. CURRENT_LINE The current line number that is
selected in the document (0 based index, the first line is 0). CURRENT_COLUMN The current column the cursor
resides in (0 based index, the first position on the line is 0). For example,
"$(NPP_DIRECTORY)\notepad++.exe" -multiInst "$(FULL_CURRENT_PATH)" would start a new instance of Notepad++
opening the current file. Remember to put quotes around paths if it can contain spaces. For the Notepad++ command line
options, see Command Line.
To run an existing command:
Select it from the Run menu below the Run... option. If no commands are saved, the list will be empty.
To save the command:
Sselect Run->Run..., enter the command and press Save.... A dialog will pop up asking for a name of the command and the
default key combination. Once saved, the command will be available from the Run menu.
To edit or delete an existing command:
The Shortcut Mapper (see Shortcut Mapper) displays all available commands in a uniform way, so you can modify or delete
any shortcut you defined, including Run commands. This procedure is also available from Run -> Modify shortcut / Delete
command. As the name suggests, this does not extend to editing the command text proper - you need to edit shortcuts.xml
to do that.

Commands

11

npp-user-manual

The Window menu allows you to select a file from the list of the first 10 open documents in the active view (see also Multi
View). Selecting a document from the list will activate it.
You can open the Windows dialog by selecting Window->Windows.... The Windows dialog allows you to manage all the
currently open documents of the activate view.
The Windows dialog shows a list of all the open documents in the active view. You can select one or more documents from
the list. Like any Windows list control, select multiple by dragging during clicking with your mouse, or by pressing Ctrl or
Shift when selecting by clicking. Or use the arrow keys on your keyboard optionally with the Ctrl or Shift key depressed (if
you do so, use the spacebar key to select).
Selecting one allows you to activate it by clicking on the Activate button. This will close the dialog.
Selecting one or more allows you to click on the Save button, this will perform the Save operation if possible on all selected
documents (if a Save As.. operation is needed, nothing will happen (see File Management, Opening and Saving)).
Selecting one or more also allows you to close those documents by clicking on Close Window(s). If a document contains
any changes, you will be asked if you want to save them.
To sort the documents using the dialog, first sort the list by selecting one of the column titles in the top (selecting twice
inverts the sort order). After doing so, select Sort Tabs to sort them, the documents will be rearranged in the view.
Click OK to close the dialog.

Windows Dialog

12

npp-user-manual

The main Notepad++ view consists of a few GUI elements. These sections elaborate a bit on them. Their names will
display as a tooltip as the mouse hovers over the corresponding clickable areas on the big picture:

GUI Elements

13

npp-user-manual

For switching between documents the foremost method is by using the tab bar. However, you can also use the keyboard or
mouse to do so. By default, you can switch to the next document by depressing the Ctrl key and then pressing Tab once for
each next document. Pressing shift as well will select the previous document. To use the mouse, depress the right mouse
button and use the scroll wheel. Scrolling up will select the previous document, scrolling down the next. The order of the
documents is derived from the tab bar. See Tab Bar or Windows Dialog for information on how to change it.
Documents will by default be cyclically selected, meaning that if you select the document past the last one, the first will be
selected. If two views are visible, the first document of the other view will be selected.
Selecting the document previous to the first document will select the last document (if two views are visible that will be the
last document of the other view).

Switching between Documents

14

npp-user-manual

Notepad++ can distinguish between different languages source code can be written in. This is useful to allow certain
modifications and visual aids to be applied specifically designed for that language. For example, a language could
distinguish certain keywords that have to be differently interpreted, and as such it can be useful to distinguish these
keywords using another color or font. The language also determines the folding behavior (see Folding) and how to handle
comments (see Commenting).
Notepad++ offers a lot of languages that can be selected, and has a few methods to add your own as will be discussed. By
default Notepad++ will try to guess the language of a document by the extension of the filename (if it is a file) or the default
setting if it is a new document (see Preferences). To select another language, simply select it from the Language menu.
The language of the currently active document is visible in the status bar in the first section (see Status Bar). By default a
language can have multiple keywords, divided in certain categories. It also determines the symbols used for comments and
what extensions are associated with it by default. You can supplement the keywords and the list of extensions using the
Styler Configurator, it also allows you to change the colors used to print the text.
If you like to define your own language, you can do so by two means. The most simple and straightforward method is to
make user of a User Defined Language (see User Defined Languages), but you can also create your own external lexer
(see External Lexers). This is more flexible but also a lot more difficult to make.

Languages

15

npp-user-manual

Control many the aspects of Notepad++. They are divided in three main groups: Preferences, Styler Configurator and
Shortcut Mapper.
The Shortcut Mapper is a list of keyboard shortcuts to everything that can have one in Notepad++. Styler Configurator
allows changing the visual appearance of anything that has a colour or a font. The Preferences dialog manages everything
else. While there are various aspects in Notepad++ that are not configurable, you may not even notice them.

Settings

16

npp-user-manual

Notepad++ is very extensible using so called plugins. Plugins are small or big additions to Notepad++ to enhance its
functionality. Notepad++ comes bundled with a few plugins (when using the installer, you can choose which ones to add),
but you can always add your own or remove some. The plugins are located in the Plugins directory in the main Notepad++
installation directory. They are DLL files and simply removing or adding them is enough.
When Notepad++ starts, it looks into its Plugins configuration folder and loads whatever dll it finds. Later, you can add
plugins using the Settings -> Import -> Import plugins menu. Be careful to make sure your version of Notepad++ is up-todate enough for new plugins and that the plugin is compatible with Notepad++ (some very old plugins will not work with
newer versions of Notepad++, it is up to the developer of the plugin to add support or not).
Currently, Notepad++ can be found in an (older) ANSI version and the newer Unicode version. The plugin has to match this
version, otherwise it will not work (Notepad++ will warn you about this). Plugins can be found anywhere on the internet, but
a large can be found in the Notepad++ Plugins project on SourceForge.net: http://sourceforge.net/projects/npp-plugins/.
There is even a plugin, called Plugin Manager, which works out the installation details and version management for you.
If a plugin misbehaves, Notepad++ will go out of its way to prevent the failure from propagating so as to avoid any loss of
data. In such a case, you will be presented with information about the plugin reporting a problem. Making this information
available on the Plugin Development forum will help removing the cause of the problem as soon as possible.

Plugins

17

npp-user-manual

Notepad++.exe [-multiInst] [-noPlugin] [-ro] [-nosession] [-notabbar] [-n##] [-l$$$] [FILES] Notepad++ supports a few
command line parameters to control its startup. The following options are supported (they are case sensitive):
-nline number Line number to go to for each file opened. -c Start editing in Column mode. --help Displays this list, i.e. all the
command line switches -loadingTime Displays the loading time of all files Notepad++ is started with. The result is displayed
in a message box, with a 0.01 second resolution. -multiInst allow Notepad++ to start more than one instance. By default, if
Notepad++ is already started files wil lbe opened in that instance, but this option will start a new one. -noPlugin Do not load
any plugins. If you suspect a defunct plugin or you just do not wish to load them, add this option. -ro Any file now opened
will be opened in Read only mode. -nosession Do not load the previous session if Notepad++ is started. Do not save the
session on exit either. -notabbar Hide the Tab Bar, even if the settings say otherwise. -systemtray Start Notepad++
minimised in the system tray, aka notification area -xline number Specify the horizontal position (in pixels) at which
Notepad++ main window is to open. -yline number Specify the vertical position (in pixels) at which Notepad++ main window
is to open. -llanguage short name Language to set for each file opened. $$$ is a short identifier string, of which the
following are allowed:
normal, php, c, cpp, cs, objc, d, java, rc, html, xml, makefile, pascal, batch, ini, nfo, asp, sql, vb, javascript, css, perl, python,
lua, tex, cobol, fortran, bash, actionscript, nsis, tcl, lisp, scheme, asm, diff, props, postscript, ruby, smalltalk, vhdl, kix, autoit,
Gui4Cli, powershell, caml, ada, verilog, matlab, haskell, inno, cmake, yaml,r, jsp Files Anything else will be interpreted as a
filename. Always quote your filename to allow the path to contain spaces, otherwise Notepad++ will split the single path
into multiple paths at each space.
The order of the options is not important.
For compatibility, Notepad++ will first try to identify the entire command line as a filename, even if it is unquoted. It is
however not recommended to do this, always quote the filename.

Command Line

18

npp-user-manual

The startup behavior of Notepad++ can be adjusted with a few (0 sized) control files. Their absence or presence will control
how Notepad++ acts:
doLocalConf.xml If present, Notepad++ will use the installation directory for all configurations. If absent, %APPDATA% is
used instead. asNotepad.xml If present, Notepad++ will act as Windows Notepad, meaning it will launch in multiple
instances, hides the tab bar and will not load the previous session.

Control Files

19

npp-user-manual

By default the Notepad++ installer comes with a Shell extension. This is not really part of the Notepad++ program but very
useful. If you choose to install it, then any file you rightclick on will show an entry named Edit with Notepad++ with the
Notepad++ icon.
Please note that to install or remove the extension, it sometimes is required to restart the Explorer process. For this you
can reboot, logout and log back in or use the task manager to kill explorer (Windows NT and up) and restart it again. You
can do this by hitting Ctrl+Alt+Shift+Del.
If the Shell extension is already installed, the Notepad++ installer cannot update or overwrite it, you first have to uninstall it
and restart Explorer.
If you issue the install command for the dll, which is regsvr32 /i NppShell_01.dll, a dialog box will pop up from which various
details of the behaviour of the extension can be tweaked. The trailing number will increase as versions go.

Shell Extension

20

npp-user-manual

Notepad++ is an actively maintained piece of software, and new versions come fast. There are basically three ways to keep
abreast of changes:
Enabling the Auto Update feature. When a new version is released, and after some delay - 15 days, you will be notified that
a new version is available, and presented with the option of installing that newer version. Using the ? -> Update Notepad++
command. This will check whether there is a new version and whether the safety delay is over. If so, you are presented with
the opportunity to download and install the newer version. Going to the main website and downloading the latest installer or
zipped archive. The safety delay is provided so that, in case a critical bug is spotted on a new release, a corrective release
is done quickly enough, preventing bad bugs to become widespread.

Upgrading

21

npp-user-manual

If you want more information or help for Notepad++, or want to submit some feedback, these are some possibilities.

Further Help

22

You might also like