Skip to content

Instantly share code, notes, and snippets.

@dotenorio
Last active January 4, 2018 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dotenorio/b939e77bb568b45f6fba8b2d5e9fa594 to your computer and use it in GitHub Desktop.
Save dotenorio/b939e77bb568b45f6fba8b2d5e9fa594 to your computer and use it in GitHub Desktop.
# Put the 2 files below on C:\Users\your_user\AppData\Roaming\Sublime Text 3\Packages
# FILE #1 ~> cmd.py
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)
# FILE #2 ~> Context.sublime-menu
[
{ "command": "cmd" }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment