You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/config-files.md
+29-14Lines changed: 29 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
1
---
2
-
title: Configuration Files Syntax
2
+
title: Configuration Files
3
3
linktitle: config-files
4
4
weight: 115
5
5
---
6
6
7
-
# Syntax for the XML-based Configuration Files
7
+
# Configuration Files
8
8
9
9
Notepad++ offers a comprehensive user interface to review or change most of its settings. However, there are some special cases where it is worthwhile to edit the configuration files directly, including:
10
10
11
11
* Customizing the Context Menu
12
12
* Editing previously-recorded macros, or crafting new macros manually
13
13
* Adding keywords to a language, because the new language version isn't matched yet
14
14
15
-
These files are all found in `%AppData%\notepad++\` (or, for zip-based local installations, in the notepad++ executable directory) unless otherwise noted.
15
+
The underlying XML files are all found in `%AppData%\notepad++\` (or, for zip-based local installations, in the notepad++ executable directory) unless otherwise noted.
16
16
17
17
## Editing Configuration Files
18
18
@@ -30,9 +30,24 @@ If changes are made in the Notepad++ UI to settings which are stored in configur
The context menu does not have a GUI-based editor; you just need to edit the file. As a result, the **Settings > Edit Popup Context Menu** entry exists to make it easy for you to access this config file.
36
+
37
+
All menu commands can be added to the Context Menu, including plugin commands:
38
+
39
+
* To add a built-in command, you need to provide the main menu name (as it appears in the main menu bar) as the value of the MenuEntryName attribute and the command's item name (as it appears in the menu) as the value of the MenuItemName attribute. The MenuEntryName attribute must reference an entry on the main menu bar and must be an ancestor of the MenuItemName attribute, regardless of its depth.
40
+
* To add a plugin command, you need to provide the plugin's menu item name (as it appears in the Plugins menu) as the value of the PluginEntryName attribute and the command's menu item name (as it appears in the plugin's sub-menu) as the value of the PluginCommandItemName attribute.
41
+
42
+
Note that the value you add should be in English, not in a translated language. The Shortcut Mapper will help you find the English name of plugin commands; simply switch to English localization for the raw name of built-in commands. If you wish to use IDs, they can be found in [menuCmdID.h](https://github.com/notepad-plus-plus/notepad-plus-plus/trunk/PowerEditor/src/menuCmdID.h), or can be found in your localization file.
43
+
44
+
### Grouping items into sub-menus
45
+
46
+
If you add a `FolderName="name_of_submenu"` attribute to consecutive items, they will be grouped into a sub-menu with that name. Specifying "" is the same as leaving the FolderName attribute out. Note that sub-menus do not nest - you cannot add a sub-menu to a sub-menu. Non-Latin characters are supported.
47
+
48
+
### Overriding a menu item name
49
+
50
+
If you add an `ItemNameAs="new_name_for_the_item"` attribute, the new name will be displayed instead of the standard one, which you'd get from the menu bar or its sub-menus. This is useful when the name is lengthy, as it makes the Context Menu unwieldy otherwise. Non-Latin characters are supported.
36
51
37
52
## Keyboard shortcuts: `shortcuts.xml`
38
53
@@ -77,20 +92,20 @@ Position | Name | Value format | Meaning
77
92
| | | `1` for Scintilla messages that pass a string as second parameter
78
93
| | | `2` for Notepad++ defined commands
79
94
| | | `3` for search and replace recording
80
-
2 | message | integer | `0` if type=2, otherwise use the message id.
81
-
3 | wParam | integer | Command id when type=2 or type=3, else actual first parameter of the message. Use `0` if the message or command doesn't require a wParam used.
82
-
4 | lParam | integer | `0` unless type=0 and the second parameter of the message is actually used, or scalar value used when type=3.
83
-
5 | sParam | string | `""` unless type=1 or type=3, in which case this is the string pointed by the second parameter of the message
95
+
2 | message | integer | `0` if `type=2`, otherwise use the message id
96
+
3 | wParam | integer | Command id when `type=2` or `type=3`, else actual first parameter of the message. Use `0` if the message or command doesn't require a wParam.
97
+
4 | lParam | integer | `0` unless `type=0` and the second parameter of the message is actually used, or scalar value used when `type=3`.
98
+
5 | sParam | string | `""` unless `type=1` or `type=3`, in which case this is the string pointed by the second parameter of the message.
84
99
85
100
The full list of Scintilla messages for `type=0` and `type=1`, as well as a concise documentation, can be found in [Scintilla.iface](https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/include/Scintilla.iface). More details on those messages can be found in the [Scintilla Docs](https://scintilla.org/ScintillaDoc.html).
86
101
87
102
The `wParam` command IDs for `type=1` can be found as the `IDM` constants in the source file [menuCmdID.h](https://github.com/notepad-plus-plus/notepad-plus-plus/trunk/PowerEditor/src/menuCmdID.h), or you can look at the `localization\English.xml` (or your language of choice), which lists the `<Item id="...">` next to the text of the command; the value of the `id` attribute is the "command ID".
88
103
89
-
You can use any Scintilla or Windows message that does not return a value, that passes an integer in wParam, and either an integer or string in lParam. There are some messages that require strings in the wParam, or various data structures; those will not work in a macro.
104
+
For `type=3` search-and-replace macros, see the detailed description in ["Searching > Searching actions when recorded as macros"](../searching/#searching-actions-when-recorded-as-macros).
90
105
91
-
For more on the messaging system, see [Plugin Communication](../plugin-communication/).
106
+
You can use any Scintilla or Windows message that does not return a value, that passes an integer in `wParam`, and either an integer or string in `lParam`. There are some messages that require strings in the `wParam`, or various data structures: those will not work in a macro.
92
107
93
-
For type=3 search-and-replace macros, see the detailed description in ["Searching > Searching actions when recorded as macros"](../searching/#searching-actions-when-recorded-as-macros).
108
+
For more on the messaging system, see [Plugin Communication](../plugin-communication/).
94
109
95
110
### `<UserDefinedCommands>`
96
111
@@ -110,14 +125,14 @@ Position | Name | Value format | Meaning
110
125
111
126
Although it is possible for several commands to have the same name, this is confusing and thus discouraged.
112
127
113
-
The run command is any valid command for the <abbrtitle="Operating System: Generally Windows. If you use Notepad++ in a Linux WINE environment or similar, could you create a pull request clarifying whether it's windows-style command syntax or linux-style command syntax.">Windows OS</abbr>. Thus, if you enter a URL, Windows will launch your default browser with that URL.
128
+
The run command may contain any valid command for the <abbrtitle="Operating System: Generally Windows. If you use Notepad++ in a Linux WINE environment or similar, could you create a pull request clarifying whether it's windows-style command syntax or linux-style command syntax.">Windows OS</abbr>. Thus, if you enter a URL, Windows will launch your default browser with that URL.
114
129
The commands use the same syntax and helper environment variables as explained in [TBD](#404-Not-Found"TBD: was External Programs NppWiki++ page; need to incorporate that in the new docset"). Use the concatenation characters as appropriate to have the OS execute several commands in a row.
115
130
116
131
## User Interface settings: `config.xml`
117
132
118
133
The following sections are defined:
119
134
120
-
1.`<GUIConfigs>`: user interface settings (usually set in the [**Settings > Preferences**](../preferences/#preferences).
135
+
1.`<GUIConfigs>`: user interface settings (usually set in the [**Settings > Preferences**](../preferences/#preferences)).
121
136
2.`<FindHistory>`: most of the latest state of the Find/Replace dialog box.
122
137
3.`<History>`: the list of recently used files.
123
138
3.`<ProjectPanels>`: associates workspace files with a given project panel
0 commit comments