Sublime Forum

Way to add a keyboard shortcut for "Reveal in Finder"

#1

Hi Guys,

You’ve already answered one question for me today so I figured I’d try my luck.

I’ve tried a few ways to bind “Reveal in Finder” to a keyboard key in Sublime 2 for Mac, no luck.

Could anyone point me in the right direction? I’ve tried the obvious places. System Pref and Keyboard Shortcuts file…

Thanks in advance!

David.

0 Likes

#2

I don’t know what “Reveal in Finder” is, but you might try this:

sublimetext.info/docs/customizat … dings.html

0 Likes

#3

I tried that. No luck. Thanks though! Appreciated. :smile:

0 Likes

#4

Actually, the functionality is sort of already there. If you have a file open in a tab and you secondary-click on the ST2 window’s title bar, you get the standard Cocoa drop-down menu listing the file, the folder it’s in, the folder that encloses it, all the way to your HD. Click on the folder containing the file, and that folder is displayed in a finder window; the current file is highlighted.

0 Likes

#5

I know. I just want to access it through a Keyboard shortcut. I’ll ultimately use Afloat if I can’t do it within Sublime 2.

Thanks.

0 Likes

#6

If you look in Default/Context.sublime-menu, you’ll be able to see all the commands used for the context menu entries. The one for “Reveal in Finder”/“Open Containing Folder” is:

{ "command": "open_dir", "args": {"dir": "$file_path", "file": "$file_name"}  }
1 Like

#7

Sweet! It works.

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

Thanks a bunch. :smile:

0 Likes

#8

Thanks for your contributions!

I know this is a extremely old thread, but I just came across this while looking for ways to add keyboard short cut to the “Show Unsaved Changes…” item in the context menu. In Sublime Text 3, most of resources are hidden in the archive, so the Default/Context.sublime-menu file is no where to be found. I’m adding this here in case someone else is looking for the same information about context menu shortcut.

To get to the file, one should install https://packagecontrol.io/packages/PackageResourceViewer and open the resource Default to find the Context.sublime-menu file. For my case, one should open the Diff resource instead.

0 Likes