Skip to content

Instantly share code, notes, and snippets.

@HereChen
Last active August 29, 2015 14:00
Show Gist options
  • Save HereChen/11201279 to your computer and use it in GitHub Desktop.
Save HereChen/11201279 to your computer and use it in GitHub Desktop.
sublime: open cmd
import os, sublime_plugin
class CmdCommand(sublime_plugin.TextCommand):
def run(self, edit):
file_name=self.view.file_name()
path=file_name.split("\\")
current_driver=path[0]
path.pop()
current_directory="\\".join(path)
command= "cd "+current_directory+" & "+current_driver+" & start cmd"
os.system(command)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment