From 4ccc82f63266d517e040c83547dc1b54e52c00ea Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Wed, 11 Nov 2026 22:09:04 +0100 Subject: [PATCH] fix latex dabbrev completion, enable corfu globally --- init.el | 2 ++ lisp/init-dabbrev.el | 8 ++++++++ lisp/init-latex.el | 18 ++++++++++++++++++ lisp/init-smarter-than-emacs.el | 10 ++++++++-- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 lisp/init-dabbrev.el create mode 100644 lisp/init-latex.el diff --git a/init.el b/init.el index c4c1d0e..3108f09 100644 --- a/init.el +++ b/init.el @@ -139,6 +139,7 @@ (require 'init-typst) (require 'init-editorconfig) (require 'init-flymake) +(require 'init-latex) ;; interactive modes (require 'init-eshell) @@ -172,6 +173,7 @@ (require 'init-ibuffer) (require 'init-printing) (require 'init-smarter-than-emacs) +(require 'init-dabbrev) (require 'init-marginalia) (require 'init-avy) (require 'init-ui) diff --git a/lisp/init-dabbrev.el b/lisp/init-dabbrev.el new file mode 100644 index 0000000..06eb913 --- /dev/null +++ b/lisp/init-dabbrev.el @@ -0,0 +1,8 @@ +;; -*- lexical-binding: nil; -*- + + +(use-package dabbrev + :commands dabbrev-capf) + + +(provide 'init-dabbrev) diff --git a/lisp/init-latex.el b/lisp/init-latex.el new file mode 100644 index 0000000..86a3c3c --- /dev/null +++ b/lisp/init-latex.el @@ -0,0 +1,18 @@ +;; -*- lexical-binding: nil; -*- + +(setopt text-mode-ispell-word-completion nil) + +(use-package latex + :ensure nil + + :mode + ("\\.tex\\'" . latex-mode) + + :config) + +(add-hook 'latex-mode-hook + (lambda () + (add-hook 'completion-at-point-functions #'dabbrev-capf 20 t))) + + +(provide 'init-latex) diff --git a/lisp/init-smarter-than-emacs.el b/lisp/init-smarter-than-emacs.el index 033013e..3079a75 100644 --- a/lisp/init-smarter-than-emacs.el +++ b/lisp/init-smarter-than-emacs.el @@ -272,7 +272,13 @@ a remote file anytime and from everywhere I am by just entering :" ;; clever and nice looking and feeling completion package, candidates ;; show up in a mini popup, very nice (use-package corfu - :hook ((prog-mode . corfu-mode)) + :init + (global-corfu-mode) + + ;; :hook ((prog-mode . corfu-mode) + ;; (plain-tex-mode . corfu-mode) + ;; (tex-mode . corfu-mode) + ;; (latex-mode . corfu-mode)) :custom (corfu-quit-no-match t) @@ -285,7 +291,7 @@ a remote file anytime and from everywhere I am by just entering :" ("TAB" . corfu-next) ([tab] . corfu-next) ("S-TAB" . corfu-previous) - ([backtab] . corfu-previous))) + ([backtab] . corfu-next))) ;; much better experience to seach current buffer, consult-line would