我正在寻找一个解决方案,能够右键单击侧栏中的任何文件夹,在Windows上的Sublime Text 2,并选择"使用Git Bash打开",以便Git Bash打开该文件夹,为我的git做好准备命令.
我已尝试使用Side Bar Enhancements插件的Open With功能,但没有运气.
哦,我已经尝试过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
Run Code Online (Sandbox Code Playgroud)
Side Bar.sublime-menu
[
{ "caption": "Git bash...", "command": "git_bash", "args": { "dirs": []} }
]
Run Code Online (Sandbox Code Playgroud)
确保在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/
| 归档时间: |
|
| 查看次数: |
2594 次 |
| 最近记录: |