This article will guide you to use a Notepad++ plugin to list bookmarks and save them, but before that let’s also see how to do it without a plugin.
By default Notepad++ bookmarks are not saved along with the file. If you create bookmarks, close and reopen the file then all the bookmarks that you have created will be lost.
Have you ever closed the Notepad++ application and launched it back to see the file that you had forgotten to close is still there?
Notepad++ achieves this with the help of sessions. Sessions are enabled by default, if not then you can enable it by navigating to Settings Menu, Preferences, under MISC. Tab enable the Remember current session for next launch check-box.
You can use the same session concept to retain your bookmarks too. Let’s see how to do it.
Retain Bookmarks Using Session
- Create a new file (or open an existing one) and put some text in it.
- Now place some bookmarks (CTRL + F2) wherever you want in the file.
- Now if you close the file all your bookmarks will be lost, so before closing the file Go to File Menu and click on Save Session. You will be asked to save the session file, save it in the same folder where you have the text file so that it’s easier for you to open it later.
- Now you can close the text file.
- Again when you want to open the text file along with the bookmarks, click on Load Session from the File Menu and select the session file you had saved earlier. Your bookmarks should also be loaded along with the file.
There are some caveats in this approach:
- If you rename or move the text file and try to load the session, nothing will happen. To understand why it wont work, you should try opening the session file in Notepad++ and examine the contents.
As you can see above, the file name attribute in the session file actually points to the actual file path, hence when you move the original file and open the session file your bookmarks are no longer available.
- If you have more number of bookmarks then there is no way to name them individually for quick access. You have to manually iterate through the bookmarks (F2) one by one.
‘Named Bookmarks’ Notepad++ Plugin to List Bookmarks
Named Bookmarks Plugin is actually used to add bookmarks for programming files but we can use the same for normal text files too. Let’s see how to do that.
- First we have to add the plugin to Notepad++. Go to Plugins Menu, Plugin Manager and click Show Plugin Manager.
- Select the Named bookmark plugin and click on install button.
- Once the plugin is installed, Notepad++ will be restarted.
- Though I can perfectly understand that you may just have text file, go to Language Menu, click H and select HTML.
- Now go to Plugins Menu, you will see Named bookmarks item. Click on Create a new named bookmark (ALT + SHIFT + B)
- Now to navigate to any of the bookmarks created you have to just click on Move to named bookmark (CTRL + SHIFT + B) under Named bookmarks. You can also create a bookmark directly by adding the tag <!–@NPPBookmarkbn–> where bn is Bookmark name.
When you close and re-open the file do not forget to switch the language to use this functionality.
These are the two known ways to save and access Notepad++ Bookmarks as of now, got something better? Do Share it with us.