Tweak the consult setup and add a key-binding table

This commit is contained in:
Gerard Vermeulen 2021-12-28 08:38:29 +01:00
parent b04c75545c
commit e1715c2e3e

View File

@ -615,9 +615,56 @@ Listing [[lst:enable-marginalia-mode]] enables =marginalia-mode=.
Listing [[lst:configure-consult]] configures =consult=. Listing [[lst:configure-consult]] configures =consult=.
#+attr_latex: :booktabs yes :float table
#+caption[Configuration specific key binding]:
#+caption: Configuration specific key-bindings.
#+name: tab:configuration-specific-key-bindings
|-------------------------------+---------------------+------------------------|
| command | keys | key map |
|-------------------------------+---------------------+------------------------|
| =consult-apropos= | {{{kbd(<help> a)}}} | =global-map= |
| =consult-bookmark= | {{{kbd(C-x r b)}}} | =ctl-x-keymap= |
| =consult-buffer-other-frame= | {{{kbd(C-x 5 b)}}} | =ctl-x-keymap= |
| =consult-buffer-other-window= | {{{kbd(C-x 4 b)}}} | =ctl-x-keymap= |
| =consult-buffer= | {{{kbd(C-x b)}}} | =ctl-x-keymap= |
| =consult-compile-error= | {{{kbd(M-g e)}}} | =goto-map= |
| =consult-complex-command= | {{{kbd(C-x M-:)}}} | =ctl-x-keymap= |
| =consult-find= | {{{kbd(M-s f)}}} | =search-map= |
| =consult-focus-lines= | {{{kbd(M-s u)}}} | =search-map= |
| =consult-git-grep= | {{{kbd(M-s g)}}} | =search-map= |
| =consult-global-mark= | {{{kbd(M-g k)}}} | =goto-map= |
| =consult-goto-line= | {{{kbd(M-g M-g)}}} | =goto-map= |
| =consult-goto-line= | {{{kbd(M-g g)}}} | =goto-map= |
| =consult-history= | {{{kbd(C-c h)}}} | =global-map= |
| =consult-imenu-project= | {{{kbd(M-g i)}}} | =goto-map= |
| =consult-keep-lines= | {{{kbd(M-s k)}}} | =search-map= |
| =consult-line= | {{{kbd(M-s l)}}} | =search-map= |
| =consult-mark= | {{{kbd(M-g m)}}} | =goto-map= |
| =consult-mode-command= | {{{kbd(C-c m)}}} | =global-map= |
| =consult-multi-occur= | {{{kbd(M-s m)}}} | =search-map= |
| =consult-outline= | {{{kbd(M-g o)}}} | =goto-map= |
| =consult-register= | {{{kbd(C-x r x)}}} | =ctl-x-keymap= |
| =consult-yank-pop= | {{{kbd(M-y)}}} | =global-map= |
|-------------------------------+---------------------+------------------------|
| =elfeed= | {{{kbd(C-x w)}}} | =global-map= |
| =embark-act= | {{{kbd(C-\,)}}} | =global-map= |
| =embark-bindings= | {{{kbd(C-h B)}}} | =global-map= |
| =embark-dwim= | {{{kbd(C-:)}}} | =global-map= |
| =iedit-mode= | {{{kbd(C-;)}}} | =global-map= |
| =minibuffer-complete-history= | {{{kbd(C-<tab>)}}} | =minibuffer-local-map= |
| =narrow-or-widen-dwim= | {{{kbd(C-x C-n)}}} | =ctl-x-keymap= |
| =org-agenda= | {{{kbd(C-c a)}}} | =global-map= |
| =org-capture= | {{{kbd(C-c c)}}} | =global-map= |
| =org-cite= | {{{kbd(C-c b)}}} | =org-mode-map= |
| =org-insert-link-global= | {{{kbd(C-c C-l)}}} | =global-map= |
| =org-narrow-to-table= | {{{kbd(C-x n t)}}} | =ctl-x-keymap= |
| =org-store-link= | {{{kbd(C-c l)}}} | =global-map= |
|-------------------------------+---------------------+------------------------|
#+caption[Configure =consult=]: #+caption[Configure =consult=]:
#+caption: Configure =consult=. #+caption: Configure =consult=.
#+label: lst:configure-consult #+name: lst:configure-consult
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (unless noninteractive
(when (fboundp 'consult-apropos) (when (fboundp 'consult-apropos)
@ -627,27 +674,27 @@ Listing [[lst:configure-consult]] configures =consult=.
(global-set-key (kbd "C-c h") #'consult-history) (global-set-key (kbd "C-c h") #'consult-history)
(global-set-key (kbd "C-c m") #'consult-mode-command) (global-set-key (kbd "C-c m") #'consult-mode-command)
;; C-x bindings (ctl-x-map) ;; C-x bindings (ctl-x-map)
(global-set-key (kbd "C-x M-:") #'consult-complex-command) (define-key ctl-x-map (kbd "M-:") #'consult-complex-command)
(global-set-key (kbd "C-x b") #'consult-buffer) (define-key ctl-x-map (kbd "b") #'consult-buffer)
(global-set-key (kbd "C-x 4 b") #'consult-buffer-other-window) (define-key ctl-x-map (kbd "4 b") #'consult-buffer-other-window)
(global-set-key (kbd "C-x 5 b") #'consult-buffer-other-frame) (define-key ctl-x-map (kbd "5 b") #'consult-buffer-other-frame)
(global-set-key (kbd "C-x r x") #'consult-register) (define-key ctl-x-map (kbd "r x") #'consult-register)
(global-set-key (kbd "C-x r b") #'consult-bookmark) (define-key ctl-x-map (kbd "r b") #'consult-bookmark)
;; M-g bindings (goto-map) ;; M-g bindings (goto-map)
(global-set-key (kbd "M-g g") #'consult-goto-line) (define-key goto-map (kbd "g") #'consult-goto-line)
(global-set-key (kbd "M-g M-g") #'consult-goto-line) (define-key goto-map (kbd "M-g") #'consult-goto-line)
(global-set-key (kbd "M-g o") #'consult-outline) (define-key goto-map (kbd "o") #'consult-outline)
(global-set-key (kbd "M-g m") #'consult-mark) (define-key goto-map (kbd "m") #'consult-mark)
(global-set-key (kbd "M-g k") #'consult-global-mark) (define-key goto-map (kbd "k") #'consult-global-mark)
(global-set-key (kbd "M-g i") #'consult-imenu-project) (define-key goto-map (kbd "i") #'consult-imenu-project)
(global-set-key (kbd "M-g e") #'consult-error) (define-key goto-map (kbd "e") #'consult-compile-error)
;; M-s bindings (search-map) ;; M-s bindings (search-map)
(global-set-key (kbd "M-s g") #'consult-git-grep) (define-key search-map (kbd "g") #'consult-git-grep)
(global-set-key (kbd "M-s f") #'consult-find) (define-key search-map (kbd "f") #'consult-find)
(global-set-key (kbd "M-s k") #'consult-keep-lines) (define-key search-map (kbd "k") #'consult-keep-lines)
(global-set-key (kbd "M-s l") #'consult-line) (define-key search-map (kbd "l") #'consult-line)
(global-set-key (kbd "M-s m") #'consult-multi-occur) (define-key search-map (kbd "m") #'consult-multi-occur)
(global-set-key (kbd "M-s u") #'consult-focus-lines) (define-key search-map (kbd "u") #'consult-focus-lines)
;; Other bindings ;; Other bindings
(global-set-key (kbd "M-y") #'consult-yank-pop) (global-set-key (kbd "M-y") #'consult-yank-pop)
(global-set-key (kbd "<help> a") #'consult-apropos) (global-set-key (kbd "<help> a") #'consult-apropos)