Skip to content

Commit

Permalink
Fix session.xml description throughout.
Browse files Browse the repository at this point in the history
- Correct misinformation (the other-config-files section incorrectly said it was always in the installation directory)
- Clarify its confusing nature (since it ignores the cloud setting, but follows the per-user rules otherwise)
  • Loading branch information
pryrt committed Jan 26, 2024
1 parent 9cdb4e9 commit 8df4922
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions content/docs/config-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Please note that Notepad++ writes the configuration files when it exits, which i

## Configuration Files Location

In a standard installation, the per-user configuration files go in `%AppData%\Notepad++\`. (For a refresher course on `%AppData%`, see the [Community Forum FAQ's `%AppData%` entry](https://community.notepad-plus-plus.org/topic/15740/faq-desk-what-is-appdata).) The machine-wide configuration files go in the executable directory (so usually `c:\program files\notepad++\`). When Notepad++ is looking for [shortcuts](#keyboard-shortcuts-shortcuts-xml), [stylers and themes](#highlighting-schemes-stylers-xml), [function list](#function-list) definitions, and [user defined language](#other-configuration-files:~:text=Configuration%20location%20for%20the%20User%20Defined%20Languages%20feature) definitions, it will try to read from the per-user directory; if the right file isn't found there, then it will check machine-wide configuration files.
In a standard installation, the per-user configuration files go in `%AppData%\Notepad++\`. (For a refresher course on `%AppData%`, see the [Community Forum FAQ's `%AppData%` entry](https://community.notepad-plus-plus.org/topic/15740/faq-desk-what-is-appdata).) The machine-wide configuration files go in the executable directory (so usually `c:\program files\notepad++\`). When Notepad++ is looking for [shortcuts](#keyboard-shortcuts-shortcuts-xml), [stylers and themes](#highlighting-schemes-stylers-xml), [function list](#function-list) definitions, and [user defined language](#other-configuration-files:~:text=Configuration%20location%20for%20the%20User%20Defined%20Languages%20feature) definitions (and usually the [default session file](https://npp-user-manual.org/docs/config-files/#other-configuration-files:~:text=session.xml%3A%20Stores%20the%20current%20session%20information), though that has exceptions enumerated below), it will try to read from the per-user directory; if the right file isn't found there, then it will check machine-wide configuration files.

In a portable installation, the configuration files all go in the same directory as the `notepad++.exe` executable (or the appropriate subdirectory), and there is no per-user configuration location. (An installation is treated as "portable" if the zero-byte `doLocalConf.xml` file is present alongside the `notepad++.exe` executable. The **?** menu's **Debug Info** will show `Local mode: ON` for a portable version.)

If you enable the [Cloud settings](../preferences/#cloud), some per-user configuration files will go in the defined directory (including `contextMenu.xml`, `shortcuts.xml`, `userDefineLang.xml`, `langs.xml`, `stylers.xml`, and `config.xml`; the `userDefineLang\` subfolder can be placed there as well, though it won't be created by default when the Cloud settings folder is first populated).
If you enable the [Cloud settings](../preferences/#cloud), some per-user configuration files will go in the defined directory, including `contextMenu.xml`, `shortcuts.xml`, `userDefineLang.xml`, `langs.xml`, `stylers.xml`, and `config.xml`; the `userDefineLang\` subfolder can be placed there as well, though it won't be created by default when the Cloud settings folder is first populated. It should be emphasized that `session.xml` does _not_ work in the cloud folder, so if you have the cloud settings, `session.xml` will still be found in either the `%AppData%` hierarchy for a normal installation, or in the installed directory for a portable installation.

There is a [command-line option](../command-prompt/) `-settingsDir` which will set a new directory for the per-user configuration file location.
There is a [command-line option](../command-prompt/) `-settingsDir` which will set a new directory for the per-user configuration file location. (Unlike the cloud directory, `session.xml` does work in the `-settingsDir` directory, so if you want to have all your per-user configuration, including your session information, in your cloud folder, it might be wise to not use the Cloud settings option, and instead point `-settingsDir` to the cloud folder.)

**Search order**: If the `-settingsDir` option is set, that configuration file directory will take priority over any other configuration file directory. If the Cloud directory setting is defined and enabled, that will take priority over the portable or standard configuration file directory. If `doLocalConf.xml` is present, the portable configuration file location will take priority over the `%AppData%\Notepad++\` directory. If none of the other configuration file directories are active, then the standard configuration file directory is `%AppData%\Notepad++\`. If it cannot find a configuration file in any of the per-user locations, it will use the version from the same directory as the executable.

Expand Down Expand Up @@ -433,7 +433,7 @@ You can have multiple icon set directories; to switch between icon sets, you jus
- If the errors occur, there should be some trace in "C:\temp\nppLogNetworkDriveIssue.log".
- This log can be shared with the developers to help them improve Notepad++'s network handling (create an issue [here](https://github.com/notepad-plus-plus/notepad-plus-plus/issues) and attach the logfile along with your other details).

- `session.xml`: Stores the current [session](../session/) information. Overwritten on every exit of Notepad++ if [**Settings > Preferences > Backup > Remember current session for next launch**](../preferences/#backup) is enabled. If you want sessions that you control, use **File > Save Session...** to save it; the file is safe to edit; and you can reload that session at any time using **File > Load Session...**. This config file _must_ go in the Notepad++ installation folder; it will not be recognized in the `%AppData%\Notepad++` hierarchy or in the cloud settings folder.
- `session.xml`: Stores the current [session](../session/) information. Overwritten on every exit of Notepad++ if [**Settings > Preferences > Backup > Remember current session for next launch**](../preferences/#backup) is enabled. If you want sessions that you control, use **File > Save Session...** to save it; the file is safe to edit; and you can reload that session at any time using **File > Load Session...**. This config file is confusing for its location: a normal installation will keep it in `%AppData%\Notepad++\`; and the `-settingsDir` will specify the folder where it will live; a portable installation (one with `doLocalConf.xml`) will keep `session.xml` in the same directory as `notepad++.exe`; but if you use the [Cloud settings](../preferences/#cloud), `session.xml` will _not_ honor that directory, and will instead go in either the AppData or the portable location.

- `userDefineLang.xml` and `userDefineLangs\*.xml`: Configuration location for the [**User Defined Languages**](../user-defined-language-system/) feature.

Expand Down

0 comments on commit 8df4922

Please sign in to comment.