1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Configuration Files

From notepad-plus

(Difference between revisions)
Jump to: navigation, search
(Other configuration files)
(8 optional xml files:: 5.9.8)
 
(31 intermediate revisions not shown)
Line 1: Line 1:
 +
{{New Article|Notepad++'s configuration files}}
 +
=== 3 mandatory xml files: ===
=== 3 mandatory xml files: ===
Line 8: 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.
-
=== 7 optional xml files: ===
+
=== 8 optional xml files: ===
;<tt>contextMenu.xml</tt>
;<tt>contextMenu.xml</tt>
-
: the configure file of Notepad++ context menu. See [[Context Menu Howto]] for more detail information.
+
: 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 manage projects in Notepad++.  
+
:* 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 cotains all the recorded macro, user defined commands and remapped shortcuts information.
+
: 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 [[Creating User Defined Languages]]).
+
: 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 [[Customizing the toolbar]] 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 langs.xml , doLocalConf.xml and asNotepad.xml which should be always in Notepad++'s installed folder) are loaded from %AppData%\Notepad++ or Notepad++'s installed folder, it depends respectively on the absence or presence of doLocalConf.xml in Notepad++'s installed folder.
+
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 requiresxml files. You can find many of them in <tt>&lt;Notepad++ folder>\Plugins\APIs</tt>. You can always tailot yhem to your liking, or add some for user defined languages - but only one for each language, and bearing the same name.
+
For various languages, the autocompletion facility requires xml files. You can find many of them in <tt>&lt;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 ===
-
Notepad++ reads its configuration files only once, when it starts. Because you might use some of Notepad++ dialogs to modify them, it overwrites them on exit. So, if you edit config files in Notepad++ without special precautions, your work will be dutifully overwritten.
+
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 ===
 +
 
 +
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.
 +
 
 +
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.
-
Yhere are three workarounds:
 
-
* Use a different editor while Notepad++ is closed.
 
-
* Copy the files to some location Notepad++ doesn't know about, edit, close Notepad++ and replace the old configuration files with the copies you just updated.
 
-
* You can also edit in-place:
 
-
** Do the required editing with Notepad++
 
-
** Save the files
 
-
** Mark them as read-only, using the command from the Edit menu
 
-
** Close Notepad++
 
-
** Reopenit. If your session is not being remembered, reopen the edited configuration files
 
-
** Clear the read-only flag for them.
 
[[Category:Settings]]
[[Category:Settings]]
Line 58: 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

Notepad++'s configuration files


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.
Personal tools
INVISIBLE