summary refs log tree commit diff stats
path: root/user/emacs
diff options
context:
space:
mode:
authorAlan Pearce2023-03-26 21:54:57 +0200
committerAlan Pearce2023-03-26 21:54:57 +0200
commit6abbd67ac5fb68cffb9961f58714f7594e3a49e6 (patch)
tree3e29daccf1f7c0dc426043e92a2a0c6c53b0e978 /user/emacs
parent36f21cda40d2e4718c50fb2652001d1eefaa9c8c (diff)
downloadnixfiles-6abbd67ac5fb68cffb9961f58714f7594e3a49e6.tar.lz
nixfiles-6abbd67ac5fb68cffb9961f58714f7594e3a49e6.tar.zst
nixfiles-6abbd67ac5fb68cffb9961f58714f7594e3a49e6.zip
emacs: stop magit loading magit-auto-revert-mode unnecessarily
I'm already using global-auto-revert-mode.  I'm not sure if I actually
needed to move the code down in the file any more, but I can't be
bothered now.
Diffstat (limited to 'user/emacs')
-rw-r--r--user/emacs/init.el147
1 files changed, 73 insertions, 74 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 353566d1..ba3f1dc4 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -462,80 +462,6 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
   :gfhook #'evil-org-set-key-theme)
 
 
-;;; Projects
-
-(use-package ripgrep
-  :config (progn
-            (setq ripgrep-arguments '("--hidden"))))
-
-(use-package projectile
-  :defer 1
-  :defines projectile-command-map
-  :general (:keymaps 'projectile-command-map
-                     "s s" #'projectile-ripgrep
-                     "s r" #'projectile-ripgrep)
-  :config (progn
-            (add-to-list 'projectile-globally-ignored-files "package-lock.json")
-            (add-to-list 'projectile-globally-ignored-files "pnpm-lock.yaml")
-            (add-to-list 'projectile-project-root-files "package.json")
-            (add-to-list 'projectile-project-root-files-bottom-up "pnpm-workspace.yaml")
-            (setq projectile-kill-buffers-filter 'kill-only-files
-                  projectile-sort-order 'modification-time
-                  projectile-project-root-functions '(projectile-root-local
-                                                      projectile-root-top-down
-                                                      projectile-root-bottom-up
-                                                      projectile-root-top-down-recurring))
-            (projectile-mode +1)
-            (with-eval-after-load 'evil-ex
-              (evil-ex-define-cmd "rg" #'ripgrep-regexp)
-              (evil-ex-define-cmd "prg" #'projectile-ripgrep)
-              (evil-ex-define-cmd "pesh[ell]" #'projectile-run-eshell)
-              (evil-ex-define-cmd "pb" #'projectile-switch-to-buffer)
-              (evil-ex-define-cmd "psw[itch]" #'projectile-switch-project))))
-
-(use-package magit
-  :defer 5
-  :commands (magit-status magit-dispatch)
-  :custom (magit-auto-revert-mode nil)
-  :config (progn
-            (setq magit-section-visibility-indicator nil
-                  magit-diff-refine-hunk 'all
-                  magit-display-buffer-function #'display-buffer)
-            (remove-hook 'magit-status-sections-hook 'magit-insert-tags-header)
-            (remove-hook 'magit-section-highlight-hook 'magit-section-highlight)
-            (remove-hook 'magit-section-highlight-hook 'magit-section-highlight-selection)
-            (remove-hook 'magit-section-highlight-hook 'magit-diff-highlight)))
-
-(eval-when-compile (require 'fringe-helper))
-(use-package git-gutter-fringe
-  :defer 5
-  :config (progn
-            (add-hook 'magit-post-refresh-hook
-                      #'git-gutter:update-all-windows)
-            ;; places the git gutter outside the margins.
-            (setq-default fringes-outside-margins nil)
-            ;; thin fringe bitmaps
-            (fringe-helper-define 'git-gutter-fr:added '(center repeated)
-              "....XXX.")
-            (fringe-helper-define 'git-gutter-fr:modified '(center repeated)
-              "....XXX.")
-            (fringe-helper-define 'git-gutter-fr:deleted '(center repeated)
-              "....XXX.")
-            (setq git-gutter-fr:side 'right-fringe)
-            (global-git-gutter-mode 1)))
-
-(use-package git-messenger
-  :commands (git-messenger:popup-message)
-  :defer 10
-  :config (setq git-messenger:use-magit-popup t))
-
-(use-package git-timemachine
-  :commands (git-timemachine))
-
-(use-package editorconfig
-  :defer 2
-  :config (editorconfig-mode +1))
-
 ;;; Completion
 
 (use-package company
@@ -971,6 +897,79 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
               :fringe-face 'flycheck-fringe-info
               :info-list-face 'flycheck-error-list-info)))
 
+;;; Projects
+
+(use-package ripgrep
+  :config (progn
+            (setq ripgrep-arguments '("--hidden"))))
+
+(use-package projectile
+  :defer 1
+  :defines projectile-command-map
+  :general (:keymaps 'projectile-command-map
+                     "s s" #'projectile-ripgrep
+                     "s r" #'projectile-ripgrep)
+  :config (progn
+            (add-to-list 'projectile-globally-ignored-files "package-lock.json")
+            (add-to-list 'projectile-globally-ignored-files "pnpm-lock.yaml")
+            (add-to-list 'projectile-project-root-files "package.json")
+            (add-to-list 'projectile-project-root-files-bottom-up "pnpm-workspace.yaml")
+            (setq projectile-kill-buffers-filter 'kill-only-files
+                  projectile-sort-order 'modification-time
+                  projectile-project-root-functions '(projectile-root-local
+                                                      projectile-root-top-down
+                                                      projectile-root-bottom-up
+                                                      projectile-root-top-down-recurring))
+            (projectile-mode +1)
+            (with-eval-after-load 'evil-ex
+              (evil-ex-define-cmd "rg" #'ripgrep-regexp)
+              (evil-ex-define-cmd "prg" #'projectile-ripgrep)
+              (evil-ex-define-cmd "pesh[ell]" #'projectile-run-eshell)
+              (evil-ex-define-cmd "pb" #'projectile-switch-to-buffer)
+              (evil-ex-define-cmd "psw[itch]" #'projectile-switch-project))))
+
+(use-package magit
+  :defer 5
+  :commands (magit-status magit-dispatch)
+  :init (customize-set-value 'magit-auto-revert-mode nil)
+  :config (progn
+            (setq magit-section-visibility-indicator nil
+                  magit-diff-refine-hunk 'all
+                  magit-display-buffer-function #'display-buffer)
+            (remove-hook 'magit-status-sections-hook 'magit-insert-tags-header)
+            (remove-hook 'magit-section-highlight-hook 'magit-section-highlight)
+            (remove-hook 'magit-section-highlight-hook 'magit-section-highlight-selection)
+            (remove-hook 'magit-section-highlight-hook 'magit-diff-highlight)))
+
+(use-package git-gutter-fringe
+  :defer 5
+  :config (progn
+            (add-hook 'magit-post-refresh-hook
+                      #'git-gutter:update-all-windows)
+            ;; places the git gutter outside the margins.
+            (setq-default fringes-outside-margins nil)
+            ;; thin fringe bitmaps
+            (fringe-helper-define 'git-gutter-fr:added '(center repeated)
+              "....XXX.")
+            (fringe-helper-define 'git-gutter-fr:modified '(center repeated)
+              "....XXX.")
+            (fringe-helper-define 'git-gutter-fr:deleted '(center repeated)
+              "....XXX.")
+            (setq git-gutter-fr:side 'right-fringe)
+            (global-git-gutter-mode 1)))
+
+(use-package git-messenger
+  :commands (git-messenger:popup-message)
+  :defer 10
+  :config (setq git-messenger:use-magit-popup t))
+
+(use-package git-timemachine
+  :commands (git-timemachine))
+
+(use-package editorconfig
+  :defer 2
+  :config (editorconfig-mode +1))
+
 (setq-default ispell-dictionary "en_GB-ise-w_accents")
 (setq ispell-extra-args '("--sug-mode=ultra" "--camel-case"))
 (use-package flyspell)