From d4334eb69630e98ea3fe23c88d2e9de200432929 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 15 Nov 2023 17:17:56 +0000 Subject: [PATCH] Add some more magit hooks Also add to project prefix keys and replace project-vc-dir with magit-project-status --- home/emacs/init.el | 18 +++++++++++++++--- home/emacs/init.org | 19 ++++++++++++++++--- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/home/emacs/init.el b/home/emacs/init.el index adc625e6..f8276a22 100644 --- a/home/emacs/init.el +++ b/home/emacs/init.el @@ -418,7 +418,8 @@ eglot-autoshutdown t eglot-autoreconnect nil) (when (require 'eglot nil :noerror) - (add-hook 'prog-mode-hook #'eglot-ensure)) + (add-hook 'prog-mode-hook #'eglot-ensure) + (keymap-global-set "C-c c e" #'eglot)) (setq project-switch-use-entire-map t project-switch-commands @@ -428,11 +429,22 @@ (project-find-dir "Find directory") (project-eshell "Eshell"))) -(setq magit-clone-default-directory "~/Projects/" +(setq magit-define-global-key-bindings nil + magit-clone-default-directory "~/Projects/" magit-commit-show-diff nil magit-commit-diff-inhibit-same-window t) (use-package magit - :ensure t) + :ensure t + :bind (("C-c C-g" . magit-status) + ("C-c g g" . magit-status) + ("C-c g d" . magit-dispatch) + ("C-c g f" . magit-file-dispatch) + ("C-c g p" . magit-pull) + ("C-c g P" . magit-push) + :map project-prefix-map + ("m" . magit-project-status)) + :config + (add-to-list 'project-switch-commands '(magit-project-status "Magit") t)) (setq vertico-cycle t) (use-package vertico diff --git a/home/emacs/init.org b/home/emacs/init.org index d86749c8..a0573757 100644 --- a/home/emacs/init.org +++ b/home/emacs/init.org @@ -491,7 +491,8 @@ For reference information, see [[https://orgmode.com][Org-mode website]] eglot-autoshutdown t eglot-autoreconnect nil) (when (require 'eglot nil :noerror) - (add-hook 'prog-mode-hook #'eglot-ensure)) + (add-hook 'prog-mode-hook #'eglot-ensure) + (keymap-global-set "C-c c e" #'eglot)) #+END_SRC ** Project #+BEGIN_SRC emacs-lisp @@ -506,11 +507,23 @@ For reference information, see [[https://orgmode.com][Org-mode website]] ** Version control *** Magit #+begin_src emacs-lisp - (setq magit-clone-default-directory "~/Projects/" + (setq magit-define-global-key-bindings nil + magit-clone-default-directory "~/Projects/" magit-commit-show-diff nil magit-commit-diff-inhibit-same-window t) (use-package magit - :ensure t) + :ensure t + :bind (("C-c C-g" . magit-status) + ("C-c g g" . magit-status) + ("C-c g d" . magit-dispatch) + ("C-c g f" . magit-file-dispatch) + ("C-c g p" . magit-pull) + ("C-c g P" . magit-push) + ("