Move completion related packages from configuration.org to init.el

This commit is contained in:
Gergely Polonkai 2025-06-03 17:36:14 +02:00
parent 1cadc1fd67
commit 91404b3196
No known key found for this signature in database
GPG Key ID: 38F402C8471DDE93
2 changed files with 131 additions and 163 deletions

View File

@ -88,169 +88,6 @@ Rainbow to the stars…
("K" . dired-k)))
#+end_src
* Completion related external packages
** ~vertico~
#+begin_src emacs-lisp
(use-package vertico
:init
(vertico-mode))
#+end_src
** ~consult~
#+begin_src emacs-lisp
(use-package consult
:bind (:map global-map
([remap Info-search] . consult-info)
("M-y" . consult-yank-pop)
:map ctl-x-map
("M-:" . consult-complex-command)
("4 b" . consult-buffer-other-window)
("5 b" . consult-buffer-other-frame)
("b" . consult-buffer)
("r b" . consult-bookmark)
("x b" . consult-project-buffer)
:map goto-map
("e" . consult-compile-error)
("F" . consult-flymake)
("g" . consult-goto-line)
("M-g" . consult-goto-line)
("i" . consult-imenu)
("I" . consult-imenu-multi)
("k" . consult-global-mark)
("m" . consult-mark)
("o" . consult-org-heading)
:map search-map
("d" . consult-find)
("D" . consult-locate)
("e" . consult-isearch-history)
("k" . consult-keep-lines)
("l" . consult-line)
("L" . consult-line-multi)
:map isearch-mode-map
("M-e" . consult-isearch-history)
:map minibuffer-local-map
("M-s" . consult-history)
("M-r" . consult-history))
:hook
(completion-list-mode . consult-preview-at-point-mode)
:custom
(consult-narrow-key "<")
(consult-project-function (lambda (_) (projectile-project-root)))
(register-preview-delay 0.5)
(xref-show-xrefs-function #'consult-xref)
(xref-show-definitions-function #'consult-xref)
:init
(setq register-preview-function #'consult-register-format)
(advice-add #'register-preview :override #'consult-register-window)
:config
(defalias 'consult-line-thing-at-point 'consult-line)
(consult-customize
consult-theme :preview-key '(:debounce 0.2 any)
consult-buffer :preview-key "M-."
consult-line-thing-at-point :initial (thing-at-point 'symbol)
consult-ripgrep
consult-git-grep
consult-grep
consult-bookmark
consult-recent-file
consult-xref
consult--source-bookmark
consult--source-file-register
consult--source-recent-file
consult--source-project-recent-file
:preview-key '(:debounce 0.4 any))
(autoload 'projectile-project-root "projectile"))
#+end_src
** ~orderless~
#+begin_src emacs-lisp
(use-package orderless
:init
(setq completion-category-defaults nil)
:custom
(completion-styles '(orderless basic))
(completion-category-defaults nil)
(completion-category-overrides '((file (styles basic partial-completion)))))
#+end_src
** ~marginalia~
#+begin_src emacs-lisp
(use-package marginalia
:bind (:map minibuffer-local-map
("M-A" . marginalia-cycle))
:init
(marginalia-mode))
#+end_src
** ~embark~
#+begin_src emacs-lisp
(use-package embark
:bind (:map global-map
("C-." . embark-act))
:config
(add-to-list 'display-buffer-alist
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
nil
(window-parameters (mode-line-format . none)))))
(use-package embark-consult
:hook
(embark-collect-mode . consult-preview-at-point-mode))
#+end_src
** ~consult-projectile~
#+begin_src emacs-lisp
(use-package consult-projectile
:demand t
:after (:all projectile consult embark)
:config
(defvar-keymap embark-consult-projectile-project-map
:doc "Keymap to use for the projectile menu"
:parent embark-general-map
"g" #'magit-status)
(add-to-list 'embark-keymap-alist '(consult-projectile-project embark-consult-projectile-project-map))
(autoload 'magit-status "magit")
:bind (:map projectile-command-map
("p" . consult-projectile-switch-project)))
#+end_src
** ~corfu~
#+begin_src emacs-lisp
(use-package corfu
:init
(global-corfu-mode)
:custom
(corfu-cycle t)
(corfu-separator ?\s))
#+end_src
** ~cape~
#+begin_src emacs-lisp
(defvar gpolonkai/completion-at-point-map (make-sparse-keymap)
"Map for traspose functions.")
(define-prefix-command 'gpolonkai/completion-at-point-map)
(use-package cape
:bind (:map gpolonkai/completion-at-point-map
("p" . completion-at-point)
:map gpolonkai/pers-map
("p" . gpolonkai/completion-at-point-map))
:init
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-file)
(add-to-list 'completion-at-point-functions #'cape-elisp-block)
(add-to-list 'completion-at-point-functions #'cape-elisp-symbol))
#+end_src
* Mailing
** Set up whitespace handling in mu4e buffers

131
init.el
View File

@ -1245,6 +1245,137 @@ order."
:bind
(([f6] . git-timemachine-toggle)))
;; Completion related external packages
(use-package vertico
:init
(vertico-mode))
(use-package consult
:bind (:map global-map
([remap Info-search] . consult-info)
("M-y" . consult-yank-pop)
:map ctl-x-map
("M-:" . consult-complex-command)
("4 b" . consult-buffer-other-window)
("5 b" . consult-buffer-other-frame)
("b" . consult-buffer)
("r b" . consult-bookmark)
("x b" . consult-project-buffer)
:map goto-map
("e" . consult-compile-error)
("F" . consult-flymake)
("g" . consult-goto-line)
("M-g" . consult-goto-line)
("i" . consult-imenu)
("I" . consult-imenu-multi)
("k" . consult-global-mark)
("m" . consult-mark)
("o" . consult-org-heading)
:map search-map
("d" . consult-find)
("D" . consult-locate)
("e" . consult-isearch-history)
("k" . consult-keep-lines)
("l" . consult-line)
("L" . consult-line-multi)
:map isearch-mode-map
("M-e" . consult-isearch-history)
:map minibuffer-local-map
("M-s" . consult-history)
("M-r" . consult-history))
:hook
(completion-list-mode . consult-preview-at-point-mode)
:custom
(consult-narrow-key "<")
(consult-project-function (lambda (_) (projectile-project-root)))
(register-preview-delay 0.5)
(xref-show-xrefs-function #'consult-xref)
(xref-show-definitions-function #'consult-xref)
:init
(setq register-preview-function #'consult-register-format)
(advice-add #'register-preview :override #'consult-register-window)
:config
(defalias 'consult-line-thing-at-point 'consult-line)
(consult-customize
consult-theme :preview-key '(:debounce 0.2 any)
consult-buffer :preview-key "M-."
consult-line-thing-at-point :initial (thing-at-point 'symbol)
consult-ripgrep
consult-git-grep
consult-grep
consult-bookmark
consult-recent-file
consult-xref
consult--source-bookmark
consult--source-file-register
consult--source-recent-file
consult--source-project-recent-file
:preview-key '(:debounce 0.4 any))
(autoload 'projectile-project-root "projectile"))
(use-package orderless
:init
(setq completion-category-defaults nil)
:custom
(completion-styles '(orderless basic))
(completion-category-defaults nil)
(completion-category-overrides '((file (styles basic partial-completion)))))
(use-package marginalia
:bind (:map minibuffer-local-map
("M-A" . marginalia-cycle))
:init
(marginalia-mode))
(use-package embark
:bind (:map global-map
("C-." . embark-act))
:config
(add-to-list 'display-buffer-alist
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
nil
(window-parameters (mode-line-format . none)))))
(use-package embark-consult
:hook
(embark-collect-mode . consult-preview-at-point-mode))
(use-package consult-projectile
:demand t
:after (:all projectile consult embark)
:config
(defvar-keymap embark-consult-projectile-project-map
:doc "Keymap to use for the projectile menu"
:parent embark-general-map
"g" #'magit-status)
(add-to-list 'embark-keymap-alist '(consult-projectile-project embark-consult-projectile-project-map))
(autoload 'magit-status "magit")
:bind (:map projectile-command-map
("p" . consult-projectile-switch-project)))
(use-package corfu
:init
(global-corfu-mode)
:custom
(corfu-cycle t)
(corfu-separator ?\s))
(defvar gpolonkai/completion-at-point-map (make-sparse-keymap)
"Map for traspose functions.")
(define-prefix-command 'gpolonkai/completion-at-point-map)
(use-package cape
:bind (:map gpolonkai/completion-at-point-map
("p" . completion-at-point)
:map gpolonkai/pers-map
("p" . gpolonkai/completion-at-point-map))
:init
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-file)
(add-to-list 'completion-at-point-functions #'cape-elisp-block)
(add-to-list 'completion-at-point-functions #'cape-elisp-symbol))
;; I started moving my configuration to this Org file. Its easier to document this way.
(org-babel-load-file (expand-file-name "configuration.org" user-emacs-directory))