我正在寻找一种解决方案,以便能够右键单击 Windows 上 Sublime Text 2 侧栏中的任何文件夹,然后选择“使用 Git Bash 打开”,以便 Git Bash 打开该文件夹,准备就绪用于我的 git 命令。
我已经尝试使用 Side Bar Enhancements 插件打开方式功能,但没有成功。
哦,我试过 ST2 的“Git”插件。这不是我需要的。
最佳答案
这对我在 Windows 7 上有效
在 Packages/User
下创建以下文件
git_bash.py
import sublime
import sublime_plugin
class GitBashCommand(sublime_plugin.WindowCommand):
def run(self, **args):
dir = args["dirs"][0]
self.window.run_command("exec", {"cmd": ["start", "sh", "--login", "-i"], "shell": True, "working_dir": dir})
self.window.run_command("hide_panel", {"panel": "output.exec"})
def is_visible(self, **args):
return len(args["dirs"]) > 0
Side Bar.sublime-menu
[
{ "caption": "Git bash...", "command": "git_bash", "args": { "dirs": []} }
]
确保在 Windows PATH 中添加可用的 Git Bash bin 文件夹,在 Windows 8 上默认为 ;C:\Program Files (x86)\Git\bin\
http://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/
关于sublimetext2 - 在 Windows 上使用 Sublime Text 2 在 Git Bash 中打开文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17085438/