Sublime Forum

Bookmarking files in Sublime

#1

In Emacs, the bookmark feature allows you to bookmark a file, not merely a place in a document. This is useful in terms of quickly getting back to commonly used files. Is there an equivalent functionality in Sublime Text?

0 Likes

#2

Out of the box, no; though there may be some package that implements that kind of feature. I don’t know of any offhand though. There are a couple which I think extend the internal bookmark system to persist bookmarks across file close and open, so they may have such a functionality as well.

1 Like

#3

You can just create a Main.sublime-menu file in your Packages/User folder with the following contents, replacing the file paths with your preferred bookmarks:

{
        "id": "file",
        "children":
        [
            { "caption": "-" },
            {
                "caption": "Favorites",
                "children": [
                    {
                        "command": "open_file", "args": { "file": "/home/myuser/myfile", }, "caption": "myfile"
                    },
                    {
                        "command": "open_file", "args": { "file": "/usr/share/applications/sublime_text.desktop", }, "caption": "Sublime Text Desktop File"
                    },
                ]
            }
        ]
    },
1 Like

#4

This would be a good solution. Unfortunately I could not get this code to work for me.

0 Likes

#5

oh my mistake, I copied a snippet out of my menu file, and forgot it needs to be a JSON array at the top level.
wrapping it in [ and ] should work

2 Likes

#6

That’s awesome! Thanks so much!

0 Likes