Skip to content

Instantly share code, notes, and snippets.

@yovchev
Created November 12, 2016 15:48
Show Gist options
  • Save yovchev/d561ca3a93f5fc66349778932d099fde to your computer and use it in GitHub Desktop.
Save yovchev/d561ca3a93f5fc66349778932d099fde to your computer and use it in GitHub Desktop.
CMD Sublime Text 3 Package
# -*- coding: utf-8 -*-
"""CMD Sublime Text 3 Package.
Open `cmd` from the curent locaion of the file.
Installation: Preferences -> Browser Packages, Create folder `CMD` and inside
copy the files from this Gist
"""
import os
import sublime_plugin
class CmdCommand(sublime_plugin.TextCommand):
"""Register the command with sublime plugin syste,."""
def run(self, edit):
"""When the user clicks on the command."""
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)
[
{ "command": "cmd" }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment