3. Markers and Bookmarks

Markers and Bookmarks provide some interesting editing facilities that make certain types of editing tasks more efficient.

3.1. Markers

Todo

fill in

3.2. Bookmarks

Todo

fill in

3.3. MarkerStack

MarkerStack is a package for Sublime Text that enables you to efficiently manage temporary moves away from your current editing position in Sublime Text 4050 and onward by:

  • pushing a “Marker” (position in text) onto a “Marker Stack”, with

  • the ability to come back to that point later by popping it off the Marker Stack.

When a Marker is pushed, a symbol appears in the left gutter showing what line it is on. The gutter icon changes to a “multiple Marker” icon when there is more than one Marker on the same line. The marker moves with the text when text is inserted or deleted before it. MarkerStack state is “remembered” until the View is closed, or until all Markers are popped off the stack, whichever comes first.

3.3.1. The Problem MarkerStack Solves

There are many kinds of editing interruptions that happen regularly for most people using a text editor. Examples:

  • go elsewhere in a file to look up something and/or copy it to the clipboard, so that it can be pasted where you are editing;

  • handle a change required elsewhere in the file before you forget it (e.g. a typo you just found and you know it occurred in several other places);

  • you get interrupted and need to move your cursor away from where you are editing in order to handle the interruption.

With MarkerStack, you can PUSH your cursor (caret) position in a Sublime Text View with one keystroke, go do something elsewhere in the same file, and then POP your cursor position with another keystroke, to instantly be back where you left off, without having to remember where it is.

Marker Stack data is saved across Sublime Text sessions, for those occasions when handling an interruption might span across Sublime Text sessions.

It is designed for efficiently managing temporary moves away from your current editing position in the text.

For additional details, see the README.md and module header comment in markerstack.py file in the Package.

3.3.2. Why MarkerStack is Better than Bookmarks for Interruptions

Using Sublime Text Bookmarks is a handy way to navigate repeatedly to different places in a file you are working on, but it leaves a gap of functionality that writers, editors and coders sometimes need for temporary moves away from the part of the file being viewed or edited.

Using MarkerStack is significantly more efficient than setting a Bookmark for interruptions such as the above, and doesn’t leave you with the task of

  • cleaning up unused bookmarks, or

  • remembering where you were previously in the file.

To illustrate, let’s say you are typing in one paragraph (or block of code) and your train of thought (or a phone call) makes you realize that there is something else in the file that needs to be updated, and you want to do that quickly before you forget, and then come back to continue what you were doing before. You can sort of “manage” that with Bookmarks, but Bookmarks were not designed to handle that scenario efficiently. MarkerStack is.