Skip to content

Instantly share code, notes, and snippets.

@hoffstein
Created July 18, 2011 15:08
Show Gist options
  • Save hoffstein/1089794 to your computer and use it in GitHub Desktop.
Save hoffstein/1089794 to your computer and use it in GitHub Desktop.
Sublime Text 2 script to open the current file's parent directory in Windows Explorer
[
{ "keys": ["ctrl+shift+e"], "command": "open_folder_in_explorer" }
]
import sublime, sublime_plugin, os, subprocess
class OpenFolderInExplorerCommand(sublime_plugin.TextCommand):
def run(self, edit):
if self.view.file_name():
folder_name, file_name = os.path.split(self.view.file_name())
command = "explorer " + folder_name
subprocess.Popen(command)
@mplattner
Copy link

very useful, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment