Configuration Files
From notepad-plus
m |
(→8 optional xml files:: 5.9.8) |
||
| (24 intermediate revisions not shown) | |||
| Line 1: | Line 1: | ||
| - | {{New | + | {{New Article|Notepad++'s configuration files}} |
=== 3 mandatory xml files: === | === 3 mandatory xml files: === | ||
| Line 10: | Line 10: | ||
: all the syntax highlighting (colours, fonts, etc...) are saved in this file. | : all the syntax highlighting (colours, fonts, etc...) are saved in this file. | ||
| - | === | + | === 8 optional xml files: === |
;<tt>contextMenu.xml</tt> | ;<tt>contextMenu.xml</tt> | ||
| - | : the configure file of Notepad++ context menu. See [[Context Menu | + | : the configure file of Notepad++ context menu. See [[Context Menu]] for more detail information. |
;<tt>session.xml</tt> | ;<tt>session.xml</tt> | ||
: the file which contains the list of full file path name of previous session. | : the file which contains the list of full file path name of previous session. | ||
| - | :* In addition, you may have saved specific session files in order to load specific sets of files. This is how to | + | :* In addition, you may have saved specific session files in order to load specific sets of files. This is how to do [[Project Management]] in Notepad++. |
;<tt>shortcuts.xml</tt> | ;<tt>shortcuts.xml</tt> | ||
| - | : this file | + | : this file contains all the recorded macro, user defined commands and remapped shortcuts information. |
;<tt>userDefineLang.xml</tt> | ;<tt>userDefineLang.xml</tt> | ||
| - | : this file contains all the definitions for user defined languages to be highlighted (see [[ | + | : this file contains all the definitions for user defined languages to be highlighted (see [[User Defined Languages]]). |
;<tt>doLocalConf.xml</tt> | ;<tt>doLocalConf.xml</tt> | ||
: a zero length file which is use to determinate where Notepad++ loads the xml files. | : a zero length file which is use to determinate where Notepad++ loads the xml files. | ||
When it looks like a setting is lost, a common cause is that there are two sets | When it looks like a setting is lost, a common cause is that there are two sets | ||
| - | of files, one in the %APPDATA% folder and one alongside Notepad++.exe. Then | + | of files, one in the %APPDATA%\Notepad++ folder and one alongside Notepad++.exe. Then |
either N++ doesn't read the right file, or the setting was saved into the wrong file. | either N++ doesn't read the right file, or the setting was saved into the wrong file. | ||
| + | ;<tt>allowAppDataPlugins.xml</tt> | ||
| + | : a zero length file which, if present, will allow plugins installed in %APPDATA\Notepad++\plugins to be loaded as well as "local" plugins. This behaviour is configurable from the last install wizard page. And it is as easy to change as deleting/creating a file. | ||
;<tt>asNotepad.xml</tt> | ;<tt>asNotepad.xml</tt> | ||
: a zero length file which is use to make Notepad++ behaviour similar to MS Notepad (ie. always open a file in a new instance with single document interface). | : a zero length file which is use to make Notepad++ behaviour similar to MS Notepad (ie. always open a file in a new instance with single document interface). | ||
;<tt>toolbarIcons.xml</tt> | ;<tt>toolbarIcons.xml</tt> | ||
: this file will enable you to customise the icons on your toolbar - but not the set of buttons. See [[Toolbar Customisation]] for more on this topic. | : this file will enable you to customise the icons on your toolbar - but not the set of buttons. See [[Toolbar Customisation]] for more on this topic. | ||
| + | ; <tt>nativeLang.xml</tt> | ||
| + | : When using a localization from {{shSP1|Global}}, the corresponding file from the <tt>Localizations</tt> subfolder is copied to <tt>nativeLang.xml</tt> and elements of the user interface are being translated. The localization files are described in [[Localisation]]. | ||
| - | Those xml files (except | + | Those xml files (except doLocalConf.xml and asNotepad.xml which should be always in [[Notepad++ Install Folder]], and langs.xml, which must be in <tt>%APPDATA%\Notepad++\</tt> under Windows Vista or 7) are loaded from %AppData%\Notepad++ or Notepad++.exe's own folder, it depends respectively on the absence or presence of doLocalConf.xml in Notepad++.exe's folder. |
=== Factory defaults === | === Factory defaults === | ||
In case any of the 3 mandatory files is missing, Notepad++ will try to replace it with its *.model.xml equivalent if available. These files should reside in the same directory as their counterparts, and are only used as backup and on the first run after a clean installation (an upgrade will preserve the original files) | In case any of the 3 mandatory files is missing, Notepad++ will try to replace it with its *.model.xml equivalent if available. These files should reside in the same directory as their counterparts, and are only used as backup and on the first run after a clean installation (an upgrade will preserve the original files) | ||
| + | |||
| + | === Syntax highlighting themes === | ||
| + | |||
| + | From version 5.3, Notepad++ provides theme files, which are selectable from the Styler Configurator dialog and are alternates for <tt>stylers.xml</tt>. You can freely add new or remove existing highlight theme files from the <tt>Themes\</tt> subfolder. While the list of available theme files is loaded at startup, you can add to it using the {{shMenu|Settings|Import -> Import theme}} feature, in version 5.5 and higher. | ||
=== Other configuration files === | === Other configuration files === | ||
| - | For various languages, the autocompletion facility | + | For various languages, the autocompletion facility requires xml files. You can find many of them in <tt><Notepad++ folder>\Plugins\APIs</tt>. You can always tailor them to your liking, or add some for user defined languages - but only one for each language, and bearing the same name. |
=== Modifying configuration files === | === Modifying configuration files === | ||
| - | + | Generally speaking, the configuration files of an application are managed by this application, and are not supposed to be manually edited in general. Bu sometimes it is useful or needed. | |
| - | + | Because Notepad++ updates some of its configuration files on normal program termination, manual editing of a Notepad++ configuration file requires both specific procedures and good knowledge of the files' layout. It is strongly advised to read [[Configuration File Editing| about how to edit configuration files]] and [[Editing Configuration Files| the knowledge base for file layouts]]. | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
=== Configuration files and Notepad++ upgrades === | === Configuration files and Notepad++ upgrades === | ||
| - | The installer for newer versions of Notepad++ | + | The installer for newer versions of Notepad++ doesn't touch <tt>langs.xml</tt> nor <tt>stylers.xml</tt>. It backs up <tt>contextMenu.xml</tt> and merges <tt>shortcuts.xml</tt> since v5.4.1. |
| - | + | When upgrading from a zipped package, you choose which files to copy. As a result, you may be tempted to leave files you changed alone, but then some new feature of the upgraded version might not work fully. | |
| - | + | ||
| - | + | ||
| - | + | The ultimate solution would be to run a reverse patch from your actual configuration files, and then patch the new configuration files. Not exactly user friendly. | |
| - | + | ||
| - | The ultimate solution would be to run a reverse patch from your actual configuration files, and then patch the new | + | |
A possibly more reasonable approach and nearly risk free approach might be this: | A possibly more reasonable approach and nearly risk free approach might be this: | ||
* Always upgrade to a new folder | * Always upgrade to a new folder | ||
* Try comparing the new configuration files with the ones you have. It is expected that you can tell the modifications you made from those you didn't (which are part of the upgrade). | * Try comparing the new configuration files with the ones you have. It is expected that you can tell the modifications you made from those you didn't (which are part of the upgrade). | ||
| - | * The next step is [[ | + | * The next step is [[Editing Configuration Files]] to bring your changes inside the new configuration. |
* Don't forget copying your plugin folder. | * Don't forget copying your plugin folder. | ||
* Finally, if the Notepad++ folder name matters, delete or rename your old folder, and give the appropriate name to your now current Notepad++ folder. | * Finally, if the Notepad++ folder name matters, delete or rename your old folder, and give the appropriate name to your now current Notepad++ folder. | ||
| - | |||
| - | |||
| Line 84: | Line 75: | ||
[[Category:Integration]] | [[Category:Integration]] | ||
[[Category:User Defined Languages]] | [[Category:User Defined Languages]] | ||
| + | [[Category:Usage(Basic Editing)]] | ||
| + | [[Category:Usage(Advanced Editing)]] | ||
Current revision as of 15:56, 29 January 2012
Contents |
3 mandatory xml files:
- config.xml
- the GUI and MISC settings are stored in this file.
- langs.xml
- all the keywords of supported languages to be highlighted are in this file.
- stylers.xml
- all the syntax highlighting (colours, fonts, etc...) are saved in this file.
8 optional xml files:
- contextMenu.xml
- the configure file of Notepad++ context menu. See Context Menu for more detail information.
- session.xml
- the file which contains the list of full file path name of previous session.
- In addition, you may have saved specific session files in order to load specific sets of files. This is how to do Project Management in Notepad++.
- shortcuts.xml
- this file contains all the recorded macro, user defined commands and remapped shortcuts information.
- userDefineLang.xml
- this file contains all the definitions for user defined languages to be highlighted (see User Defined Languages).
- doLocalConf.xml
- a zero length file which is use to determinate where Notepad++ loads the xml files.
When it looks like a setting is lost, a common cause is that there are two sets of files, one in the %APPDATA%\Notepad++ folder and one alongside Notepad++.exe. Then either N++ doesn't read the right file, or the setting was saved into the wrong file.
- allowAppDataPlugins.xml
- a zero length file which, if present, will allow plugins installed in %APPDATA\Notepad++\plugins to be loaded as well as "local" plugins. This behaviour is configurable from the last install wizard page. And it is as easy to change as deleting/creating a file.
- asNotepad.xml
- a zero length file which is use to make Notepad++ behaviour similar to MS Notepad (ie. always open a file in a new instance with single document interface).
- toolbarIcons.xml
- this file will enable you to customise the icons on your toolbar - but not the set of buttons. See Toolbar Customisation for more on this topic.
- nativeLang.xml
- When using a localization from Settings -> Preferences -> Global, the corresponding file from the Localizations subfolder is copied to nativeLang.xml and elements of the user interface are being translated. The localization files are described in Localisation.
Those xml files (except doLocalConf.xml and asNotepad.xml which should be always in Notepad++ Install Folder, and langs.xml, which must be in %APPDATA%\Notepad++\ under Windows Vista or 7) are loaded from %AppData%\Notepad++ or Notepad++.exe's own folder, it depends respectively on the absence or presence of doLocalConf.xml in Notepad++.exe's folder.
Factory defaults
In case any of the 3 mandatory files is missing, Notepad++ will try to replace it with its *.model.xml equivalent if available. These files should reside in the same directory as their counterparts, and are only used as backup and on the first run after a clean installation (an upgrade will preserve the original files)
Syntax highlighting themes
From version 5.3, Notepad++ provides theme files, which are selectable from the Styler Configurator dialog and are alternates for stylers.xml. You can freely add new or remove existing highlight theme files from the Themes\ subfolder. While the list of available theme files is loaded at startup, you can add to it using the Settings -> Import -> Import theme feature, in version 5.5 and higher.
Other configuration files
For various languages, the autocompletion facility requires xml files. You can find many of them in <Notepad++ folder>\Plugins\APIs. You can always tailor them to your liking, or add some for user defined languages - but only one for each language, and bearing the same name.
Modifying configuration files
Generally speaking, the configuration files of an application are managed by this application, and are not supposed to be manually edited in general. Bu sometimes it is useful or needed.
Because Notepad++ updates some of its configuration files on normal program termination, manual editing of a Notepad++ configuration file requires both specific procedures and good knowledge of the files' layout. It is strongly advised to read about how to edit configuration files and the knowledge base for file layouts.
Configuration files and Notepad++ upgrades
The installer for newer versions of Notepad++ doesn't touch langs.xml nor stylers.xml. It backs up contextMenu.xml and merges shortcuts.xml since v5.4.1.
When upgrading from a zipped package, you choose which files to copy. As a result, you may be tempted to leave files you changed alone, but then some new feature of the upgraded version might not work fully.
The ultimate solution would be to run a reverse patch from your actual configuration files, and then patch the new configuration files. Not exactly user friendly.
A possibly more reasonable approach and nearly risk free approach might be this:
- Always upgrade to a new folder
- Try comparing the new configuration files with the ones you have. It is expected that you can tell the modifications you made from those you didn't (which are part of the upgrade).
- The next step is Editing Configuration Files to bring your changes inside the new configuration.
- Don't forget copying your plugin folder.
- Finally, if the Notepad++ folder name matters, delete or rename your old folder, and give the appropriate name to your now current Notepad++ folder.
