1
0
Fork 0

Fixed: corfu auto completion cycle

Browse Source
This commit is contained in:
rhjr 2026-01-20 14:08:37 +01:00
parent b96ab10a90
commit 67b8ce96c7

View File

@ -101,30 +101,31 @@
(menu-bar-mode -1) (menu-bar-mode -1)
(tool-bar-mode -1) (tool-bar-mode -1)
(scroll-bar-mode -1) (scroll-bar-mode -1)
(cua-mode 1)
(set-fringe-mode '(2 . 0)) (set-fringe-mode '(2 . 0))
;;; rhjr/packages ;;; rhjr/packages
(use-package magit (use-package magit
:defer t) :defer t)
(use-package dabbrev
:defer t)
(use-package corfu (use-package corfu
;; Optional customizations :custom
;; :custom (corfu-auto t)
;; (corfu-cycle t) ;; Enable cycling for `corfu-next/previous' (corfu-cycle t)
;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary (corfu-preview-current nil)
;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match
;; (corfu-preview-current nil) ;; Disable current candidate preview :bind
;; (corfu-preselect 'prompt) ;; Preselect the prompt (:map corfu-map
;; (corfu-on-exact-match 'insert) ;; Configure handling of exact matches ("TAB" . corfu-next)
([tab] . corfu-next)
("S-TAB" . corfu-previous)
([backtab] . corfu-previous))
:init :init
(global-corfu-mode) (global-corfu-mode)
(corfu-history-mode))
;; Enable optional extension modes:
;; (corfu-history-mode)
;; (corfu-popupinfo-mode)
)
(use-package consult (use-package consult
:bind (("C-x b" . consult-buffer) :bind (("C-x b" . consult-buffer)
@ -211,27 +212,34 @@
;; useful beyond Corfu. ;; useful beyond Corfu.
(read-extended-command-predicate #'command-completion-default-include-p)) (read-extended-command-predicate #'command-completion-default-include-p))
(use-package dabbrev
;; Swap M-/ and C-M-/
:bind (("M-/" . dabbrev-completion)
("C-M-/" . dabbrev-expand))
:config
(add-to-list 'dabbrev-ignored-buffer-regexps "\\` ")
(add-to-list 'dabbrev-ignored-buffer-modes 'authinfo-mode)
(add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode)
(add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode)
(add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode))
;;; rhjr/keybindings ;;; rhjr/keybindings
(global-unset-key (kbd "C-y")) ;; redundant due to cua-mode
(global-unset-key (kbd "C-w"))
(global-unset-key (kbd "M-w"))
(global-unset-key (kbd "C-x u"))
(global-set-key (kbd "C-x C-g") 'bookmark-jump) (global-set-key (kbd "C-x C-g") 'bookmark-jump)
(global-set-key (kbd "C-z") 'undo)
;;; rhjr/programming ;;; rhjr/programming
(defconst rhjr/c-style
`((c-basic-offset . 2)
(c-offsets-alist .
((statement . 0)
(statement-cont . 0)
(substatement-open . 0)
(arglist-intro . 2)
(case-label . 2)
(label . 0))
)
))
(defun rhjr/set-c-style ()
""
(interactive)
(setq tab-width 2
indent-tabs-mode nil)
(c-add-style "rhjr/c-style" rhjr/c-style t)
(c-set-style "rhjr/c-style"))
(add-hook 'c-mode-common-hook #'rhjr/set-c-style)
(setq-default show-trailing-whitespace t) (setq-default show-trailing-whitespace t)
(add-hook 'before-save-hook 'delete-trailing-whitespace) (add-hook 'before-save-hook 'delete-trailing-whitespace)
@ -240,7 +248,8 @@
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(package-selected-packages '(cape vertico orderless magit esup corfu consult))) '(package-selected-packages
'(cape consult corfu corfu-candidate-overlay magit orderless vertico)))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.