Sie sind auf Seite 1von 39

.:: The Notepad++ (Doc) Book ::.

Don Ho <don.h@free.fr>
Adrien Sales <prslump@msn.com>
Matt Sicking <matt@sickingfamily.com>
Georg Dembowski <schoSchi@gmx.de>
.:: The Notepad++ (Doc) Book ::.
by Don Ho, Adrien Sales, Matt Sicking, and Georg Dembowski

Published 2005
Copyright © 2005, 2006
Table of Contents
1. About N++ ............................................................................................................................. 1
Syntax Highlighting and Syntax Folding .................................................................................. 1
WYSIWYG ....................................................................................................................... 1
User Defined Syntax Highlighting .......................................................................................... 1
Auto-completion ................................................................................................................. 1
Multi-Document ................................................................................................................. 2
Multi-View ........................................................................................................................ 2
Regular Expressions ............................................................................................................ 2
Regular Expression Search/Replace supported .................................................................. 2
Notepad++ RegExp List ............................................................................................... 2
Notepad++ RegExp Examples ....................................................................................... 3
Drag and Drop .................................................................................................................... 5
Dynamic View Positioning ................................................................................................... 5
File Status Auto-detection ..................................................................................................... 5
Zoom in and zoom out ......................................................................................................... 5
Multi-Language environments ............................................................................................... 5
Bookmarks ........................................................................................................................ 5
Parenthesis and Indent guideline Highlighting .......................................................................... 5
Macro recording and playback ............................................................................................... 5
2. How to ... ............................................................................................................................... 6
Shortcuts ........................................................................................................................... 6
General ............................................................................................................................. 7
Fonts ........................................................................................................................ 7
Open Files ................................................................................................................. 7
Column Mode Selection ............................................................................................... 7
Sharing Defined Language ............................................................................................ 8
Explorer context menu ................................................................................................. 8
Auto Completion ................................................................................................................ 9
Plugins ............................................................................................................................ 10
How to install a plugin ............................................................................................... 10
How to develop a plugin ............................................................................................. 10
User Language Define System Manual .................................................................................. 12
Overview of the User Define Language dialog ................................................................ 13
Folder & Default panel ............................................................................................... 16
Keywords lists panel .................................................................................................. 17
Comment & Numbers panel ........................................................................................ 18
Operators Panel ........................................................................................................ 19
Translation ...................................................................................................................... 20
Theme ............................................................................................................................ 21
Context Menu ................................................................................................................... 22
Command Line Argument .................................................................................................. 25
Run External Tools ............................................................................................................ 26
3. More Notepad++ ................................................................................................................... 28
Help Notepad++ ............................................................................................................... 28
Downloads ...................................................................................................................... 28
Logos ..................................................................................................................... 28
Plugins .................................................................................................................... 29
Language Files ......................................................................................................... 29
Api Files ................................................................................................................. 31
User Defined Language files ....................................................................................... 31
Theme Package ........................................................................................................ 32
4. Document creation ................................................................................................................. 34

iv
List of Tables
2.1. Keyboard shortcuts: ............................................................................................................... 6
2.2. Supported Languages: ............................................................................................................ 9
2.3. Notepad++ messages: .......................................................................................................... 11

v
Chapter 1. About N++
Notepad++ is a free source code editor which supports several programming languages running under
the MS Windows environment.

This project, based on the powerful Scintilla [http://www.scintilla.org/] edit component, and written in
C++ with pure win32 api and STL, ensuring higher execution speed and smaller program size, is offered
under the GPL [http://www.gnu.org/copyleft/gpl.html] Licence.

This project is mature. However, as you can see, it's a one-man project, and there are still some bugs and
missing features. If you have any questions or suggestions about this project, please drop me an email. I
would love to hear from you. Also, feel free to send me any feature requests you might have. Although,
I can't guarantee that I'll implement them.

You're encouraged to translate Notepad++


[http://notepad-plus.sourceforge.net/uk/translation-HOWTO.php] (if it is not present in the Download
Section [http://notepad-plus.sourceforge.net/uk/download.php]) and/or the Notepad++ official site
[http://notepad-plus.sourceforge.net/commun/misc/pagesToTranslate.zip] to your native language.

I hope you enjoy Notepad++ as much as I did coding it.

Here are the features of Notepad++:

Syntax Highlighting and Syntax Folding


Supported languages: C, C++ (screenshot [./img/scrsh_multiView.gif]), Java (screenshot
[./img/scrsh_lexerJava.gif]), C#, XML(screenshot [./img/scrsh_lexerXML.gif]), HTML, PHP, Javascript
(screenshot [./img/scrsh_lexerHTML.gif]), RC resource file, makefile, ASCII art file (extension .nfo ,
screenshot1 [./img/scrsh_asciiArt.gif], screenshot2 [./img/scrsh_asciiArt2.gif]), doxygen, ini file, batch
file, ASP (screenshot [./img/scrsh_lexerAsp.gif]), VB/VBS source files (screenshot
[./img/scrsh_lexerVB.gif]), SQL (screenshot [./img/scrsh_lexerSQL.gif]), Objective-C (screenshot
[./img/scrsh_lexerObjC.gif]), CSS, Pascal, Perl, Python and Lua.

WYSIWYG
If using a colour printer, your document, incuding line numbers, will be printed in colour as shown on
the screen.

User Defined Syntax Highlighting


Syntax highlighting may be completely configured by the user. This includes not only the syntax high-
lighting keywords, but also the syntax folding keywords, comment keywords, and operators. ( screen-
shot1 [./img/ulds_folder.gif], screenshot2 [./img/ulds_keywords.gif], screenshot3
[./img/ulds_comment.gif], screenshot4 [./img/ulds_op.gif] ).

Auto-completion
For most supported languages, api files may be downloaded from the Notepad++ download section
[http://notepad-plus.sourceforge.net/uk/download.php]). Furthermore, the user can create or augment the
API list for a given language. Type Ctrl+Space to launch this action (see screenshot
[./img/scrsh_autocomplete.gif]). For more information about Auto-completion, refer to the the section
called “Auto Completion” section.

1
About N++

Multi-Document
Multiple documents may be simultaneously opened and edited within the same Notepad++ application.

Multi-View
It is possible to display two views simultaneously. This may be either separate views of two distinct doc-
uments (screenshot [./img/scrsh_multiView.gif]), or two views of the same document. In this second
case, any modifications performed on the document in one view will also be applied in the second view
(screenshot [./img/scrsh_multiViewCloneMode.gif]).

Regular Expressions
Regular Expression Search/Replace supported
Regular expressions may be used as the search criteria in all search and replace options.

Notepad++ RegExp List


In a regular expression, special characters interpreted are:

• .

Matches any character

• (

This marks the start of a region for tagging a match; so what's inside ( ) you can use in "replace
with" using \1, \2 etc.

• )

This marks the end of a tagged region.

• \n

Where n is 1 through 9 refers to the first through ninth tagged region when replacing. For example, if
the search string was Fred([1-9])XXX and the replace string was Sam\1YYY, when applied to
Fred2XXX this would generate Sam2YYY.

• \<

This matches the start of a word using Scintilla's definitions of words.

• \>

This matches the end of a word using Scintilla's definition of words.

• \x

This allows you to use a character x that would otherwise have a special meaning. For example, \[
would be interpreted as [ and not as the start of a character set.

• [...]

2
About N++

This indicates a set of characters, for example, [abc] means any of the characters a, b or c. You can
also use ranges, for example [a-z] for any lower case character.

• [^...]

The complement of the characters in the set. For example, [^A-Za-z] means any character except an
alphabetic character.

• ^

This matches the start of a line (unless used inside a set, see above).

• $

This matches the end of a line.

• *

This matches 0 or more times. For example, Sa*m matches Sm, Sam, Saam, Saaam and so on.

• +

This matches 1 or more times. For example, Sa+m matches Sam, Saam, Saaam and so on.

Source [http://scintilla.sourceforge.net/ScintillaDoc.html#Searching] of this information is the Scintilla


edit component help, but it was adapted to Notepad++ behaviour.

Notepad++ RegExp Examples


Important

• You have to check the box "regular expression" in search & replace dialog

• When copying the strings out of here, pay close attention not to have additional spaces in front of
them ! Then the RegExp will not work!

You use a MediaWiki (e.g. Wikipedia [http://www.wikipedia.org/], Wikitravel [http://wikitravel.org])


and want to make all headings one "level higher", so a H2 becomes a H1 etc.

1.
• # Search ^=(=)

• Replace with \1

• Click "Replace all" to find all headings2...9 (two equal sign characters are required) which be-
gin at line beginning (^) and to replace the two equal sign characters by only the last of the two,
so eleminating one and having one remaining.

2.
• # Search =(=)$

• Replace with \1

• Click "Replace all" to find all headings2...9 (two equal sign characters are required) which end
at line ending ($) and to replace the two equal sign characters by only the last of the two, so

3
About N++

eleminating one and having one remaining.

3. == title == became = title =, you're done :-)

You have a document with a lot of dates, which are in German date format (dd.mm.yy) and you'd like to
transform them to sortable format (yy-mm-dd). Don't be afraid by the length of the search term - it's
long, but consiting of pretty easy and short parts :

1.
• Search ([^0-9])([0123][0-9])\.([01][0-9])\.([0-9][0-9])([^0-9])

• Replace with \1\4-\3-\2\5

• Click "Replace all" to fetch


• the day, whose first number can only be 0, 1, 2 or 3

• the month, whose first number can only be 0 or 1

• but only if the spearator is . and not any charcter ( . versus \. )

• but only if no numbers are sourrounding the date, as then it might be an IP address instead
of a date and to write all of this in the opposite order, except for the surroundings. Pay atten-
tion: Whatever SEARCH matches will be deleted and only replaced by the stuff in the RE-
PLACE field, thus it is mandtory to have the surroundings in the REPLACE field as well!

2. 31.12.97 became 97-12-31 and 14.08.05 became 05-08-14 and the IP address 14.13.14.14 did not
change, you're done :-)

You have printed in windows a file list using dir /b/s > filelist.txt to the file filelist.txt and want to make
local URLs out of them :

1. Open filelist.txt with Notepad++

2.
• Search \\

• Replace with /

• Click "Replace all" to change windows path separator char \ into URL path separator char /

3.
• Search ^(.*)$

• Replace with file:///\1

• Click "Replace all" to add file:/// in the beginning of all lines

4. Depended on your requirements, preceed to escape some characters like space to %20 etc.

5. C:\!\aktuell.csv became file:///C:/!/aktuell.csv, you're done :-)

4
About N++

Drag and Drop


Drag and Drop operations are supported in most scenarios. A document can be opened by dragging it in-
to the workspace. Documents may also be dragged from one position or view to another. File tabs may
be rearranged by dragging them. Text blocks within a document may be moved or copied by dragging.

Dynamic View Positioning


When displaying two simultaneous views, the width of vertical views, or the height of horizontal views
may be dynamically altered by dragging the border between them. See screenshot
[./img/scrsh_rotate.gif].

File Status Auto-detection


If a file currently open in Notepad++ is modified or deleted, you will receive a notification to update
your document (reload the file or remove the file).

Zoom in and zoom out


This is another fantastic function thanks to the Scintilla component. Just see screenshot
[./img/scrsh_zoom.gif].

Multi-Language environments
Chinese, Japanese, Korean, Arabic, and Hebrew Windows environments are supported. See Notepad++
in action under the Chinese Windows [./img/scrsh_underChineseSys.gif] , Arabic Windows
[./img/scrsh_underArabicWin.gif] and Hebrew [./img/scrsh_underHebrewWin.gif] Windows screen-
shots.

Bookmarks
Clicking on the bookmark margin (located on the right side of the line number margin) or typing
Ctrl+F2 will toggle a book mark on that line. To return to a saved bookmark, type just F2 (Next book-
mark) or Shift+F2 (Previous bookmark). To clear all bookmarks, click "Search" -> "Clear All book-
marks". See screenshot [./img/scrsh_bookmark.gif].

Parenthesis and Indent guideline Highlighting


When the cursor is positioned on either side of a parenthesis (), brace {}, or square bracket [], that sym-
bol and its symmetric opposite symbol will be highlighted. If the matching symbols are on separate
lines, the indent guideline pertaining to the leftmost symbol will also be highlighted in order to locate
the block more easily. See screenshot1 [./img/scrsh_braceIndentGuideHiLiting.gif], screenshot2
[./img/scrsh_braceHiLiting.gif] .

Macro recording and playback


Keystroke macros may be recorded, edited, played back, and assigned keyboard shortcuts.

5
Chapter 2. How to ...
Shortcuts

Table 2.1. Keyboard shortcuts:


Keyboard Shortcut Action
Ctrl-C Copy
Ctrl-X Cut
Ctrl-V Paste
Ctrl-Z Undo
Ctrl-Y Redo
Ctrl-A Select All
Ctrl-F Launch Find Dialog
Ctrl-H Launch Find / Replace Dialog
Ctrl-D Duplicate Current Line
Ctrl-L Delete Current Line
Ctrl-T Exchange the positions of the current and previous lines
F3 Find Next
Ctrl-S Save File
Ctrl-O Open File
Ctrl-N New File
Ctrl-F2 Toggle Bookmark
Shift-F2 Go To Previous Bookmark
Ctrl-G Launch GoToLine Dialog
Ctrl-W or Ctrl-F4 Close Current Document
Alt + Left mouse click Column Mode Select
F5 Launch Run Dialog
Ctrl-Space Launch CallTip ListBox
Tab (selection of several lines) Insert Tabulation or Space (Indent)
Shift-Tab (selection of several lines) Remove Tabulation or Space (outdent)
Ctrl-(Keypad-/Keypad+) Zoom in (+ or up) and
Ctrl + mouse wheel button (if available) Zoom out (- or down)
Ctrl-Keypad/ Restore the original size from zoom
F11 Toggle Full Screen Mode
Ctrl-Tab Next Document
Ctrl-Shift-Tab Previous Document
Ctrl-Shift-Up Move Current Line Up
Ctrl-Shift-Down Move Current Line Down
Ctrl-Alt-F Collapse the Current Level

6
How to ...

Keyboard Shortcut Action


Ctrl-Alt-Shift-F Uncollapse the Current Level
Alt-(1~8) Collapse the Level (1~8)
Alt-Shift-(1~8) Uncollapse the Level (1~8)
Ctrl-BackSpace Delete to start of word
Ctrl-Delete Delete to end of word
Ctrl-Shift-BackSpace Delete to start of line
Ctrl-Shift-Delete Delete to end of line
Ctrl-U Convert to UPPER CASE
Ctrl-B Go to matching brace
Ctrl-Shift-R Start to record /Stop recording the macro
Ctrl-Shift-P Play recorded macro
Ctrl-Q Block comment/uncomment
Ctrl-Shift-Q Stream comment

General
Fonts
How can I set all the fonts under Notepad++ to a mono-space font ?

All the styles (colour & font) are configurable via the Styler Configurator Dialog (menu: Language-
>Styler Configurator...). To apply the same font (ex: Fixedsys) to all the styles, choose Global Styles in
the Language column and Default Style in the Styles column. Then set your favorite font.

Open Files
I attempted to open a file whose pathname contains white space. It appears that this is not supported by
Notepad++.

Notepad++ does indeed support long filenames with white space. There shouldn't be a problem if you
open such a file via the internal File Open dialog (from menu: File->Open), via Drag N' Drop, or via the
context menu (right click mouse, installed by Notepad++ Installer) under Explorer.

However, if you attempt to manually associate Notepad++ with certain file extensions, there may be a
problem. It has been my experience, if you want to add a registry key yourself, that you should do
something like this:

"C:\Program Files\Whatever\Notepad++.exe" "%1"

(including the double quotes) to make sure the shell correctely interprets the string.

As of v2.6, Notepad++ is integrated with the File Associations Manager which allows user to associate/
disassociate all the desired file extensions with Notepad++. Note that Administrator's rights are required
to perform this operation.

Column Mode Selection


Does Notepad++ support column mode selection?

7
How to ...

Yes. Alt + left mouse click will turn on column mode selection. See the section called “Shortcuts” to get
all Notepad++ shortcuts.

Sharing Defined Language


How can I share MY DEFINED LANGUAGE (or my syntax highlighting) with other users?

The language definition file is named userDefineLang.xml. It is located in the “Application Data”
subfolder in the user's Documents and Settings folder. To locate this file open a command window
(START->Run) and key in

%APPDATA%\Notepad++

A folder window will open containing the userDefineLang.xml file. To copy this file onto another
user's system, follow the same process as above to access the Application Data folder, and paste the
userDefineLang.xml file into the folder.

To share the syntax highlighting definition file, follow this same process, substituting stylers.xml
for userDefineLang.xml.

Explorer context menu


The Explorer context menu entry (right mouse click menu item) does not work in the new version.
Why?

Due to numerous file association bugs in the Notepad++ context menu entry, this feature is no lnger sup-
ported by the Notepad++ installer.

However, you can add this entry to the registry manually to make the Notepad++ context menu entry
work. There are two methods of doing this:

• Method 1:

1. Launch regedit.exe

2. Add a key named


Notepad++
in the key
HKEY_CLASSES_ROOT\*\shell

3. Add a key named


Command
in the key
Notepad++

4. Modify the default string in the key


Command
, by double clicking and keying in:
<listitem>./files/foo.reg

"C:\Program Files\Notepad++\Notepad++.exe" "%1"

</listitem>
A screenshot ilustrating this method follows:

8
How to ...

Change registry for Explorer Context Menu

• Method 2:

• Create a file, say foo.reg [./files/foo.reg], with the following content:

REGEDIT4
[HKEY_CLASSES_ROOT\*\Shell\n++]
[HKEY_CLASSES_ROOT\*\Shell\n++\Command]
@="\"C:\\Program Files\\Notepad++\\Notepad++.exe\" %1"

• Execute foo.reg by double-clicking it.

• Note that you should modify "C:\Program Files\Notepad++\Notepad++.exe" to indicate the actu-
al path to Notepad++ on your system.

• No need to say all the blah blah about "backup your registry before you modify it" and "do this at
your own risk".

Auto Completion
How to implement and customize Auto-completion:

Type Ctrl-Space to trigger the autocomplete list box (see screenshot). You may add your own api file in
the directory YOUR_NPP_DIR\plugins\APIs where YOUR_NPP_DIR is the directory in which you in-
stalled Notepad++. Note that the extension of the api file is “.api”. Below is a list of the required api file
names that should be created for each supported language.

Table 2.2. Supported Languages:


LANGUAGE NAME . EXT
C c . api
C++ cpp . api
Objective-C objC . api
Java java . api
C# cs . api
XML xml . api
HTML Internal implementation
Javascript javascript . api

9
How to ...

LANGUAGE NAME . EXT


PHP php . api
VB/VBS/ASP vb . api
CSS css . api
SQL Internal implementation
Perl perl . api
Pascal pascal . api
Python python . api
Resource File (rc) Internal implementation
TeX tex . api
Fortran fortran . api
bash bash . api
Actionscript flash . api
NSIS nsis . api
text text . api

As indicated, three common languages, HTML, SQL, and RC, are hard coded, eliminating the need for
an api file.

The api files are simple text files, which you can create with any text editor - including, of course your
favorite - Notepad++ :-) . You can find an example php.api file in the YOUR_NPP_DIR\plugins\APIs
directory . Note that the api list should be created in alphabetic order.

As of v2.7, Auto-Completion for User Defined Languages is supported. Just give the api file as your
defined language name. E.g., if your defined language name is "My Lang", create an api file named "My
Lang.api" in order to perform Auto-Completion operation.

Plugins
How to install a plugin
The plugin (in the DLL form) should be placed in the Notepad++\plugins directory. Once you
have installed the plugin, you may use and configure it via the Plugins menu.

How to develop a plugin


The Windows Message System is used to avoid excessive overhead. This means that the plugins system
makes available certain Notepad++ handles in order to give more flexibility and capability to the plugin
developer. There are three window handles available at present: The main Notepad++ handle, and two
Scintilla Window handles.

To implement your plugin, just send the appropriate message to the appropriate handle.

Here are 2 plugin demo projects:

• You can start your project from the NppPluginDemo project which is the basic skeleton ( VC++7
version [./files/NppPluginDemo.zip] and Dev-C++ & Code::Blocks version
[./files/NppPluginDemo.Dev-C++.zip] ).

10
How to ...

• A complete working project can be examined in NppInsertPlugin. This may give you a better idea
how it works ( VC++7 version [./files/NppInsertPlugin.zip] and Dev-C++ & Code::Blocks version
[./files/NppInsertPlugin.Dev-C++.zip] ).

Note that the Dev-C++ & Code::Blocks packages (contributed by Chris Severance) support the follow-
ing IDE/Compiler in both C and C++:

• Dev-C++ / GCC (MingW)

• Code::Blocks / GCC (MingW)

• Code::Blocks / MSVC++

• Code::Blocks / Digital Mars

• Code::Blocks / Borland C++ 5.5

• Code::Blocks / Open Watcom

The interface (header file) of plugins is written in C for both C and C++ programmers. If you translate
this interface into another development language, please contact the author. I'll include it in future re-
leases.

Table 2.3. Notepad++ messages:


Message wParam lParam Comment
WM_GETCURRENTSCIN 0 [out] int * currentEdit currentEdit indicates the
TILLA current Scintilla view: 0 is
the main Scintilla view; 1 is
the second Scintilla view.
WM_GETCURRENTLAN 0 [out] int * langType langType indicates the lan-
GTYPE guage type of the current
Scintilla view document.
Refer to the LangType
enum in "PluginInterface.h"
for allowable values.
WM_SETCURRENTLAN 0 [in] int langTypeToSet langTypeToSet is used to
GTYPE set the language type of the
current Scintilla view docu-
ment. Refer to the Lang-
Type enum in "PluginInter-
face.h" for allowable value.
WM_GET_FULLCURRE 0 [out] char * fullPath fullPath receives the full
NTPATH path name of the current
Scintilla view document.
The User must allocate a
buffer (or use automatic
variables) of sufficient size.
The use of MAX_PATH is
recommended for this pur-
pose.

11
How to ...

Message wParam lParam Comment


WM_GET_CURRENTDIR 0 [out] char * fileName fileName receives the file
ECTORY name of the current Scin-
tilla view document. The
User must allocate a buffer
(or use automatic variables)
of sufficient size. The use
of MAX_PATH is recom-
mended for this purpose.
WM_GET_FILENAME 0 [out] char * directoryPath directoryPath receives the
directory path of the current
Scintilla view document.
The User must allocate a
buffer (or use automatic
variables) of sufficient size.
The use of MAX_PATH is
recommended for this pur-
pose.

To learn more about Scintilla, please visit their official website


[http://scintilla.sourceforge.net/ScintillaDoc.html]

User Language Define System Manual


The pdf version of this section is available here [./files/UserLangDefineManual.pdf]

Since some natural languages are not supported by Notepad++, the User Language Define System al-
lows the user to define his own. This includes syntax highlighting keywords, syntax folding keywords,
comment keywords, and operators.

12
How to ...

Here is an example, a user define language named My Language:

In this example, syntax highlighting and the syntax folding are applied to the userDefineLang.myl docu-
ment (on the left) as a result of the definition in the User Define Language dialog (on the right).

Overview of the User Define Language dialog


This dialog consists of two parts: global functionalities, and definition.

The global functionalities are for global operations: such as choosing / creating / renaming / removing a
user define language. The definition part is to define the folder symbols / keywords / comments symbols
/ operators for a chosen user define language.

13
How to ...

The default user defined language is named User Define Language.

You can define keywords, folding blocks, and comments under the default User Define Language. In or-
der to take effect, you must define your current document as a User Define Language document by
clicking:

14
How to ...

However, all the definitions you make will be temporary under the User Define Language (ie. they will
disappear in the next session). If you want to keep your definitions, you must save them by clicking the
Save as... button. Once saved, you can use it or modify it further in future sessions.

You can also associate one file extension with your defined language - so every time you open the files
with this extension, the highlighting of your defined language will be applied on the document automat-
ically.

15
How to ...

Of course, you can rename your language, use it as a model (Save as...), or remove it.

Folder & Default panel


This panel allows the user to define the default style, folder keywords, and folder styles.

The default style applies to all undefined styles (i.e. all undefined keywords).

The folder definition consists of two parts: the open folder definition and the close folder definition.
These work together as a pair.

16
How to ...

In the above figure, two blocks are defined by the keywords: "blockBegin", "blockEnd", "if", and "fi".
With the keywords defined, the User Define Language System is able to form the block(s) that the user
can fold or unfold. Notice that if you define several keywords in the open folder definition or in the
close folder definition, any of those close folder symbols will form a block with any preceding open
folder symbol. For instance, in the given example, either BlockEnd or fi may be used to close a block
starting with blockBegin.

Keywords lists panel


There are four groups of keywords, making four styles available for general use.

17
How to ...

The user is not required to use all four.

Comment & Numbers panel


In this panel, the user can define styles for numbers and for comments (as well as the comment symbol
definition) .

18
How to ...

Two types of comments can be defined in the User Define Language System - comment line and com-
ment block. In contrast to the other styles, the comment style applies the style not only to the defined
symbols, but also to the comment block or the comment line.

Operators Panel
There are two rules for the User Define Language System that must be kept in mind:

1. An elementary unit (token) is always terminated by white space, a TAB symbol ('\t'), a new line
symbols ('\n') or a user defined operator.

2. All the symbol characters are a part of the elementary unit (token), unless they are defined as oper-
ators.

With these two principles in mind, it is easy to understand the following example:

19
How to ...

The token "INTEGER" is recognized thanks to keyword definition (i.e. "INTEGER" is in the keywords
lists). If '(' were not defined as an operator, the second "INTEGER" would not be recognized, because
"(INTEGER" would be treated as a distinct unit (token) which is not in the keyword list.

Translation
You can teach Notepad++ to speak your mother tongue: Just download english.xml [./files/english.xml]
and translate it into your language.

Notes on translation:

• All the English words following the


name=
string should be translated.

• Any numbers not in the Attribute name (the Attribute id, order, posX and posY) should NOT be
changed.

• &amp; in the Tag Menu is &. It is used to define accelerator keys. It displays an underline beneath
the following letter, and when the Alt key is pressed in combination with that letter, the correspond-
ing menu item is executed. It is up to the user to define its position on translated words, depending n

20
How to ...

the menu conventions of your language.

• Do not remove the TAB character between the name to be translated and the shortcut, or change the
TAB to white space.

• Do not change the shortcuts (ex: Ctrl-C) even if they are not equivalent in your language.

• Make your translations as brief as possible. The controls in dialogs won't be resized dynamically.

Here is an example:

The translation of Paste in French is Coller, so the XML Tag Translation from English to French should
be from:

<Item id = "42005" name = "&amp;Paste Ctrl+V"/>

to:

<Item id = "42005" name = "C&amp;oller Ctrl+V"/>

How to test your translation:

1. Rename english.xml to nativeLang.xml

2. Click Start-&Run. In the Run box type


%APPDATA%\Notepad++
in it and Enter. A directory folder opens.

3. Copy the nativeLang.xml into the opened directory.

4. Exit Notepad++ and relaunch.

Contact me (Don Ho in the author section), if you want your translation included in future releases.

Theme
Starting from version 2.4, user can customize the toolbar icons by using toolbarIcons.xml. The aim of
this xml file is to define the path where icons reside that you want to use instead of the default icons
offered by Notepad++. The toolbarsindex.xml file should be located in the %APPDATA%\Notepad++
directory in order to take effect.

21
How to ...

Here's the structure of toolbarIcons.xml

There are 20 items in the Notepad++ toolbar, so 20 icon tags are present in the toolbarIcons.xml file. As
shown, each Icon tag has its own name and its own id. The name is used as an identifier, in order that
you know which icon you're modifying. The id is the essential element for the program, so don't modify
this value.

To customize the toolbar icons, enter the path (1) where your icons are ;located, and the name of your
icons (2). If you leave these fields blank (3), the item will be ignored (ie. the default icons will remain in
force).

Each item contains at least two icons: the default (normal) icon and the hover icon. For some items,
there is a third "disabled" icon. However you could associate the same icon file with the normal icon, the
hovered icon and the disabled icon. In this case, there will be no change to the icon when it is disabled
or when the mouse hovers over it.

Don't forget to check the menu item "View->Tool Bar->Enlarge me". Otherwise you custom icon defini-
tions will not take effect.

Download Notepad++ Theme Demo Package [./files/nppToolbarIcons.zip] for a complete illustration.


Please read "readme.txt" which comes with the package for installation information.

Context Menu
The Notepad++ context menu is the menu that appears on a right click of the edit zone:

22
How to ...

Right clicking on the edit zone

23
How to ...

User can change the context menu by adding/ modifying the file
%APPDATA%\Notepad++\contextMenu.xml.

The rule is very simple: For the item that you wish to add, find its name (1) and corresponding id (2) in
the english.xml [./files/english.xml] file between the <Commands> and </Commands> tags Then add,
delete, or modify it in the contextMenu.xml file using the form <Item id="idToAdd">. Notice that an id
of 0 will insert a separtor in the context menu.

24
How to ...

English.xml preview

Command Line Argument


The following arguments may be passed to Notepad++ when launched from the command line or via a
shortcut.

Syntax::

25
How to ...

Notepad++ [-multiInst] [-lLanguage] [-nLineNumber] [fullFilePathName]

Description:

• -multiInst: Notepad++ executes as a unique instance by default. This option allows you to launch
several instances of Notepad++.

• -l: This option applies the Language to the fullFilePathName to open. E.g.:

Notepad++ -lxml d:\myproj\proj.vcproj

In this example, the file proj.vcproj will be opened as an xml file, even though its extension vcproj is
not recognized as an xml file extension. Valid languages include: c, cpp, java, cs, objc, rc, html,
javascript, php, vb, sql, xml, asp, perl, pascal, python, css, lua, batch, ini, nfo, tex, fortran, bash, ac-
tionscript, and nsis.

• -n: This option locvates the specified line number upon opening u want after opening. E.g.,

notepad++ -n150 E:\notepad++\PowerEditor\src\Notepad_plus.cpp

This will open the file Notepad_plus.cpp then scroll the view and place the cursor on line 150.

• # fullFilePathName: The full path of file you wish to open.

Run External Tools


The Notepad++ Run dialog (the F5 key or the Run menu item) is used to launch an external application
with optinal parameters. Notepad++ defines three environment variables which may be used as argu-
ments in the Run command to pass the name, path, or full pathname of the currently edited document to
the external tool. These are named, respectively, FILE_NAME, CURRENT_DIRECTORY, and
FULL_CURRENT_PATH.

The environment variables may be referenced using the following syntax:

$(ENVIRONMENT_VARIABLE)

FOr example, say the current file you are editing in Notepad++ is:

E:\my Web\main\welcome.html

The 3 environment variables contain:

FULL_CURRENT_PATH: E:\my Web\main\welcome.html


CURRENT_DIRECTORY: E:\my Web\main\
FILE_NAME: welcome.html

It is recommended that you surround the environment variable reference with double quotes in case your
pathname includes white space.

Two vcvery common exaples are:

26
How to ...

• firefox "$(FULL_CURRENT_PATH)"

• iexplore "$(FULL_CURRENT_PATH)"

These two user commands are also included in npp.3.0.installer.exe (or later version), and can be
launched using Ctrl+Alt+Shit+X and Ctrl+Alt+Shit+I respectively.

27
Chapter 3. More Notepad++
Help Notepad++
To help defray the costs of Notepad++ development, you can make a donation via: ht-
tp://sourceforge.net/donate/index.php?group_id=95717.

Too much of a skinflint to make a donation? Not to worry. You can still contribute to Notepad++ project
in the following ways:

1. Translate the application to your native language. See the section called “Translation” .

2. Translate pages of the Notepad++ official webite to your native language. Click here
[./files/pagesToTranslate.zip] , or here
[http://notepad-plus.sourceforge.net/commun/misc/pagesToTranslate.zip] to download the pages to
translate.

3. Tell your friends, neighbors, spouse, clergyman, boss, co-workers, minions, government officials,
grand-mom or three year old son Chapter 1, About N++ Notepad++, and encourage them to down-
load and use it.

Downloads
Logos

Download here [img/npp.logo.80x15.png]

Download here [img/npp.logo4.png]

Download here [img/npp.logo5.png]

Download here [img/npp.animated.logo.gif]

28
More Notepad++

Download here [img/npp.logo3.png]

Download here [img/npp.logo2.gif]

Plugins
Since the v3.1 release, Notepad++ has been able to be extended using a plugin system. Details of in-
stalling and developing plugins are in the the section called “Plugins” section.

Here is a list of available plugins:

• Function list [./files/pluginFuncList.zip] : by Jens Lorenz

• XML Check [./files/pluginXMLChecker.zip] : by Morbac Schmoelmol

• Insertion [./files/pluginInsertion.zip] : by Don HO

Language Files
As of v2.3 Notepad++ supports the multilanguage functionality by means of a translated xml file (from
english.xml [./files/english.xml]). Normally you don't need the language file if you install Notepad++ by
its installer, but you may need it if you install it from zip format binary or if your language is not suppor-
ted by the NSIS installer.

To make Notepad++ speak another language, you have to:

1. Download the language you need, renamed to "nativeLang.xml".

2. Launch the Run Dialog by clicking Start->Run and type %APPDATA%\Notepad++ into the text
field of Run Dialog.

3. Copy nativeLang.xml into the opened Directory

4. Launch Notepad++

At present these languages are supported by Notepad++:

• Chinese [./files/chinese.zip] by Don HO

• French [./files/french.zip] by Don HO

• Spanish [./files/spanish.zip] by Alberto Martinez & Alzacon

29
More Notepad++

• Hungarian [./files/hungarian.zip] by Gyorgy Bata

• Russian [./files/russian.zip] by Sergey Frolov & Piros aka Wonderer

• Dutch [./files/dutch.zip] Dutch by Hans Luijten & Harm Hilvers

• Chinese [./files/chineseSimplified.zip] Simplified by Li Chen & noword

• Polish [./files/polish.zip] by Marek Robak

• German [./files/german.zip] by Dominik Geyer & Heinz Hemker & Meinrad Schwamborn

• Italian [./files/italian.zip] by Consonni Daniele (bitmap) & Alberto Doria

• Danish [./files/danish.zip] by Kenneth Mikkelsen

• Czech [./files/czech.zip] by Ondrej Muller & Tomas Hrouda

• Slovenian [./files/slovenian.zip] by Jure Zemljic

• Slovak [./files/slovak.zip] by Juraj Valasik

• Ukrainian [./files/ukrainian.zip] by Taras Budurovych

• Turkish [./files/turkish.zip] by FIRAT KUCUK

• Brazilien [./files/brazilian_portuguese.zip] Portuguese by Cristiano Ascari

• Norwegian [./files/norwegian.zip] by Geir Hakon Eikland

• Swedish [./files/swedish.zip] by Kjell Rask

• Catalan [./files/catalan.zip] by Manel Guerra

• Arabic [./files/arabic.zip] by Motaz Isamil

• Lithuanian [./files/lithuanian.zip] by Meskauskas Audrius

• Galician [./files/galician.zip] by Emilio Rodríguez

• Finnish [./files/finnish.zip] by Jaakko Salonen

• Greek [./files/greek.zip] by Dionysis Zindros

• Romanian [./files/romanian.zip] by Viorel RB

• Extremaduran [./files/extremaduran.zip] by Miguel Angel Navareno

• Korean [./files/korean.zip] by Kim Taegon

• Hebrew [./files/hebrew.zip] by Ran Sasson

• Portuguese [./files/portuguese.zip] by Bruno Antunes

• Farsi [./files/farsi.zip] by Khosro Afroozeh

• Samogitian [./files/samogitian.zip] by Mindaugas Machernis

• Bulgarian [./files/bulgarian.zip] by Milen Metev (Tragedy)

30
More Notepad++

• Indonesian [./files/indonesian.zip] by Dwi Susanto

• Albanian [./files/albanian.zip] by Fatmir Raka

• Japanese [./files/japanese.zip] by Chris Campbell

• Croatian [./files/croatian.zip] by Sivi

Api Files
Notepad++ has supported auto-completion since v2.0. Please see the auto-completion HOWTO for com-
plete details.

Here are some api files that you may need:

• vb.api [./files/vb.zip] by Wilco Bloom

• java.api [./files/java.zip] by Blaise Le Goff

• c.api [./files/c.zip] by Blaise Le Goff

• javascript.api [./files/javascript.zip] by Blaise Le Goff

• python.api [./files/python.zip] by Blaise Le Goff

• flash.api [./files/flash.zip] by Blaise Le Goff

• cpp.api [./files/cpp.zip] by Adam Mullett

• vhdl.api [./files/vhdl.zip] by Andrey

• smarty.api [./files/smarty.zip] by Helge de Vries

• css api with colors [./files/cssColors.zip] by Joseph Smith

• docbook [./files/xml.zip] by Adrien (Used to create this document)

User Defined Language files


To add additional user defined language files follow the following procedure:

1. Download the user-defined language to your computer

2. Open the file in a text editor (such as Notepad++)

3. Click Start->Run, key in %APPDATA%\Notepad++ and click ok

4. Open userDefineLang.xml with a text editor

5. If this is the first user defined language you are adding, copy/paste the entire file (which you down-
loaded) into userDefineLang.xml, replacing the entire contents. If this is not the first language be-
ing added, simply copy the entire downloaded file, from <UserLang...> through </UserLang> , and
paste it at the end of the userDefineLang.xml immediately before </NotepadPlus>

6. Save the new userDefineLang.xml

31
More Notepad++

Please see the section called “User Language Define System Manual” for complete details.

Below is a list of ready to use user-defined languages available for download:

• VHDL [./files/userDefineLang_vhdl.zip] by Andrey

• Cue Sheet [./files/userDefineLang_CueSheet.zip] by Gyorgy Bata

• TCL / TK [./files/userDefineLang_tclTk.zip] by Scott MacGregor

• Ruby [./files/userDefineLang_ruby.zip] by Ganesh Viswanathan

• Smarty [./files/userDefineLang_smarty.zip] by Helge de Vries

Theme Package
Requires v2.4 or later.

Installation:

1. Download the Notepad++ Theme Demo Package [./files/nppToolbarIcons.zip]

2. Unzip all the files into a directory, say


<b>C:\foo\</b>
.

3. Open toolbarIcon.xml which comes with this package in your favourite editor (Notepad++, of
course ;) ).

4. Replace

E:\Sources\Notepad++\PowerEditor\bin\newIcons\

with

C:\foo\

in the tag <Theme name = "Demo" pathPrefix =


"E:\Sources\Notepad++\PowerEditor\bin\newIcons\"" > And save it.

5. Open the Run Dialog by clicking Start->Run.

6. Type

%APPDATA%\Notepad++

into the text field of the Run dialog. A folder named Notepad++ will appear.

7. Copy the modified toolbarIcon.xml into the opened folder.

8. Close Notepad++ and re-launch it. You will now see the Crystal icon set instead of the default
icons.

Important: The "View->Tool Bar->Enlarge me" option must be checked in order to view the Crystal
theme.

32
More Notepad++

Demo package [./files/nppToolbarIcons.zip]


I couldn't find the icons for the Wrap text, Invisible characters, and Show/Hide Indent Guideline items.
If you have the icons for these items, please send them to me.

Below is an image of the Crystal Theme Package, a set of high quality icons created by Alican Toprak:

Download Crystal++ Theme Package [./files/Crystalpp_ToolbarIcons.exe]

33
Chapter 4. Document creation
As I (Adrien Sales) found this tool very useful, and I think that an online help doc is useful, i decided to
donate time to Notepad++ by creating and offering this document to Notepad++. As you will probably
see, i've tried to reproduce the content of the official website
[http://notepad-plus.sourceforge.net/uk/site.htm]. For now it's in english (to make it readable by the
largest number of people), but if someone is interested in translating this doc in his own laguage, I'll
provide the sources used to build this document which has been created thanks to docbook stylesheets,
xalan, and of course Notepad++ ;-p.

I want to thank Matt Sicking and Georg Dembowski for having provided me new content to add to the
tutorial, making it more useful after each update (see Revision History).

34

Das könnte Ihnen auch gefallen