Created
July 18, 2011 15:08
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["ctrl+shift+e"], "command": "open_folder_in_explorer" } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
very useful, thanks!