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:
Lucien Cartier-Tilet 2024-04-03 06:07:58 +02:00
parent b4e585457b
commit 788ecefbe5
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
8 changed files with 363 additions and 357 deletions

View File

@ -9,23 +9,32 @@ Undefining some stuff to make keybind prefixes work correctly.
#+name: general-keybindings-gen #+name: general-keybindings-gen
#+header: :tangle no :exports none :results value :cache yes #+header: :tangle no :exports none :results value :cache yes
#+begin_src emacs-lisp :var table=keybinds-windows prefix="" #+begin_src emacs-lisp :var table=keybindings-apps prefix="a"
(mapconcat (lambda (line) (mapconcat
(let* ((key (nth 0 line)) (lambda (line)
(function (nth 1 line)) (let* ((key (format "%s" (nth 0 line)))
(comment (or (nth 2 line) "")) (function (nth 1 line))
(package (or (nth 3 line) ""))) (fn-nil-p (member function '("" "nil")))
(format "\"%s%s\" %s" (comment (or (nth 2 line) ""))
prefix (comment-p (not (string= "" comment)))
key (comment (cond ((nth 2 line) (concat " :wk \"" (nth 2 line) "\""))
(if (string= "" comment) (fn-nil-p " :wk t")
(if (member function '("" "nil")) "nil" (concat "#'" function)) (t "")))
(format "'(%s :wk %s%s)" (package (or (nth 3 line) ""))
(if (member function '("" "nil")) ":ignore t" function) (package-p (not (string= "" (nth 3 line))))
(if (member function '("none" "nil")) "t" (concat "\"" comment "\"")) (package (if package-p (concat " :package " (nth 3 line)) "")))
(if (string-blank-p package) "" (concat ":package " package))))))) (format "\"%s\" %s"
table (concat prefix key)
"\n") (if (or comment-p package-p)
(format "'(%s%s%s)"
(if (member function '("" "nil"))
":ignore t"
function)
(if comment-p comment "")
(if package-p package ""))
(concat "#'" function)))))
table
"\n")
#+end_src #+end_src
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -36,60 +45,52 @@ Undefining some stuff to make keybind prefixes work correctly.
(phundrak/evil (phundrak/evil
:packages '(counsel) :packages '(counsel)
"U" #'evil-redo "U" '(evil-redo :package evil)
"C-a" #'beginning-of-line "C-a" #'beginning-of-line
"C-e" #'end-of-line "C-e" #'end-of-line
"C-y" #'yank "C-y" #'yank
"M-y" #'counsel-yank-pop) "M-y" '(counsel-yank-pop :package counsel))
#+end_src #+end_src
#+begin_src emacs-lisp #+begin_src emacs-lisp :results none
(general-define-key (general-define-key
"<f5>" #'compile "<f5>" #'compile
"<f6>" #'recompile) "<f6>" #'recompile)
(phundrak/leader-key (phundrak/leader-key
"SPC" '(counsel-M-x :wk "M-x") "SPC" '(counsel-M-x :wk "M-x")
"'" #'shell-pop "'" '(shell-pop :package shell-pop)
"R" #'recompile
<<general-keybindings-gen(table=keybinds-tabs, prefix="TAB ")>>
<<general-keybindings-gen(table=keybinds-apps, prefix="a")>>
<<general-keybindings-gen(table=keybinds-apps-shell, prefix="as")>>
<<general-keybindings-gen(table=treemacs-keybinds, prefix="at")>>
<<general-keybindings-gen(table=keybinds-buffers, prefix="b")>>
"c" '(:ignore t :wk "code")
"cl" #'evilnc-comment-or-uncomment-lines
<<keybindings-flycheck>>
<<general-keybindings-gen(table=keybinds-files, prefix="f")>>
<<keybinds-specific-files>>
<<general-keybindings-gen(table=keybinds-help, prefix="h")>>
"i" '(:ignore t :wk "insert")
"iu" #'counsel-unicode-char
<<general-keybindings-gen(table=keybinds-jump, prefix="j")>>
<<general-keybindings-gen(table=keybinds-toggle, prefix="t ")>>
<<general-keybindings-gen(table=keybinds-text, prefix="T")>>
<<general-keybindings-gen(table=keybinds-windows, prefix="w")>>
<<general-keybindings-gen(table=keybinds-quit, prefix="q")>>
"u" #'universal-argument "u" #'universal-argument
"U" #'undo-tree-visualize) "U" '(undo-tree-visualize :package undo-tree)
<<general-keybindings-gen(table=keybindings-tabs, prefix="TAB ")>>
<<general-keybindings-gen(table=keybindings-apps, prefix="a")>>
<<general-keybindings-gen(table=keybindings-apps-shell, prefix="as")>>
<<general-keybindings-gen(table=keybindings-treemacs, prefix="at")>>
<<general-keybindings-gen(table=keybindings-buffers, prefix="b")>>
<<general-keybindings-gen(table=keybindings-code, prefix="c")>>
<<general-keybindings-gen(table=keybindings-errors, prefix="e")>>
<<keybindings-errors-extra>>
<<general-keybindings-gen(table=keybindings-files, prefix="f")>>
<<keybindings-files-extras>>
<<general-keybindings-gen(table=keybindings-git, prefix="g")>>
<<general-keybindings-gen(table=keybindings-help, prefix="h")>>
<<general-keybindings-gen(table=keybindings-insert, prefix="i")>>
<<general-keybindings-gen(table=keybindings-jump, prefix="j")>>
<<general-keybindings-gen(table=keybindings-language, prefix="l")>>
<<general-keybindings-gen(table=keybindings-media, prefix="m")>>
<<general-keybindings-gen(table=keybindings-org, prefix="o")>>
<<general-keybindings-gen(table=keybindings-refactor, prefix="r")>>
<<general-keybindings-gen(table=keybindings-toggle, prefix="t ")>>
<<general-keybindings-gen(table=keybindings-text, prefix="T")>>
<<general-keybindings-gen(table=keybindings-windows, prefix="w")>>
<<general-keybindings-gen(table=keybindings-quit, prefix="q")>>)
#+end_src #+end_src
** Apps ** Apps
Here are my apps keybinds. Each one of them is prefixed by ~a~. Here are my apps keybindings. Each one of them is prefixed by ~a~.
#+name: keybinds-apps #+name: keybindings-apps
| Key | Function | Description | Package | | Key | Function | Description | Package |
|-----+----------------------------+-------------+------------| |-----+----------------------------+-------------+------------|
| | | apps | | | | | apps | |
@ -98,22 +99,24 @@ Here are my apps keybinds. Each one of them is prefixed by ~a~.
| CC | calendar | | | | CC | calendar | | |
| Co | org-agenda | | org | | Co | org-agenda | | org |
| Cs | org-caldav-sync | | org-caldav | | Cs | org-caldav-sync | | org-caldav |
| d | docker | | | | d | docker | | docker |
| E | elfeed | | | | E | elfeed | | elfeed |
| e | | email | | | e | | email | |
| ec | mu4e-compose-new | | | | ec | mu4e-compose-new | | mu4e |
| em | mu4e | | | | em | mu4e | | mu4e |
| k | keycast-mode | | | | k | keycast-mode | | keycast |
| K | keycast-log-mode | | | | K | keycast-log-mode | | keycast |
| m | | mastodon | | | m | | mastodon | |
| mm | mastodon | | mastodon | | mm | mastodon | | mastodon |
| mn | mastodon-notifications-get | | mastodon | | mn | mastodon-notifications-get | | mastodon |
| mt | mastodon-toot | | mastodon | | mt | mastodon-toot | | mastodon |
| T | tetris | | | | T | tetris | | |
| S | screenshot | | screenshot |
| w | wttrin | | wttrin | | w | wttrin | | wttrin |
*** Shell apps
I also have two main shell-related functions, prefixed with ~as~. I also have two main shell-related functions, prefixed with ~as~.
#+name: keybinds-apps-shell #+name: keybindings-apps-shell
| Key | Function | Description | Package | | Key | Function | Description | Package |
|-----+-------------+-------------+-------------| |-----+-------------+-------------+-------------|
| | | shells | | | | | shells | |
@ -121,25 +124,81 @@ I also have two main shell-related functions, prefixed with ~as~.
| v | vterm | | vterm | | v | vterm | | vterm |
| V | multi-vterm | | multi-vterm | | V | multi-vterm | | multi-vterm |
*** Treemacs
#+name: keybindings-treemacs
| Key | Function | Description | Package |
|-----+----------------------------------------+-------------+----------|
| | | treemacs | |
| c | | create | |
| cd | treemacs-create-dir | | treemacs |
| cf | treemacs-create-file | | treemacs |
| ci | treemacs-create-icon | | treemacs |
| ct | treemacs-create-theme | | treemacs |
| cw | treemacs-create-workspace | | treemacs |
| d | treemacs-delete-file | | treemacs |
| f | | files | |
| ff | treemacs-find-file | | treemacs |
| ft | treemacs-find-tag | | treemacs |
| l | | lsp | |
| ls | treemacs-expand-lsp-symbol | | treemacs |
| ld | treemacs-expand-lsp-treemacs-deps | | treemacs |
| lD | treemacs-collapse-lsp-treemacs-deps | | treemacs |
| lS | treemacs-collapse-lsp-symbol | | treemacs |
| p | | projects | |
| pa | treemacs-add-project-to-workspace | | treemacs |
| pf | treemacs-project-follow-mode | | treemacs |
| pn | treemacs-project-of-node | | treemacs |
| pp | treemacs-project-at-point | | treemacs |
| pr | treemacs-remove-project-from-workspace | | treemacs |
| pt | treemacs-move-project-down | | treemacs |
| ps | treemacs-move-project-up | | treemacs |
| r | | rename | |
| rf | treemacs-rename-file | | treemacs |
| rp | treemacs-rename-project | | treemacs |
| rr | treemacs-rename | | treemacs |
| rw | treemacs-rename-workspace | | treemacs |
| t | treemacs | | treemacs |
| T | | toggles | |
| Td | treemacs-toggle-show-dotfiles | | treemacs |
| Tn | treemacs-toggle-node | | treemacs |
| v | | visit node | |
| va | treemacs-visit-node-ace | | treemacs |
| vc | treemacs-visit-node-close-treemacs | | treemacs |
| vn | treemacs-visit-node-default | | treemacs |
| y | | yank | |
| ya | treemacs-copy-absolute-path-at-point | | treemacs |
| yp | treemacs-copy-project-path-at-point | | treemacs |
| yr | treemacs-copy-relative-path-at-point | | treemacs |
| yf | treemacs-copy-file | | treemacs |
** Buffers ** Buffers
My buffer-related keybinds are all prefixed by ~b~. My buffer-related keybindings are all prefixed by ~b~.
#+name: keybinds-buffers #+name: keybindings-buffers
| Key | Function | Description | | Key | Function | Description | Package |
|-----+------------------------------------+-------------| |-----+------------------------------------+-------------+-----------|
| | | buffers | | | | buffers | |
| b | bufler-switch-buffer | | | b | bufler-switch-buffer | | bufler |
| B | bury-buffer | | | B | bury-buffer | | |
| c | clone-indirect-buffer | | | c | clone-indirect-buffer | | |
| C | clone-indirect-buffer-other-window | | | C | clone-indirect-buffer-other-window | | |
| l | bufler | | | l | bufler | | bufler |
| d | kill-this-buffer | | | d | kill-this-buffer | | |
| D | kill-buffer | | | D | kill-buffer | | |
| h | dashboard-refresh-buffer | | | h | dashboard-refresh-buffer | | dashboard |
| m | switch-to-messages-buffer | | | m | switch-to-messages-buffer | | |
| n | next-buffer | | | n | next-buffer | | |
| p | previous-buffer | | | p | previous-buffer | | |
| r | counsel-buffer-or-recentf | | | r | counsel-buffer-or-recentf | | counsel |
| s | switch-to-scratch-buffer | | | s | switch-to-scratch-buffer | | |
** Code
#+name: keybindings-code
| Key | Function | Description | Package |
|-----+-----------------------------------+-------------+---------------------|
| | | code | |
| l | evilnc-comment-or-uncomment-lines | | evil-nerd-commenter |
| n | hl-todo-next | | hl-todo |
| p | hl-todo-previous | | hl-todo |
** Errors ** Errors
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -155,39 +214,45 @@ My buffer-related keybinds are all prefixed by ~b~.
("q" nil)) ("q" nil))
#+end_src #+end_src
#+name: keybindings-flycheck #+name: keybindings-errors
| Key | Function | Description | Package |
|-----+---------------------+----------------+---------|
| | | errors | |
| . | hydra-flycheck/body | hydra-flycheck | |
| l | counsel-flycheck | | counsel |
| F | flyspell-hydra/body | flyspell-hydra | |
#+name: keybindings-errors-extra
#+begin_src emacs-lisp :tangle no #+begin_src emacs-lisp :tangle no
"e" '(:ignore t :which-key "errors")
"e." '(hydra-flycheck/body :wk "hydra")
"el" #'counsel-flycheck
"ee" '(:keymap flycheck-command-map :package 'flycheck :wk "flycheck") "ee" '(:keymap flycheck-command-map :package 'flycheck :wk "flycheck")
"ef" '(:keymap flyspell-mode-map :package 'flyspell :wk "flyspell") "ef" '(:keymap flyspell-mode-map :package 'flyspell :wk "flyspell")
"eF" #'flyspell-hydra/body
#+end_src #+end_src
** Files ** Files
My keybinds for file manipulation are prefixed by ~f~. My keybindings for file manipulation are prefixed by ~f~.
#+name: keybinds-files #+name: keybindings-files
| Key | Function | Description | | Key | Function | Description | Package |
|-----+-------------------+-------------| |-----+-------------------+-------------+------------------|
| | | files | | | | files | |
| f | counsel-find-file | | | f | counsel-find-file | | counsel |
| F | quick-find-files | | | F | quick-find-files | | quick-find-files |
| h | hexl-find-file | | | h | hexl-find-file | | |
| r | counsel-recentf | | | r | counsel-recentf | | counsel |
| s | save-buffer | | | s | save-buffer | | |
I also have some keybinds dedicated to opening specific files. I also have some keybindings dedicated to opening specific files.
#+name: keybinds-specific-files #+name: keybindings-files-extras
#+begin_src emacs-lisp :tangle no #+begin_src emacs-lisp :tangle no
"fc" '((lambda () "fc" '((lambda ()
(interactive) (interactive)
(quick-find-files nil "~/org/config/docs/emacs" "org")) (quick-find-files nil "~/org/config/docs/emacs" "org"))
:wk "emacs config") :wk "emacs config"
:package quick-find-files)
"fC" '((lambda () "fC" '((lambda ()
(interactive) (interactive)
(quick-find-files nil "~/org/config/docs" "org")) (quick-find-files nil "~/org/config/docs" "org"))
:wk "general config") :wk "general config"
:package quick-find-files)
"fi" '((lambda () "fi" '((lambda ()
(interactive) (interactive)
(find-file (concat user-emacs-directory "init.el"))) (find-file (concat user-emacs-directory "init.el")))
@ -197,27 +262,49 @@ I also have some keybinds dedicated to opening specific files.
(quick-find-files nil (quick-find-files nil
(expand-file-name "lisp" user-emacs-directory) (expand-file-name "lisp" user-emacs-directory)
"el")) "el"))
:which-key "elisp config") :which-key "elisp config"
:package quick-find-files)
"fR" '((lambda () "fR" '((lambda ()
(interactive) (interactive)
(counsel-find-file "" (counsel-find-file ""
(concat user-emacs-directory (concat user-emacs-directory
(file-name-as-directory "straight") (file-name-as-directory "straight")
(file-name-as-directory "repos")))) (file-name-as-directory "repos"))))
:which-key "straight package") :which-key "straight package"
:package counsel)
"fS" '((lambda () "fS" '((lambda ()
(interactive) (interactive)
(find-file "~/org/config/stumpwm.org")) (find-file "~/org/config/stumpwm.org"))
:which-key "stumpwm.org") :which-key "stumpwm.org")
#+end_src #+end_src
** Git
#+name: keybindings-git
| Key | Function | Description | Package |
|-----+---------------------+-------------+---------|
| | | git | |
| b | magit-blame | | magit |
| c | magit-clone | | magit |
| d | magit-dispatch | | magit |
| i | magit-init | | magit |
| s | magit-status | | magit |
| l | magit-log | | magit |
| y | my/yadm | | magit |
| S | magit-stage-file | | magit |
| U | magit-unstage-file | | magit |
| f | | file | |
| fd | magit-diff | | magit |
| fc | magit-file-checkout | | magit |
| fl | magit-file-dispatch | | magit |
| fF | magit-find-file | | magit |
** Help ** Help
My keybinds for help are prefixed by ~h~. My keybindings for help are prefixed by ~h~.
#+name: keybinds-help #+name: keybindings-help
| Key | Function | Description | | Key | Function | Description |
|-----+--------------------------+-------------| |-----+--------------------------+-------------|
| | | help | | | | help |
| k | which-key-show-top-level | | | k | which-key-show-top-level | which-key |
| i | info | | | i | info | |
| I | info-display-manual | | | I | info-display-manual | |
| d | | describe | | d | | describe |
@ -232,82 +319,125 @@ My keybinds for help are prefixed by ~h~.
| ds | helpful-symbol | | | ds | helpful-symbol | |
| dv | helpful-variable | | | dv | helpful-variable | |
** Insert
#+name: keybindings-insert
| Key | Function | Description | Package |
|-----+----------------------+-------------+-----------|
| | | insert | |
| u | counsel-unicode-char | | counsel |
| y | ivy-yasnippet | | yasnippet |
** Jump ** Jump
My keybinds for jumping around are prefixed by ~j~. My keybindings for jumping around are prefixed by ~j~.
#+name: keybinds-jump #+name: keybindings-jump
| Key | Function | Description | | Key | Function | Description | Package |
|-----+-------------------------+-------------| |-----+-------------------------------+-------------+---------|
| | | jump | | | | jump | |
| f | counsel-file-jump | | | C | | avy copy | |
| d | dirvish-dwim | | | Cl | avy-copy-line | | avy |
| D | dired-jump-other-window | | | Cr | avy-copy-region | | avy |
| D | dired-jump-other-window | | |
| U | my/avy-open-url | open-url | avy |
| b | avy-pop-mark | | avy |
| c | evil-avy-goto-char-timer | | avy |
| d | dirvish-dwim | | dirvish |
| f | counsel-file-jump | | counsel |
| k | | avy kill | |
| kL | avy-kill-ring-save-whole-line | | avy |
| kR | avy-kill-ring-save-region | | avy |
| kl | avy-kill-whole-line | | avy |
| kr | avy-kill-region | | avy |
| l | avy-goto-line | | avy |
| m | | move | |
| ml | avy-move-line | | avy |
| mr | avy-move-region | | avy |
| mt | avy-transpose-lines-in-region | | avy |
| n | avy-next | | avy |
| p | avy-prev | | avy |
| u | my/avy-goto-url | goto-url | avy |
** Language
#+name: keybindings-language
| Key | Function | Description | Package |
|-----+----------------------------------+-------------+----------|
| | | language | |
| B | langtool-correct-buffer | | langtool |
| b | langtool-check-buffer | | langtool |
| c | langtool-check | | langtool |
| C | langtool-correct-at-point | | langtool |
| d | langtool-check-done | | langtool |
| l | langtool-switch-default-language | | langtool |
| p | langtool-show-message-at-point | | langtool |
| r | langtool-correct-region | | langtool |
** Media
#+name: keybindings-media
| Key | Function | Description | Package |
|-----+-----------------------------+----------------+---------|
| | | media | |
| . | hydra-media/body | hydra-media | emms |
| « | emms-player-mpd-previous | | emms |
| » | emms-player-mpd-next | | emms |
| c | emms-player-mpd-clear | | emms |
| e | | emms | |
| eb | emms-browser | | emms |
| ep | emms-playlist-mode-go | | emms |
| es | emms-player-mpd-show | | emms |
| p | my/mpc-toggle | mpd-play-pause | |
| s | emms-stop | | emms |
| u | | update | |
| um | emms-player-mpd-update-all | | emms |
| uc | emms-cache-set-from-mpd-all | | emm s |
** Project ** Project
My keybinds for my projects are prefixed by ~p~. My keybindings for my projects are prefixed by ~p~.
#+name: keybinds-project #+name: keybindings-project
| Key | Function | Description | | Key | Function | Description | Package |
|-----+--------------------------------------------+-------------| |-----+--------------------------------------------+-------------+------------|
| | | project | | | | project | |
| ! | projectile-run-shell-command-in-root | | | ! | projectile-run-shell-command-in-root | | projectile |
| & | projectile-run-async-shell-command-in-root | | | & | projectile-run-async-shell-command-in-root | | projectile |
| b | counsel-projectile-switch-to-buffer | | | b | counsel-projectile-switch-to-buffer | | counsel |
| c | counsel-projectile | | | c | counsel-projectile | | counsel |
| d | counsel-projectile-find-dir | | | d | counsel-projectile-find-dir | | counsel |
| e | projectile-edit-dir-locals | | | e | projectile-edit-dir-locals | | projectile |
| f | counsel-projectile-find-file | | | f | counsel-projectile-find-file | | counsel |
| g | projectile-find-tag | | | g | projectile-find-tag | | projectile |
| k | project-kill-buffers | | | k | project-kill-buffers | | |
| p | counsel-projectile-switch-project | | | p | counsel-projectile-switch-project | | cousel |
| t | ivy-magit-todos | | | v | projectile-vc | | projectile |
| v | projectile-vc | |
*** Treemacs ** Refactor
#+name: keybindings-refactor
| Key | Function | Description | Package |
|-----+----------------------------------+-----------------+------------------|
| | | refactor | |
| i | evil-iedit-state/iedit-mode | iedit-mode | evil-iedit-state |
| q | evil-iedit-state/quit-iedit-mode | quit-iedit-mode | evil-iedit-state |
#+name: treemacs-keybinds ** Org
| Key | Function | Description | #+name: keybindings-org
|-----+----------------------------------------+-------------| | Key | Function | Description | Package |
| | | treemacs | |-----+--------------------------------+-------------+----------|
| c | | create | | | | org | |
| cd | treemacs-create-dir | | | c | org-capture | | org |
| cf | treemacs-create-file | | | r | | roam | |
| ci | treemacs-create-icon | | | rb | org-mark-ring-goto | back | org-roam |
| ct | treemacs-create-theme | | | rB | org-roam-buffer-toggle | | org-roam |
| cw | treemacs-create-workspace | | | rn | | nodes | |
| d | treemacs-delete-file | | | rnf | org-roam-node-find | | org-roam |
| f | | files | | rni | org-roam-node-insert | | org-roam |
| ff | treemacs-find-file | | | rno | org-roam-node-open | | org-roam |
| ft | treemacs-find-tag | | | rnr | org-roam-node-random | | org-roam |
| l | | lsp | | rnv | org-roam-node-visit | | org-roam |
| ls | treemacs-expand-lsp-symbol | | | rs | | sync | |
| ld | treemacs-expand-lsp-treemacs-deps | | | rsa | org-roam-db-autosync-mode | | org-roam |
| lD | treemacs-collapse-lsp-treemacs-deps | | | rsc | org-roam-db-clear-all | | org-roam |
| lS | treemacs-collapse-lsp-symbol | | | rsd | org-roam-db-diagnose-node | | org-roam |
| p | | projects | | rss | org-roam-db-sync | | org-roam |
| pa | treemacs-add-project-to-workspace | | | ru | | ui | |
| pf | treemacs-project-follow-mode | | | rua | org-roam-ui-add-to-local-graph | | org-roam |
| pn | treemacs-project-of-node | | | ruo | org-roam-ui-open | | org-roam |
| pp | treemacs-project-at-point | |
| pr | treemacs-remove-project-from-workspace | |
| pt | treemacs-move-project-down | |
| ps | treemacs-move-project-up | |
| r | | rename |
| rf | treemacs-rename-file | |
| rp | treemacs-rename-project | |
| rr | treemacs-rename | |
| rw | treemacs-rename-workspace | |
| t | treemacs | |
| T | | toggles |
| Td | treemacs-toggle-show-dotfiles | |
| Tn | treemacs-toggle-node | |
| v | | visit node |
| va | treemacs-visit-node-ace | |
| vc | treemacs-visit-node-close-treemacs | |
| vn | treemacs-visit-node-default | |
| y | | yank |
| ya | treemacs-copy-absolute-path-at-point | |
| yp | treemacs-copy-project-path-at-point | |
| yr | treemacs-copy-relative-path-at-point | |
| yf | treemacs-copy-file | |
** Tabs ** Tabs
Emacs has native tabs available, which can be interesting when working Emacs has native tabs available, which can be interesting when working
@ -315,8 +445,8 @@ on multiple projects at once between which we may want to switch. Tabs
allow the user not to have multiple frames while keeping the allow the user not to have multiple frames while keeping the
advantages of having multiple frames. advantages of having multiple frames.
My keybinds are prefixed by ~SPC TAB~. My keybindings are prefixed by ~SPC TAB~.
#+name: keybinds-tabs #+name: keybindings-tabs
| Key | Function | Description | | Key | Function | Description |
|-----+--------------+-------------| |-----+--------------+-------------|
| | | tabs | | | | tabs |
@ -332,18 +462,20 @@ My keybinds are prefixed by ~SPC TAB~.
** Text ** Text
The prefix here is ~T~. The prefix here is ~T~.
#+name: keybinds-text #+name: keybindings-text
| Key | Function | Description | | Key | Function | Description | Package |
|-----+----------------------+-------------| |-----+----------------------+-------------+----------------------|
| | | text | | | | text | |
| e | string-edit-at-point | | | e | string-edit-at-point | | string-edit-at-point |
| u | downcase-region | | | u | downcase-region | | |
| U | upcase-region | | | U | upcase-region | | |
| z | hydra-zoom/body | | | z | hydra-zoom/body | | |
*** TODO Rewrite hydra-zoom :noexport:
** Toggles ** Toggles
My toggle keybinds are prefixed by ~t~. My toggle keybindings are prefixed by ~t~.
#+name: keybinds-toggle #+name: keybindings-toggle
| Key | Function | Description | | Key | Function | Description |
|-----+---------------------------------------+--------------| |-----+---------------------------------------+--------------|
| | | toggles | | | | toggles |
@ -357,42 +489,44 @@ My toggle keybinds are prefixed by ~t~.
| it | toggle-input-method | | | it | toggle-input-method | |
| is | set-input-method | | | is | set-input-method | |
*** TODO Rewrite =my/modify-frame-alpha-background/body= :noexport:
** Windows ** Windows
A couple of keybinds are hidden from which-key, otherwise theres not A couple of keybindings are hidden from which-key, otherwise theres not
much to say. The prefix here is ~w~. much to say. The prefix here is ~w~.
#+name: keybinds-windows #+name: keybindings-windows
| Key | Function | Description | | Key | Function | Description | Package |
|-----+-------------------------------+-------------| |-----+-------------------------------+-------------+----------------|
| | | windows | | | | windows | |
| c | evil-window-left | | | c | evil-window-left | | evil |
| t | evil-window-down | | | t | evil-window-down | | evil |
| s | evil-window-up | | | s | evil-window-up | | evil |
| r | evil-window-right | | | r | evil-window-right | | evil |
| . | windows-adjust-size/body | | | . | windows-adjust-size/body | | |
| - | split-window-below-and-focus | | | - | split-window-below-and-focus | | |
| / | split-window-right-and-focus | | | / | split-window-right-and-focus | | |
| $ | winum-select-window-by-number | | | $ | winum-select-window-by-number | | winum |
| 0 | winum-select-window-0-or-10 | none | | 0 | winum-select-window-0-or-10 | none | winum |
| 1 | winum-select-window-1 | none | | 1 | winum-select-window-1 | none | winum |
| 2 | winum-select-window-2 | none | | 2 | winum-select-window-2 | none | winum |
| 3 | winum-select-window-3 | none | | 3 | winum-select-window-3 | none | winum |
| 4 | winum-select-window-4 | none | | 4 | winum-select-window-4 | none | winum |
| 5 | winum-select-window-5 | none | | 5 | winum-select-window-5 | none | winum |
| 6 | winum-select-window-6 | none | | 6 | winum-select-window-6 | none | winum |
| 7 | winum-select-window-7 | none | | 7 | winum-select-window-7 | none | winum |
| 8 | winum-select-window-8 | none | | 8 | winum-select-window-8 | none | winum |
| 9 | winum-select-window-9 | none | | 9 | winum-select-window-9 | none | winum |
| b | kill-buffer-and-delete-window | | | b | kill-buffer-and-delete-window | | |
| d | delete-window | | | d | delete-window | | |
| o | other-window | | | o | other-window | | |
| D | delete-other-windows | | | D | delete-other-windows | | |
| w | | writeroom | | w | | writeroom | |
| w. | writeroom-buffer-width/body | | | w. | writeroom-buffer-width/body | | writeroom-mode |
| ww | writeroom-mode | | | ww | writeroom-mode | | writeroom-mode |
** Quit ** Quit
Why would I ever use any of these keybinds? They are prefixed with ~q~. Why would I ever use any of these keybindings? They are prefixed with ~q~.
#+name: keybinds-quit #+name: keybindings-quit
| Key | Function | Description | | Key | Function | Description |
|-----+----------------------------+-------------| |-----+----------------------------+-------------|
| | | quit | | | | quit |

View File

@ -1112,6 +1112,9 @@ configuration [[file:mpd.org][here]]).
<<emms-search-set-variable>> <<emms-search-set-variable>>
<<emms-media-hydra>> <<emms-media-hydra>>
(defun my/mpc-toggle ()
(interactive)
(shell-command-and-echo "mpc toggle"))
(defun emms-player-toggle-pause () (defun emms-player-toggle-pause ()
(interactive) (interactive)
(shell-command-and-echo "mpc toggle")) (shell-command-and-echo "mpc toggle"))
@ -1153,27 +1156,7 @@ configuration [[file:mpd.org][here]]).
:packages 'emms :packages 'emms
"d" #'emms-playlist-mode-kill-track "d" #'emms-playlist-mode-kill-track
"p" #'emms-playlist-mode-play-smart "p" #'emms-playlist-mode-play-smart
"q" #'kill-this-buffer) "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))
#+end_src #+end_src
*** Finding files from EMMS *** Finding files from EMMS
@ -1401,25 +1384,7 @@ doing and what Git is doing! In short, I absolutely love it!
:packages 'magit :packages 'magit
"," #'with-editor-finish "," #'with-editor-finish
"k" #'with-editor-cancel "k" #'with-editor-cancel
"a" #'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))
#+end_src #+end_src
There is currently a bug in Emacs TRAMP as described in issue [[https://github.com/magit/magit/issues/4720][#4720]] of 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 (use-package hl-todo
:defer t :defer t
:straight (:build t) :straight (:build t)
:init (global-hl-todo-mode 1) :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))
#+end_src #+end_src
We can now configure properly =magit-todos=. Notice my custom function We can now configure properly =magit-todos=. Notice my custom function
@ -1617,12 +1575,7 @@ look nice.
:type git :type git
:host github :host github
:repo "tecosaur/screenshot") :repo "tecosaur/screenshot")
:config (load-file (locate-library "screenshot.el")) :config (load-file (locate-library "screenshot.el")))
:general
(phundrak/leader-key
:infix "a"
:packages '(screenshot)
"S" #'screenshot))
#+end_src #+end_src
** Shells ** Shells

View File

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

View File

@ -75,11 +75,6 @@ compatibility package that adds states for iedit.
iedit-only-at-symbol-boundaries t iedit-only-at-symbol-boundaries t
iedit-toggle-key-default nil) iedit-toggle-key-default nil)
:general :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 (general-define-key
:keymaps 'evil-iedit-state-map :keymaps 'evil-iedit-state-map
"c" nil "c" nil

View File

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

View File

@ -49,31 +49,6 @@ it bépo-compatible.
:pakages 'avy :pakages 'avy
"gc" #'evil-avy-goto-char-timer "gc" #'evil-avy-goto-char-timer
"gl" #'evil-avy-goto-line) "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 (phundrak/major-leader-key
:packages '(avy org) :packages '(avy org)
:keymaps 'org-mode-map :keymaps 'org-mode-map

View File

@ -327,17 +327,6 @@ specified org files which are described below.
(defvar org-worldbuilding-file "~/org/worldbuilding.org") (defvar org-worldbuilding-file "~/org/worldbuilding.org")
#+end_src #+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 When ~org-capture~ is invoked, it will ask which template we wish to
use. In the table [[org-capture-shortcuts-table]], the /key/ column use. In the table [[org-capture-shortcuts-table]], the /key/ column
represents which keychord we need to hit, titled with /name/, we need to represents which keychord we need to hit, titled with /name/, we need to
@ -1060,26 +1049,6 @@ management system based on org-mode.
:config :config
(org-roam-db-autosync-mode 1) (org-roam-db-autosync-mode 1)
:general :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 (phundrak/major-leader-key
:keymaps 'org-mode-map :keymaps 'org-mode-map
:packages '(org org-roam) :packages '(org org-roam)

View File

@ -338,20 +338,7 @@ in quite a few languages.
:config :config
(setq langtool-java-classpath (string-join '("/usr/share/languagetool" (setq langtool-java-classpath (string-join '("/usr/share/languagetool"
"/usr/share/java/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 #+end_src
Finally, =writegood-mode= detects some simple general rules when writing Finally, =writegood-mode= detects some simple general rules when writing