Sublime Forum

Open Containing Folder

#1

Long time Visual Studio user, just switched to ST.

A small but useful feature in VS is the ability to right-click an open tab and there’s a “Open Containing Folder” option in the context menu.

Useful for file operations, copying and pasting, etc.

0 Likes

#2

You just clicked a little bit too high :wink:
Right-click on the editor itself…

0 Likes

#3

Even though you can right-click the editor, it’s still nice to have it in the tabs’ right click menu also.
That way you don’t need to click on a tab in order to visit the folder.

0 Likes

#4

As an alternative, you could add something like this to your user keybindings file

{ “keys”: “ctrl+shift+super+f”], “command”: “open_dir”, “args”: {“dir”: “$file_path”, “file”: “$file_name”} },

Cheers,
Mick

0 Likes

#5

By default the editor has this item in context menu. If you need this feature on tabs you have to create a file with name “Tab Context.sublime-menu” in “<path to sublime text 3>\Data\Packages\User” (if does not exist yet) and add this code:

[
    {
        "caption": "-"
    },
    {
        "command": "open_dir",
        "args": {"dir": "$file_path", "file": "$file_name"},
        "caption": "Open Containing Folder…"
    }
]

If you do not need a separator before this menu item you need to delete first block with caption “-”! You can add any other menu in this file. For example:

{
    "command": "copy_path",
    "caption": "Copy File Path"
},

Do not forget formatting lines as a JSON file!

Cheers,
Tsabeee

2 Likes