Skip to content

Commit

Permalink
Some magit tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
magnars committed Aug 24, 2013
1 parent bff471d commit 64b50dd
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions setup-magit.el
Expand Up @@ -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


Expand All @@ -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 ()
Expand All @@ -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 ()
Expand Down

2 comments on commit 64b50dd

@bradwright
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@magnars
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to be of service. :)

Please sign in to comment.