Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some magit tweaks

  • Loading branch information...
commit 64b50ddcd86491d0f487b113c7e16c4510c132b5 1 parent bff471d
Magnar Sveen authored
Showing with 31 additions and 6 deletions.
  1. +31 −6 setup-magit.el
37 setup-magit.el
View
@@ -8,12 +8,12 @@
(set-face-foreground 'diff-removed "#ff0000")
;; todo:
-;; diff-added-face diff-changed-face
-;; diff-context-face diff-file-header-face
-;; diff-function-face diff-header-face
-;; diff-hunk-header-face diff-index-face
-;; diff-indicator-added-face diff-indicator-changed-face
-;; diff-indicator-removed-face diff-nonexistent-face
+;; diff-added-face diff-changed-face
+;; diff-context-face diff-file-header-face
+;; diff-function-face diff-header-face
+;; diff-hunk-header-face diff-index-face
+;; diff-indicator-added-face diff-indicator-changed-face
+;; diff-indicator-removed-face diff-nonexistent-face
;; diff-removed-face
@@ -24,6 +24,26 @@
;;
(add-hook 'magit-mode-hook 'magit-load-config-extensions)
+(defun magit-save-and-exit-commit-mode ()
+ (interactive)
+ (save-buffer)
+ (server-edit)
+ (delete-window))
+
+(defun magit-exit-commit-mode ()
+ (interactive)
+ (kill-buffer)
+ (delete-window))
+
+(eval-after-load "git-commit-mode"
+ '(define-key git-commit-mode-map (kbd "C-c C-k") 'magit-exit-commit-mode))
+
+(defun magit-commit-mode-init ()
+ (when (looking-at "\n")
+ (open-line 1)))
+
+(add-hook 'git-commit-mode-hook 'magit-commit-mode-init)
+
;; C-x C-k to kill file on line
(defun magit-kill-file-on-line ()
@@ -50,6 +70,11 @@
(define-key magit-status-mode-map (kbd "q") 'magit-quit-session)
+;; close popup when commiting
+
+(defadvice git-commit-commit (after delete-window activate)
+ (delete-window))
+
;; full screen vc-annotate
(defun vc-annotate-quit ()

2 comments on commit 64b50dd

Bradley Wright

magit-commit-mode-init and the defadvice thing are ace, thanks!

Magnar Sveen
Owner

Glad to be of service. :)

Please sign in to comment.
Something went wrong with that request. Please try again.