Change / simplify some key binds

Simplify magit, org, org-roam, eshell binds to single bind at top
level key

Change consult binds to C-c c ... from C-c s ...

Add Projects directory bind
This commit is contained in:
Evie Litherland-Smith 2024-09-06 07:14:37 +01:00
parent a001486f56
commit bd3c281bdc

View file

@ -623,12 +623,11 @@ Configure email with iCalendar event support, to integrate with
(mouse-wheel-progressive-speed nil) (mouse-wheel-progressive-speed nil)
(mouse-wheel-follow-mouse t)) (mouse-wheel-follow-mouse t))
;; Quick bind for calling `git-sync-all' ;; Function for calling `git-sync-all'
(defun my/git-sync-all () (defun my/git-sync-all ()
"Run shell command `git-sync-all' asynchronously." "Run shell command `git-sync-all' asynchronously."
(interactive) (interactive)
(async-shell-command "git-sync-all" "*git-sync-all*" "*git-sync-errors*")) (async-shell-command "git-sync-all" "*git-sync-all*" "*git-sync-errors*"))
(keymap-global-set "C-c g s" #'my/git-sync-all)
;; Make shebang (#!) file executable when saved ;; Make shebang (#!) file executable when saved
(add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p) (add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p)
@ -692,11 +691,8 @@ Configure email with iCalendar event support, to integrate with
:defines ibuffer-filter-groups :defines ibuffer-filter-groups
:bind (("C-c b" . ibuffer))) :bind (("C-c b" . ibuffer)))
(use-package shell
:bind (("C-c t s" . shell)))
(use-package eshell (use-package eshell
:bind (("C-c t e" . eshell)) :bind (("C-c t" . eshell))
:config :config
(require 'esh-mode)) (require 'esh-mode))
@ -765,10 +761,6 @@ Configure email with iCalendar event support, to integrate with
(winner-mode)) (winner-mode))
(use-package ediff (use-package ediff
:bind (("C-c d f" . ediff-files)
("C-c d b" . ediff-buffers)
("C-c d 3 f" . ediff-files3)
("C-c d 3 b" . ediff-buffers3))
:custom :custom
(ediff-window-setup-function #'ediff-setup-windows-plain)) (ediff-window-setup-function #'ediff-setup-windows-plain))
@ -915,7 +907,7 @@ Configure email with iCalendar event support, to integrate with
(use-package org-capture (use-package org-capture
:after org :after org
:bind (("C-c o n" . org-capture)) :bind (("C-c n" . org-capture))
:custom (org-capture-templates :custom (org-capture-templates
'(("t" "TODO" entry '(("t" "TODO" entry
(file+olp "tasks.org.gpg" "Inbox") (file+olp "tasks.org.gpg" "Inbox")
@ -932,14 +924,14 @@ Configure email with iCalendar event support, to integrate with
:after org :after org
:defines org-roam-directory :defines org-roam-directory
:functions org-roam-db-autosync-mode :functions org-roam-db-autosync-mode
:bind (("C-c o r i" . org-roam-node-insert) :bind (("C-c r i" . org-roam-node-insert)
("C-c o r f" . org-roam-node-find) ("C-c r f" . org-roam-node-find)
("C-c o r n" . org-roam-capture) ("C-c r n" . org-roam-capture)
("C-c o r j" . org-roam-dailies-capture-today) ("C-c r j" . org-roam-dailies-capture-today)
("M-g j" . org-roam-dailies-goto-today) ("M-g j" . org-roam-dailies-goto-today)
("M-g C-j" . org-roam-dailies-goto-date) ("M-g C-j" . org-roam-dailies-goto-date)
:map org-mode-map :map org-mode-map
("C-c o r b" . org-roam-buffer-toggle)) ("C-c r b" . org-roam-buffer-toggle))
:custom :custom
(org-roam-directory (expand-file-name "roam" org-directory)) (org-roam-directory (expand-file-name "roam" org-directory))
(org-roam-completion-everywhere nil) (org-roam-completion-everywhere nil)
@ -988,8 +980,7 @@ Configure email with iCalendar event support, to integrate with
(use-package org-agenda (use-package org-agenda
:after (org appt) :after (org appt)
:bind (("C-c o a" . org-agenda) :bind (("C-c a" . org-agenda))
("C-c o C-a" . org-agenda-list))
:hook (org-agenda-finalize . org-agenda-to-appt) :hook (org-agenda-finalize . org-agenda-to-appt)
:custom :custom
(org-agenda-span 'day) (org-agenda-span 'day)
@ -1237,12 +1228,12 @@ Configure email with iCalendar event support, to integrate with
:bind (("<remap> <imenu>" . consult-imenu) :bind (("<remap> <imenu>" . consult-imenu)
("<remap> <switch-to-buffer>" . consult-buffer) ("<remap> <switch-to-buffer>" . consult-buffer)
("<remap> <project-switch-to-buffer>" . consult-project-buffer) ("<remap> <project-switch-to-buffer>" . consult-project-buffer)
("C-c s l" . consult-line) ("C-c c l" . consult-line)
("C-c s o" . consult-outline) ("C-c c o" . consult-outline)
("C-c s f" . consult-fd) ("C-c c f" . consult-fd)
("C-c s g" . consult-ripgrep) ("C-c c g" . consult-ripgrep)
("C-c s e" . consult-flymake) ("C-c c e" . consult-flymake)
("C-c s i" . consult-info) ("C-c c i" . consult-info)
:map minibuffer-local-map :map minibuffer-local-map
("<remap> <previous-matching-history-element>" . consult-history) ("<remap> <previous-matching-history-element>" . consult-history)
:map comint-mode-map :map comint-mode-map
@ -1385,7 +1376,6 @@ Configure email with iCalendar event support, to integrate with
:if (package-installed-p 'apheleia) :if (package-installed-p 'apheleia)
:defines (apheleia-formatters :defines (apheleia-formatters
apheleia-mode-alist) apheleia-mode-alist)
:bind (("C-c c f" . apheleia-format-buffer))
:hook (prog-mode) :hook (prog-mode)
:custom (apheleia-remote-algorithm 'cancel) :custom (apheleia-remote-algorithm 'cancel)
:config :config
@ -1459,10 +1449,7 @@ Configure email with iCalendar event support, to integrate with
(add-to-list 'package-selected-packages 'magit) (add-to-list 'package-selected-packages 'magit)
(use-package magit (use-package magit
:if (package-installed-p 'magit) :if (package-installed-p 'magit)
:bind (("C-c g g" . magit-status) :bind (("C-c g" . magit-status)
("C-c g d" . magit-dispatch)
("C-c g f" . magit-file-dispatch)
("C-c g b" . magit-blame-addition)
:map project-prefix-map :map project-prefix-map
("m" . magit-project-status)) ("m" . magit-project-status))
:custom :custom
@ -1700,6 +1687,11 @@ Configure email with iCalendar event support, to integrate with
"Open Downloads directory." "Open Downloads directory."
(interactive) (interactive)
(find-file "~/Downloads/")) (find-file "~/Downloads/"))
(defun my/open-projects-directory ()
"Open Projects directory."
(interactive)
(find-file "~/Projects/"))
(keymap-global-set "C-c w d" #'my/open-documents-directory) (keymap-global-set "C-c w d" #'my/open-documents-directory)
(keymap-global-set "C-c w C-d" #'my/open-downloads-directory) (keymap-global-set "C-c w C-d" #'my/open-downloads-directory)
(keymap-global-set "C-c w p" #'my/open-projects-directory)
#+end_src #+end_src