docs(emacs): move most keybindings to same file

All general keybindings (not linked to a specific mode) are now
defined in keybindings.org in neatly displayed tables.
This commit is contained in:
2024-04-03 06:07:58 +02:00
parent b4e585457b
commit 788ecefbe5
8 changed files with 363 additions and 357 deletions

View File

@@ -1112,6 +1112,9 @@ configuration [[file:mpd.org][here]]).
<<emms-search-set-variable>>
<<emms-media-hydra>>
(defun my/mpc-toggle ()
(interactive)
(shell-command-and-echo "mpc toggle"))
(defun emms-player-toggle-pause ()
(interactive)
(shell-command-and-echo "mpc toggle"))
@@ -1153,27 +1156,7 @@ configuration [[file:mpd.org][here]]).
:packages 'emms
"d" #'emms-playlist-mode-kill-track
"p" #'emms-playlist-mode-play-smart
"q" #'kill-this-buffer)
(phundrak/leader-key
:infix "m"
:packages 'emms
"" '(:ignore t :which-key "media")
"." #'hydra-media/body
"«" #'emms-player-mpd-previous
"»" #'emms-player-mpd-next
"c" #'emms-player-mpd-clear
"e" '(:ignore t :which-key "emms")
"eb" #'emms-browser
"ep" #'emms-playlist-mode-go
"es" #'emms-player-mpd-show
"p" '((lambda ()
(interactive)
(shell-command-and-echo "mpc toggle"))
:which-key "mpc toggle")
"s" #'emms-stop
"u" '(:ignore t :which-key "update")
"um" #'emms-player-mpd-update-all
"uc" #'emms-cache-set-from-mpd-all))
"q" #'kill-this-buffer))
#+end_src
*** Finding files from EMMS
@@ -1401,25 +1384,7 @@ doing and what Git is doing! In short, I absolutely love it!
:packages 'magit
"," #'with-editor-finish
"k" #'with-editor-cancel
"a" #'with-editor-cancel)
(phundrak/leader-key
:infix "g"
:packages 'magit
"" '(:ignore t :wk "git")
"b" #'magit-blame
"c" #'magit-clone
"d" #'magit-dispatch
"i" #'magit-init
"s" #'magit-status
"l" #'magit-log
"y" #'my/yadm
"S" #'magit-stage-file
"U" #'magit-unstage-file
"f" '(:ignore t :wk "file")
"fd" #'magit-diff
"fc" #'magit-file-checkout
"fl" #'magit-file-dispatch
"fF" #'magit-find-file))
"a" #'with-editor-cancel))
#+end_src
There is currently a bug in Emacs TRAMP as described in issue [[https://github.com/magit/magit/issues/4720][#4720]] of
@@ -1475,14 +1440,7 @@ keywords in a buffer. Lets enable this mode globally.
(use-package hl-todo
:defer t
:straight (:build t)
:init (global-hl-todo-mode 1)
:general
(phundrak/leader-key
:packages '(hl-todo)
:infix "c"
"" '(:ignore t :which-key "todos")
"n" #'hl-todo-next
"p" #'hl-todo-previous))
:init (global-hl-todo-mode 1))
#+end_src
We can now configure properly =magit-todos=. Notice my custom function
@@ -1617,12 +1575,7 @@ look nice.
:type git
:host github
:repo "tecosaur/screenshot")
:config (load-file (locate-library "screenshot.el"))
:general
(phundrak/leader-key
:infix "a"
:packages '(screenshot)
"S" #'screenshot))
:config (load-file (locate-library "screenshot.el")))
#+end_src
** Shells

View File

@@ -301,10 +301,5 @@ youre not sure or if you dont remember what your snippet is.
(use-package ivy-yasnippet
:defer t
:after (ivy yasnippet)
:straight (:build t)
:general
(phundrak/leader-key
:infix "i"
:packages 'ivy-yasnippet
"y" #'ivy-yasnippet))
:straight (:build t))
#+end_src

View File

@@ -75,11 +75,6 @@ compatibility package that adds states for iedit.
iedit-only-at-symbol-boundaries t
iedit-toggle-key-default nil)
:general
(phundrak/leader-key
:infix "r"
:packages '(iedit evil-iedit-state)
"" '(:ignore t :which-key "refactor")
"i" #'evil-iedit-state/iedit-mode)
(general-define-key
:keymaps 'evil-iedit-state-map
"c" nil

View File

@@ -170,8 +170,6 @@ compilation buffer, as well as enable some syntax highlighting.
"r" nil
"R" #'recompile
"h" nil)
(phundrak/leader-key
"R" #'recompile)
:config
(setq compilation-scroll-output t))
#+end_src

View File

@@ -49,31 +49,6 @@ it bépo-compatible.
:pakages 'avy
"gc" #'evil-avy-goto-char-timer
"gl" #'evil-avy-goto-line)
(phundrak/leader-key
:packages 'avy
:infix "j"
"b" #'avy-pop-mark
"c" #'evil-avy-goto-char-timer
"l" #'avy-goto-line)
(phundrak/leader-key
:packages 'avy
:infix "A"
"c" '(:ignore t :which-key "copy")
"cl" #'avy-copy-line
"cr" #'avy-copy-region
"k" '(:ignore t :which-key "kill")
"kl" #'avy-kill-whole-line
"kL" #'avy-kill-ring-save-whole-line
"kr" #'avy-kill-region
"kR" #'avy-kill-ring-save-region
"m" '(:ignore t :which-key "move")
"ml" #'avy-move-line
"mr" #'avy-move-region
"mt" #'avy-transpose-lines-in-region
"n" #'avy-next
"p" #'avy-prev
"u" #'my/avy-goto-url
"U" #'my/avy-open-url)
(phundrak/major-leader-key
:packages '(avy org)
:keymaps 'org-mode-map

View File

@@ -327,17 +327,6 @@ specified org files which are described below.
(defvar org-worldbuilding-file "~/org/worldbuilding.org")
#+end_src
Let me describe a keybind to invoke org-capture from anywhere within
Emacs.
#+name: org-capture-keybinds
#+begin_src emacs-lisp :tangle no
(phundrak/leader-key
:packages 'org
:infix "o"
"" '(:ignore t :which-key "org")
"c" #'org-capture)
#+end_src
When ~org-capture~ is invoked, it will ask which template we wish to
use. In the table [[org-capture-shortcuts-table]], the /key/ column
represents which keychord we need to hit, titled with /name/, we need to
@@ -1060,26 +1049,6 @@ management system based on org-mode.
:config
(org-roam-db-autosync-mode 1)
:general
(phundrak/leader-key
:packages '(org org-roam)
:infix "o"
"r" '(:ignore t :which-key "roam")
"rb" '(org-mark-ring-goto :which-key "back")
"rB" #'org-roam-buffer-toggle
"rn" '(:ignore t :which-key "nodes")
"rnf" #'org-roam-node-find
"rni" #'org-roam-node-insert
"rno" #'org-roam-node-open
"rnr" #'org-roam-node-random
"rnv" #'org-roam-node-visit
"rs" '(:ignore t :which-key "sync")
"rsa" #'org-roam-db-autosync-mode
"rsc" #'org-roam-db-clear-all
"rsd" #'org-roam-db-diagnose-node
"rss" #'org-roam-db-sync
"ru" '(:ignore t :which-key "ui")
"rua" #'org-roam-ui-add-to-local-graph
"ruo" #'org-roam-ui-open)
(phundrak/major-leader-key
:keymaps 'org-mode-map
:packages '(org org-roam)

View File

@@ -338,20 +338,7 @@ in quite a few languages.
:config
(setq langtool-java-classpath (string-join '("/usr/share/languagetool"
"/usr/share/java/languagetool/*")
":"))
:general
(phundrak/leader-key
:packages 'langtool
:infix "l"
"" '(:ignore t :which-key "LangTool")
"B" #'langtool-correct-buffer
"b" #'langtool-check-buffer
"c" #'langtool-check
"C" #'langtool-correct-at-point
"d" #'langtool-check-done
"l" #'langtool-switch-default-language
"p" #'langtool-show-message-at-point
"r" #'langtool-correct-region))
":")))
#+end_src
Finally, =writegood-mode= detects some simple general rules when writing