From 7725ff1dce70a5a0f9611eba66511d8b3e168e45 Mon Sep 17 00:00:00 2001 From: Vedang Manerikar <ved.manerikar@gmail.com> Date: Sun, 17 Nov 2024 07:55:24 +0530 Subject: [PATCH] Copy over bindings from consult's README --- unravel-emacs.org | 29 ++++++++++++++++++++++----- unravel-modules/unravel-completion.el | 27 +++++++++++++++++++++---- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/unravel-emacs.org b/unravel-emacs.org index 583b83f..7e932ca 100644 --- a/unravel-emacs.org +++ b/unravel-emacs.org @@ -1577,7 +1577,7 @@ Also see [[#h:567bb00f-1d82-4746-93e5-e0f60721728a][the =prot-emacs-completion.e :END: #+begin_quote -consult~ is another wonderful package by Daniel Mendler. It provides +~consult~ is another wonderful package by Daniel Mendler. It provides a number of commands that turbocharge the minibuffer with advanced capabilities for filtering, asynchronous input, and previewing of the current candidate's context. @@ -1626,18 +1626,37 @@ Also check: [[#h:e0f9c30e-3a98-4479-b709-7008277749e4][The =unravel-search.el= m :hook (completion-list-mode . consult-preview-at-point-mode) :bind (:map global-map - ("M-g M-g" . consult-goto-line) ("M-K" . consult-keep-lines) ; M-S-k is similar to M-S-5 (M-%) - ("M-F" . consult-focus-lines) ; same principle + ("M-F" . consult-focus-lines) ; same principle ("M-s M-b" . consult-buffer) - ("M-s M-f" . consult-find) - ("M-s M-g" . consult-grep) + ("M-s M-f" . consult-fd) + ("M-s M-g" . consult-ripgrep) ("M-s M-h" . consult-history) ("M-s M-i" . consult-imenu) ("M-s M-l" . consult-line) ("M-s M-m" . consult-mark) ("M-s M-y" . consult-yank-pop) ("M-s M-s" . consult-outline) + ;; C-x bindings in `ctl-x-map' + ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command + ("C-x b" . consult-buffer) ;; orig. switch-to-buffer + ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window + ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame + ("C-x t b" . consult-buffer-other-tab) ;; orig. switch-to-buffer-other-tab + ("C-x r b" . consult-bookmark) ;; orig. bookmark-jump + ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer + ;; Custom M-# bindings for fast register access + ("M-#" . consult-register-load) + ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) + ("C-M-#" . consult-register) + ;; Other custom bindings + ("M-y" . consult-yank-pop) ;; orig. yank-pop + ;; M-g bindings in `goto-map' + ("M-g e" . consult-compile-error) + ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck + ("M-g g" . consult-goto-line) ;; orig. goto-line + ("M-g M-g" . consult-goto-line) ;; orig. goto-line + ("M-g o" . consult-outline) ;; Alternative: consult-org-heading :map consult-narrow-map ("?" . consult-narrow-help)) :config diff --git a/unravel-modules/unravel-completion.el b/unravel-modules/unravel-completion.el index 5b7a175..157cda5 100644 --- a/unravel-modules/unravel-completion.el +++ b/unravel-modules/unravel-completion.el @@ -194,18 +194,37 @@ :hook (completion-list-mode . consult-preview-at-point-mode) :bind (:map global-map - ("M-g M-g" . consult-goto-line) ("M-K" . consult-keep-lines) ; M-S-k is similar to M-S-5 (M-%) - ("M-F" . consult-focus-lines) ; same principle + ("M-F" . consult-focus-lines) ; same principle ("M-s M-b" . consult-buffer) - ("M-s M-f" . consult-find) - ("M-s M-g" . consult-grep) + ("M-s M-f" . consult-fd) + ("M-s M-g" . consult-ripgrep) ("M-s M-h" . consult-history) ("M-s M-i" . consult-imenu) ("M-s M-l" . consult-line) ("M-s M-m" . consult-mark) ("M-s M-y" . consult-yank-pop) ("M-s M-s" . consult-outline) + ;; C-x bindings in `ctl-x-map' + ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command + ("C-x b" . consult-buffer) ;; orig. switch-to-buffer + ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window + ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame + ("C-x t b" . consult-buffer-other-tab) ;; orig. switch-to-buffer-other-tab + ("C-x r b" . consult-bookmark) ;; orig. bookmark-jump + ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer + ;; Custom M-# bindings for fast register access + ("M-#" . consult-register-load) + ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) + ("C-M-#" . consult-register) + ;; Other custom bindings + ("M-y" . consult-yank-pop) ;; orig. yank-pop + ;; M-g bindings in `goto-map' + ("M-g e" . consult-compile-error) + ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck + ("M-g g" . consult-goto-line) ;; orig. goto-line + ("M-g M-g" . consult-goto-line) ;; orig. goto-line + ("M-g o" . consult-outline) ;; Alternative: consult-org-heading :map consult-narrow-map ("?" . consult-narrow-help)) :config