* lisp/bandali-magit.el: New file.
authorAmin Bandali <bandali@gnu.org>
Sun, 4 Oct 2020 23:53:01 +0000 (19:53 -0400)
committerAmin Bandali <bandali@gnu.org>
Sun, 4 Oct 2020 23:54:57 +0000 (19:54 -0400)
Move (commented out) Magit stuff from init.el to new file.

init.el
lisp/bandali-magit.el [new file with mode: 0644]

diff --git a/init.el b/init.el
index 870f265..8449569 100644 (file)
--- a/init.el
+++ b/init.el
 
 (require 'bandali-theme)
 
-;; magit, *the* right way to do git
-(comment
-(csetq transient-history-file (b/var "transient/history.el")
-       transient-levels-file  (b/etc "transient/levels.el")
-       transient-values-file  (b/etc "transient/values.el"))
-(with-eval-after-load 'magit
-  (declare-function magit-add-section-hook "magit-section"
-                    (hook function &optional at append local))
-  (magit-add-section-hook 'magit-status-sections-hook
-                          'magit-insert-modules
-                          'magit-insert-stashes
-                          'append)
-  ;; (magit-add-section-hook 'magit-status-sections-hook
-  ;;                         'magit-insert-ignored-files
-  ;;                         'magit-insert-untracked-files
-  ;;                         'append)
-  (declare-function magit-display-buffer-fullframe-status-v1
-                    "magit-mode" (buffer))
-  (csetq
-   magit-diff-refine-hunk t
-   magit-repository-directories '(("~/.emacs.d/" . 0)
-                                  ("~/src/git/" . 2))
-   ;; magit-completing-read-function 'magit-ido-completing-read
-   magit-display-buffer-function
-   #'magit-display-buffer-fullframe-status-v1)
-  (nconc magit-section-initial-visibility-alist
-         '(([unpulled status] . show)
-           ([unpushed status] . show)))
-  (custom-set-faces '(magit-diff-file-heading ((t (:weight normal)))))
-
-  (with-eval-after-load 'magit-extras
-    (csetq
-     magit-pop-revision-stack-format
-     (pcase-let ((`(,pt ,_eob ,index-regexp)
-                  (default-value 'magit-pop-revision-stack-format)))
-       `(,pt "[%N: %h]: %ci\n  %s
-  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=%H"
-             ,index-regexp)))))
-;; global key bindings
-(global-set-key (kbd "C-x g") #'magit-status)
-(global-set-key (kbd "C-c g b") #'magit-blame-addition)
-(global-set-key (kbd "C-c g l") #'magit-log-buffer-file)
-(global-set-key (kbd "C-c g y") #'magit-pop-revision-stack)
-)
+;; (require 'bandali-magit)
 
 ;; recently opened files
 (csetq recentf-max-saved-items 2000
diff --git a/lisp/bandali-magit.el b/lisp/bandali-magit.el
new file mode 100644 (file)
index 0000000..7432a11
--- /dev/null
@@ -0,0 +1,70 @@
+;;; bandali-magit.el --- bandali's magit configuration  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2018-2020  Amin Bandali
+
+;; Author: Amin Bandali <bandali@gnu.org>
+;; Keywords: vc
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; It's Magit!
+
+;;; Code:
+
+(csetq transient-history-file (b/var "transient/history.el")
+       transient-levels-file  (b/etc "transient/levels.el")
+       transient-values-file  (b/etc "transient/values.el"))
+(with-eval-after-load 'magit
+  (declare-function magit-add-section-hook "magit-section"
+                    (hook function &optional at append local))
+  (magit-add-section-hook 'magit-status-sections-hook
+                          'magit-insert-modules
+                          'magit-insert-stashes
+                          'append)
+  ;; (magit-add-section-hook 'magit-status-sections-hook
+  ;;                         'magit-insert-ignored-files
+  ;;                         'magit-insert-untracked-files
+  ;;                         'append)
+  (declare-function magit-display-buffer-fullframe-status-v1
+                    "magit-mode" (buffer))
+  (csetq
+   magit-diff-refine-hunk t
+   magit-repository-directories '(("~/.emacs.d/" . 0)
+                                  ("~/src/git/" . 2))
+   ;; magit-completing-read-function 'magit-ido-completing-read
+   magit-display-buffer-function
+   #'magit-display-buffer-fullframe-status-v1)
+  (nconc magit-section-initial-visibility-alist
+         '(([unpulled status] . show)
+           ([unpushed status] . show)))
+  (custom-set-faces '(magit-diff-file-heading ((t (:weight normal)))))
+
+  (with-eval-after-load 'magit-extras
+    (csetq
+     magit-pop-revision-stack-format
+     (pcase-let ((`(,pt ,_eob ,index-regexp)
+                  (default-value 'magit-pop-revision-stack-format)))
+       `(,pt "[%N: %h]: %ci\n  %s
+  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=%H"
+             ,index-regexp)))))
+;; global key bindings
+(global-set-key (kbd "C-x g") #'magit-status)
+(global-set-key (kbd "C-c g b") #'magit-blame-addition)
+(global-set-key (kbd "C-c g l") #'magit-log-buffer-file)
+(global-set-key (kbd "C-c g y") #'magit-pop-revision-stack)
+
+(provide 'bandali-magit)
+;;; bandali-magit.el ends here