From 40d9146a45c4bc00733294f14b2a5c4fddc8bf98 Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Thu, 17 Oct 2024 21:58:34 +0200 Subject: [PATCH 1/4] In-buffer-completion: Add separate section --- config.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index c4f81da..bdc3ea9 100644 --- a/config.org +++ b/config.org @@ -450,7 +450,9 @@ C-c C-c to apply." ) #+END_SRC -** Corfu +** In-buffer completion + +*** Corfu #+BEGIN_SRC emacs-lisp (use-package corfu From a5efd66ec77a10603ff1390b101b1a7140df3a1d Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Thu, 17 Oct 2024 21:58:59 +0200 Subject: [PATCH 2/4] In-buffer-completion: Add consult completion method --- config.org | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config.org b/config.org index bdc3ea9..11e7279 100644 --- a/config.org +++ b/config.org @@ -452,6 +452,17 @@ C-c C-c to apply." ** In-buffer completion +*** Consult + +#+BEGIN_SRC +(setq completion-in-region-function + (lambda (&rest args) + (apply (if vertico-mode + #'consult-completion-in-region + #'completion--in-region) + args))) +#+END_SRC + *** Corfu #+BEGIN_SRC emacs-lisp From a68f566cd955505cbb519216ca7307981308347a Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Thu, 17 Oct 2024 21:59:09 +0200 Subject: [PATCH 3/4] In-buffer-completion: Disable corfu Getting crashes with emacs 29.4, seems to be a known issue. Until emacs 30, find another in-buffer-completion solution. --- config.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.org b/config.org index 11e7279..91591be 100644 --- a/config.org +++ b/config.org @@ -465,7 +465,7 @@ C-c C-c to apply." *** Corfu -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC (use-package corfu ;; Optional customizations :custom From 75bda91171d9432e6c36c62204504f93706363d3 Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Thu, 17 Oct 2024 21:59:48 +0200 Subject: [PATCH 4/4] In-buffer-completion: Add company-mode --- config.org | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config.org b/config.org index 91591be..84fc64c 100644 --- a/config.org +++ b/config.org @@ -491,6 +491,19 @@ C-c C-c to apply." (global-corfu-mode)) #+end_src +*** Company-mode + +#+BEGIN_SRC emacs-lisp +(use-package company + :config + (define-key prog-mode-map + (kbd "TAB") + #'company-indent-or-complete-common) + :init + (global-company-mode) + ) +#+END_SRC + ** Orderless #+begin_src emacs-lisp