summaryrefslogtreecommitdiffstats
path: root/lisp/init-git.el
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2017-05-31 20:57:41 +0200
committerMartin Polden <mpolden@mpolden.no>2017-05-31 20:57:41 +0200
commit3cb44c0ba3f74639ad1abde5cf77292825fdd378 (patch)
tree3ca5b7418e7acf6a1308cce57b188f0c2b2e2be9 /lisp/init-git.el
parentd768b60ac1af853eaeb628a5facb26f5139d13f2 (diff)
Do not use :config to declare functions
Diffstat (limited to 'lisp/init-git.el')
-rw-r--r--lisp/init-git.el33
1 files changed, 16 insertions, 17 deletions
diff --git a/lisp/init-git.el b/lisp/init-git.el
index c739e74..1cd7d39 100644
--- a/lisp/init-git.el
+++ b/lisp/init-git.el
@@ -13,6 +13,21 @@
(when (featurep 'flyspell) (flyspell-mode 1)))))
;; magit config
+(defun magit-diff-visit-file-other-window (&optional noselect)
+ "Visit current file in another window."
+ (interactive)
+ (let ((current-window (selected-window))
+ ;; magit-diff-visit-file visits in other-window with prefix arg
+ (current-prefix-arg t))
+ (call-interactively 'magit-diff-visit-file)
+ (when noselect
+ (select-window current-window))))
+
+(defun magit-diff-visit-file-other-window-noselect ()
+ "Visit current file in another window, but don't select it."
+ (interactive)
+ (magit-diff-visit-file-other-window t))
+
(use-package magit
:init
;; disable gravatars
@@ -23,23 +38,7 @@
:map magit-status-mode-map
;; make C-o and o behave as in dired
("o" . magit-diff-visit-file-other-window)
- ("C-o" . magit-diff-visit-file-other-window-noselect))
-
- :config
- (defun magit-diff-visit-file-other-window (&optional noselect)
- "Visit current file in another window."
- (interactive)
- (let ((current-window (selected-window))
- ;; magit-diff-visit-file visits in other-window with prefix arg
- (current-prefix-arg t))
- (call-interactively 'magit-diff-visit-file)
- (when noselect
- (select-window current-window))))
-
- (defun magit-diff-visit-file-other-window-noselect ()
- "Visit current file in another window, but don't select it."
- (interactive)
- (magit-diff-visit-file-other-window t)))
+ ("C-o" . magit-diff-visit-file-other-window-noselect)))
;; follow symlinks to files under version control
(setq vc-follow-symlinks t)