Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit 1d31729555748ecf095eac469020d7987482ea94 0 parents
@notanumber authored
Showing with 56 additions and 0 deletions.
  1. +7 −0 Default (OSX).sublime-keymap
  2. +49 −0 GitCommand.py
7 Default (OSX).sublime-keymap
@@ -0,0 +1,7 @@
+[
+ { "keys": ["ctrl+super+c"], "command": "git_commit"},
+ { "keys": ["ctrl+super+a"], "command": "git_add"},
+ { "keys": ["ctrl+super+r"], "command": "git_rm"},
+ { "keys": ["ctrl+super+d"], "command": "git_diff"},
+ { "keys": ["ctrl+super+s"], "command": "git_status"}
+]
49 GitCommand.py
@@ -0,0 +1,49 @@
+import subprocess
+
+import sublime
+import sublime_plugin
+
+
+class GitCommand(sublime_plugin.WindowCommand):
+ def run(self):
+ p = subprocess.Popen(self.command_string, shell=True, bufsize=1024, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ p.wait()
+ stdout = p.stdout
+ stderr = p.stderr
+ results = [stdout.read(), stderr.read()]
+
+ self.output_view = self.window.get_output_panel('git')
+ self.window.get_output_panel('git')
+
+ self.window.run_command('show_panel', {'panel': 'output.git'})
+
+ self.output_view.set_read_only(False)
+ edit = self.output_view.begin_edit()
+ self.output_view.insert(edit, self.output_view.size(), '\n'.join(results))
+ self.output_view.end_edit(edit)
+ self.output_view.set_read_only(True)
+
+
+# class GitCommitCommand(GitCommand):
+# command_string = 'git commit'
+
+# class GitAddCommand(GitCommand):
+# command_string = 'git add "%s"' % str(self.view.fileName())
+
+# class GitInitCommand(GitCommand):
+# command_string = 'git init'
+
+# class GitRmCommand(GitCommand):
+# command_string = 'git rm "%s"' % str(self.view.fileName())
+
+# class GitDiffCommand(GitCommand):
+# command_string = 'git diff "%s"' % str(self.view.fileName())
+
+# class GitPushCommand(GitCommand):
+# command_string = 'git push'
+
+# class GitPullCommand(GitCommand):
+# command_string = 'git pull'
+
+class GitStatusCommand(GitCommand):
+ command_string = 'git status'
Please sign in to comment.
Something went wrong with that request. Please try again.