Add some more magit hooks

Also add to project prefix keys and replace project-vc-dir with magit-project-status
This commit is contained in:
Evie Litherland-Smith 2023-11-15 17:17:56 +00:00
parent c272902fef
commit d4334eb696
2 changed files with 31 additions and 6 deletions

View file

@ -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

View file

@ -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)
("<remap> <project-vc-dir" . magit-project-status)
:map project-prefix-map
("m" . magit-project-status))
:config
(add-to-list 'project-switch-commands '(magit-project-status "Magit") t))
#+end_src
** Completion
*** Vertico