summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2016-07-14 13:13:17 +0200
committerrekado <rekado@elephly.net>2016-07-14 13:13:17 +0200
commitd6283187ded6a0d564376d99f9e76af5e6177b0a (patch)
tree395b5fe58e990371051994534d1ba7cbcfa68bbf
parent052680ed618553bd55c910e7adf34f315ac74597 (diff)
Move magit configuration to init.org.
-rw-r--r--init.org55
-rw-r--r--lisp/init-magit.el37
2 files changed, 54 insertions, 38 deletions
diff --git a/init.org b/init.org
index c05a957..ee53fc7 100644
--- a/init.org
+++ b/init.org
@@ -418,6 +418,58 @@ The default prompt face makes it hard to see the prompt.
:weight 'bold)
#+END_SRC
+* Magit
+:PROPERTIES:
+:noweb-ref: magit
+:END:
+
+#+BEGIN_SRC elisp
+;; full screen magit-status
+(defadvice magit-status (around magit-fullscreen activate)
+ (window-configuration-to-register :magit-fullscreen)
+ ad-do-it
+ (delete-other-windows))
+
+(defun my/magit-quit-session ()
+ "Restores the previous window configuration and kills the magit buffer"
+ (interactive)
+ (kill-buffer)
+ (jump-to-register :magit-fullscreen))
+
+(defun my/magit-toggle-whitespace ()
+ "Toggles git option -w"
+ (interactive)
+ (if (member "-w" magit-diff-options)
+ (my/magit-dont-ignore-whitespace)
+ (my/magit-ignore-whitespace)))
+
+(defun my/magit-ignore-whitespace ()
+ "Adds git option -w"
+ (interactive)
+ (add-to-list 'magit-diff-options "-w")
+ (magit-refresh))
+
+(defun my/magit-dont-ignore-whitespace ()
+ "Removes git option -w"
+ (interactive)
+ (setq magit-diff-options (remove "-w" magit-diff-options))
+ (magit-refresh))
+
+(define-key magit-status-mode-map (kbd "q") 'my/magit-quit-session)
+(define-key magit-status-mode-map (kbd "W") 'my/magit-toggle-whitespace)
+
+(setq magit-diff-refine-hunk 'all)
+#+END_SRC
+
+#+BEGIN_SRC elisp :noweb-ref magit-lazy
+(provide 'my/init-magit)
+(with-eval-after-load "magit"
+ <<magit>>
+ )
+(require 'magit)
+(global-set-key (kbd "C-c m") 'magit-status)
+#+END_SRC
+
* TODO Initial stuff
:PROPERTIES:
:noweb-ref: initial
@@ -581,7 +633,7 @@ still need to process all of this and clean it up.
(load "init-completion.el")
(load "init-geiser.el")
(load "init-gnus.el")
-(load "init-magit.el")
+(require 'my/init-magit)
(load "init-eshell.el")
(load "init-smex.el")
(load "init-modeline.el")
@@ -659,6 +711,7 @@ put them all together to build the init file
<<shell>>
<<initial-after-packages>>
<<org-mode-lazy>>
+<<magit-lazy>>
<<old-init>>
#+END_SRC
diff --git a/lisp/init-magit.el b/lisp/init-magit.el
deleted file mode 100644
index b4fad90..0000000
--- a/lisp/init-magit.el
+++ /dev/null
@@ -1,37 +0,0 @@
-;; full screen magit-status
-(require 'magit)
-(defadvice magit-status (around magit-fullscreen activate)
- (window-configuration-to-register :magit-fullscreen)
- ad-do-it
- (delete-other-windows))
-
-(defun my/magit-quit-session ()
- "Restores the previous window configuration and kills the magit buffer"
- (interactive)
- (kill-buffer)
- (jump-to-register :magit-fullscreen))
-
-(defun my/magit-toggle-whitespace ()
- "Toggles git option -w"
- (interactive)
- (if (member "-w" magit-diff-options)
- (my/magit-dont-ignore-whitespace)
- (my/magit-ignore-whitespace)))
-
-(defun my/magit-ignore-whitespace ()
- "Adds git option -w"
- (interactive)
- (add-to-list 'magit-diff-options "-w")
- (magit-refresh))
-
-(defun my/magit-dont-ignore-whitespace ()
- "Removes git option -w"
- (interactive)
- (setq magit-diff-options (remove "-w" magit-diff-options))
- (magit-refresh))
-
-(define-key magit-status-mode-map (kbd "q") 'my/magit-quit-session)
-(define-key magit-status-mode-map (kbd "W") 'my/magit-toggle-whitespace)
-(global-set-key (kbd "C-c m") 'magit-status)
-
-(setq magit-diff-refine-hunk 'all)