Installation
Use the Notepad++ Plugin Manager for easy installation or upgrade of Session Manager. New releases of Session Manager may be available here before they are available in the Plugin Manager. In that case use the following manual installation/upgrade procedure.
- Download the Session Manager plugin archive file.
- Exit Notepad++.
- Extract the archive file (with subfolders) into the Notepad++ plugins folder.
- Start Notepad++.
- Open the Settings dialog (alt+p,s,t) and configure Session Manager as you wish.
That completes the manual installation/upgrade procedure, but please note...
Session Manager will create its configuration files, if they do not already exist, in the plugin configuration folder reported by Notepad++. You must configure Notepad++ to use one of the following locations.
- %APPDATA%\Notepad++\plugins\config
- <NPP-INSTALLATION-FOLDER>\plugins\config
By default Notepad++ will use #1. If you prefer it to use #2 then create an empty file, named doLocalConf.xml, in the Notepad++ installation folder.
Basic Concepts
- Session: A Notepad++ session consists of the pathnames of all the currently open files, their containing view, their tab order, their language setting, their cursor position, and more. This information is stored in an XML file and is referred to as a session file.
- Selected: The selected session is the one that is highlighted in the Sessions list of the Session Manager dialog.
- Current: The current session is the active session – the one most recently loaded from the Sessions list.
- Default: When there is no current session a default session is used. It is located in the Session Manager configuration folder.
- Loading: In general when loading a session, the current session will be saved then all its files closed. The selected sessions' files will be opened and it then becomes the current session. See below for options that affect how a session is loaded.
- Saving: Saving a session means saving information about the currently open files in a session file. Saving a session does not save the session's open files.
Session Manager Plugin Menu
Configure your own shortcuts for Session Manager plugin menu items with the Notepad++ Shortcut Mapper. The default menu shortcuts are shown below.
- Sessions (alt+p,s,s): Opens the Session Manager dialog.
- Settings (alt+p,s,t): Opens the Session Manager Settings dialog.
- Save (alt+p,s,v): Saves the current (or default) session.
- Help (alt+p,s,h): Opens this HTML help file in your default web browser.
- About (alt+p,s,a): Displays Session Manager version and other information.
Session Manager Dialog
Load: To load a session double-click a session name in the list, or select it then click the Load button. It then becomes the current session.
Default: Load the default session.
The following options affect how a session is loaded with either the Load or Default buttons. They provide for the combining of sessions.
- Load into the current session: If this option is enabled the selected session will be loaded but it will not become the current session, although its files will be closed unless you enable the next option:
- Load without closing open files: If this option is enabled the currently opened files will not be closed before the selected session is loaded. This option is enabled automatically when the above option is enabled.
Save: Save the current (or default) session.
New: Creating a new session does not load the new session – it creates it, adds it to the list and selects it. You can then load it if you wish. There are three options for creating a new session.
- As an empty session: Create a new, empty session. Note that an empty session contains no files, however Notepad++ always has at least one editor tab open. In this case it is a new buffer which has not yet been saved to a file. After opening other files you can simply close the new buffer if you do not need it.
- From the currently open files: Create a new session containing the currently open files.
- By copying the selected session: Create a new session by copying the selected session.
Rename: Rename the selected session.
Delete: Delete the selected session. This does not delete the session's files – only the session file itself, and it will be removed from the list. You will be asked for confirmation before the deletion.
Cancel: Press the ESCape key, or click the Cancel button, to close the Session Manager dialog.
The Session Manager dialog is sizable. Drag one of the corners or sides of the dialog to resize it.
Session Manager Settings Dialog
Click the OK button to save and activate your changes. Press the ESCape key, or click the Cancel button, to cancel your changes and close the Settings dialog.
The Settings dialog is sizable. Drag one of the corners or sides of the dialog to resize it.
Tips & Ideas
Here are some tips and ideas for utilizing Session Manager.
- Shortcuts: Get in the habit of using the keyboard shortcuts, instead of the mouse, to open Session Manager dialogs. Open the Sessions dialog with alt+p,s,s. Open the Settings dialog with alt+p,s,t. Or, assign your own shortcuts with the Notepad++ Shortcut Mapper.
- Favorites: Make a session containing the favorite file(s). Any time you need those files just click "Load into the current session" then load that session.
- Categories: The Sessions list is sorted alphabetically, so name your sessions with categorized prefixes or suffixes. This will group related sessions together in the list. For example, I prefix my "favorites" sessions with an underscore because I want those to appear at the top of the list. I have many web-related projects and I prefix those session names with "www_". An example of using a suffix is: "my-project_trunk", "my-project_rev-123", etc. That keeps them grouped together in the list.
- Large Projects: Sometimes I'll have a large project and end up creating many different sessions for it. Usually it's the type of project that may last for a relatively long time, but after the project is finished I don't want all those sessions cluttering the Sessions list – but I also may not want to delete all of them. Here's how Session Manager can help in this situation: use different session folders, and/or file name extensions. Using a different session file name extension works quite well. It keeps all session files in one folder and then the extension acts as a filter for what sessions are displayed in the Sessions list. Also, a different default session is created for each different extension. Changing the extension back to the default is easy – just leave the extension field blank, at the Settings dialog, and the default will be used.
- Usage Scenarios: The default session is a new feature and is still experimental. It has made me consider two different fundamental ways of using Session Manager.
- Enable Auto Load so that some session is always current. Loaded sessions become current and change to always reflect the latest changes to that session. This scenario does not use the default session.
- Disable Auto Load, enable Enable 'Load into current' and enable Disable 'Load without closing'. In this scenario the default session is always current. When other sessions are loaded they are loaded into the default session. Other sessions do not change but always contain the same files, and the default session always represents the most recent editing session.
- Of course, the above scenarios are not necessarily mutually exclusive. You can utilize a combination of both by manually enabling/disabling the relevant options.
Known Issues
- Reference user bug reports regarding "strange characters in names", posts 8, 12 and 15, at the forum.
Your feedback is very welcome!
There is an ongoing discussion at sourceforge, join us!
A very special thank you! to those who are testing and providing excellent feedback at the forum.
Revision History
0.4, 29Nov2011
- Changed Sessions and Settings dialogs to have TOOLWINDOW style.
- Bugfix: When the Sessions listbox was displayed the focused item and selected item were not always the same.
- Added getLbIdxByData and dbgBox in Util.cpp.
- Added enableLIC and disableLWC to DEFAULT_INI_CONTENTS.
- Commented-out saving of current session on NPPN_DOCORDERCHANGED - this event never occurs?
- Moved definition of unicode constants from System.h to Makefile.
0.3, 03Oct2011
- The 0.2 source archive did not include the build files. They are included now.
- Session template files are no longer used.
- Previously, upgrading Session Manager would cause the existing configuration files to be over-written. Now that does not happen. Session Manager creates default configuration files only if they do not already exist.
- Session Manager now uses a default session (located in the config folder) if there is no current session. The default session can be loaded by clicking the newly added Default button on the Sessions dialog.
- A Save button has been added to the Sessions dialog. It saves the current (or default) session.
- Sessions are auto-saved on two additional NPP events: NPPN_LANGCHANGED and NPPN_DOCORDERCHANGED.
- The second option for creating a new session has changed to "From the currently open files", which basically is a session "save as" feature.
- Previously if you opened files by passing them on the Notepad++ command line and Auto Load was enabled then Session Manager would close the file(s) Notepad++ had just opened (passed on the command line). This has been corrected. Now Session Manager will not close open files when auto-loading.
- Increased the initial width of the Settings dialog. Removed all debug properties except one, named "debug". Added two more boolean properties: enableLIC and disableLWC.
- Add a trailing slash, if needed, to the user-entered session folder. Add a leading dot, if needed, to the user-entered session file extension.
- Made general improvements to the code. Fixed a dependency-related bug in the Makefile. Made big improvements to the help file.
0.2, 24Sep2011
- Compile with /MT so the crt library is linked statically.
- Display a warning if no file name is supplied for New or Rename dialogs.
- If the config and sessions folders do not exist then create them. If config and template files are not present then default files are created.
- An empty session folder will not cause an error.
- Build with an nmake makefile. Still uses the VC++ v10 toolchain, but now is not dependent on any IDE.
- Removed saveDelay from Settings dialog, but it is still in the .ini file.
- Sessions and Settings dialogs are sizable but do not yet save user size/position.
- The session list is read from disk every time the Sessions dialog is displayed. Removed "Refresh Session List" from the menu.
0.1, 03Aug2011
- Initial release. Compiled with VC++ 2010. Tested with Notepad++ v5.9.2 on WinXP-SP3. Unicode only.