Solution for Sublime Text 2 is here Sublime Text 2 - Open CMD prompt at current or project directory (Windows) .But this script is not working in ST3.
问问题
10421 次
1 回答
12
A simpler solution is to install SublimeREPL, there is a shell REPL. You can add keymap to your user config. However this open the shell inside Sublime.
If your prefer, the old script is still working. Instead of put them(cmd.py
& Context.sublime-menu
) in a cmd
directory, you put them under Cmd
directory, which should be capitalized.
And I simplified the script, here:
import os, sublime_plugin
class CmdCommand(sublime_plugin.TextCommand):
def run(self, edit):
path, _ = os.path.split(self.view.file_name())
os.chdir(path)
os.system('cmd')
于 2013-08-27T17:19:00.580 回答