fixed lsp, orderless, corfu

irrelevant elements are now correctly filtered out of lsp by
orderless,corfu.

fixed some whitespace, indentation
This commit is contained in:
2026-08-12 00:12:21 +02:00
parent 811637003b
commit e82959cc66
9 changed files with 687 additions and 666 deletions
+9 -5
View File
@@ -14,13 +14,14 @@
(add-hook (add-hook
'after-init-hook 'after-init-hook
(lambda () (lambda ()
(with-demoted-errors "Error in after-init-hook: %S"
(require 'visuals-packages) ; ui, eye candy (require 'visuals-packages) ; ui, eye candy
(require 'editing-packages) ; text editing (require 'editing-packages) ; text editing
(require 'system-packages) ; emacs itself (require 'system-packages) ; emacs itself
(require 'tutilities-packages) ; tertiary utilities (require 'tutilities-packages) ; tertiary utilities
(require 'completion-packages) ; ui, functional (require 'completion-packages) ; ui, functional
(require 'dev-packages) ; lsp, treesitter (require 'dev-packages) ; lsp, treesitter
) ))
) )
;; ============================================================ ;; ============================================================
;; Keybindings ;; Keybindings
@@ -40,6 +41,8 @@
;"C-m" nil can't be rebound because is same as ret ;"C-m" nil can't be rebound because is same as ret
"C->" nil ;end of buffer "C->" nil ;end of buffer
"C-<" nil ;start of buffer "C-<" nil ;start of buffer
"C-<right>" nil
"C-<left>" nil
) )
(general-def (general-def
@@ -108,11 +111,12 @@
(read-file-name-completion-ignore-case t) (read-file-name-completion-ignore-case t)
(read-buffer-completion-ignore-case t) (read-buffer-completion-ignore-case t)
(text-mode-ispell-word-completion nil) (text-mode-ispell-word-completion nil)
(completion-category-overrides '((point (styles orderless basic))))
;; --- Backup & Auto-save --- ;; --- Backup & Auto-save ---
;; Centralize all backup files to a single directory to avoid cluttering projects ;; Centralize all backup files to a single directory to avoid cluttering projects
(backup-directory-alist '(("." . "~/MyEmacsBackups"))) (backup-directory-alist '(("." . "~/MyEmacsBackups/")))
(auto-save-list-file-prefix "~/MyEmacsBackups") (auto-save-list-file-prefix "~/MyEmacsBackups/")
(backup-by-copying t) (backup-by-copying t)
(create-lockfiles nil) (create-lockfiles nil)
(make-backup-files nil) (make-backup-files nil)
@@ -187,6 +191,8 @@
;; 5. Hooks, Modes & Theming ;; 5. Hooks, Modes & Theming
;; ============================================================ ;; ============================================================
(add-hook 'text-mode-hook #'jit-spell-mode)
(add-hook (add-hook
'after-init-hook 'after-init-hook
(lambda () (lambda ()
@@ -200,10 +206,8 @@
(yas-global-mode t) ; yasnippets (yas-global-mode t) ; yasnippets
(repeat-mode 1) ; repeat key without modifier (repeat-mode 1) ; repeat key without modifier
(electric-pair-mode t) ; automatically handle pairs (electric-pair-mode t) ; automatically handle pairs
(jit-spell-mode t) ; spellcheck
(fringe-mode '(0 . 8)) ; fringe only on right edge (fringe-mode '(0 . 8)) ; fringe only on right edge
(delete-selection-mode 1) (delete-selection-mode 1)
(auto-revert-mode t)
;; --- Special UI Settings --- ;; --- Special UI Settings ---
(setq ispell-program-name "hunspell" (setq ispell-program-name "hunspell"
+6 -4
View File
@@ -63,7 +63,6 @@
(elpaca nerd-icons-dired) (elpaca nerd-icons-dired)
(elpaca nerd-icons-corfu) (elpaca nerd-icons-corfu)
(elpaca doom-modeline) (elpaca doom-modeline)
(elpaca base16-theme)
;; ============================================================================== ;; ==============================================================================
;; EDITING & NAVIGATION ;; EDITING & NAVIGATION
@@ -97,7 +96,8 @@
(elpaca highlight-parentheses) ; delimiters around point (elpaca highlight-parentheses) ; delimiters around point
(elpaca rainbow-delimiters) ; rainbow colours for pairs (elpaca rainbow-delimiters) ; rainbow colours for pairs
(elpaca outline-indent) ; (elpaca outline-indent) ;
(elpaca (svg-margin :repo "chiply/svg-margin" (elpaca (svg-margin
:repo "chiply/svg-margin"
:host github)) :host github))
;; ============================================================================== ;; ==============================================================================
;; LSP & DEVELOPMENT ;; LSP & DEVELOPMENT
@@ -129,9 +129,11 @@
(elpaca ghostel) ; terminal (elpaca ghostel) ; terminal
(elpaca shell-pop) (elpaca shell-pop)
(elpaca colorful-mode) ; colourise color codes (elpaca colorful-mode) ; colourise color codes
(elpaca (dirvish :repo "latiagertrutis/dirvish" (elpaca (dirvish
:repo "latiagertrutis/dirvish"
:host github)) ; broken on emacs 30, fixed by using fork :host github)) ; broken on emacs 30, fixed by using fork
(elpaca (dired-clipboard :repo "kn66/dired-clipboard.el" ;system clipboard in dired (elpaca (dired-clipboard
:repo "kn66/dired-clipboard.el" ;system clipboard in dired
:host github)) :host github))
(elpaca transient) ; bindings in modes (elpaca transient) ; bindings in modes
(elpaca magit) ; git client (elpaca magit) ; git client
+15 -6
View File
@@ -4,12 +4,12 @@
:config :config
(global-corfu-mode) (global-corfu-mode)
(corfu-popupinfo-mode) (corfu-popupinfo-mode)
(setq corfu-quit-at-boundary 'seperator (setq corfu-quit-at-boundary 'separator
corfu-quit-no-match 'seperator) corfu-quit-no-match 'separator)
:custom :custom
(corfu-auto t) (corfu-auto t)
(corfu-auto-delay 0.2) (corfu-auto-delay 0.1)
(corfu-auto-prefix 2) (corfu-auto-prefix 1)
(corfu-popupinfo-delay '(0.5 . 0.3))) (corfu-popupinfo-delay '(0.5 . 0.3)))
(use-package vertico (use-package vertico
@@ -45,7 +45,7 @@
:config :config
(add-hook 'after-change-major-mode-hook (add-hook 'after-change-major-mode-hook
(lambda () (lambda ()
(setq completion-in-region-function #'consult-completion-in-regionc))) (setq completion-in-region-function #'consult-completion-in-region)))
) )
(use-package marginalia (use-package marginalia
@@ -55,6 +55,15 @@
(use-package orderless (use-package orderless
:custom :custom
(completion-styles '(orderless basic)) (completion-styles '(orderless basic))
(completion-pcm-leading-wildcard t)) (completion-pcm-leading-wildcard t)
(completion-category-defaults nil)
(orderless-matching-styles '(orderless-prefixes orderless-literal))
:config
;;necessary to force filtering of lsp-mode candidates
(add-to-list 'completion-category-overrides
'(lsp-capf (styles orderless)
(orderless-matching-styles orderless-prefixes orderless-literal)))
)
(provide 'completion-packages) (provide 'completion-packages)
+13 -5
View File
@@ -65,13 +65,21 @@
:init :init
(setq lsp-keymap-prefix "C-l") (setq lsp-keymap-prefix "C-l")
:config :config
(add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)) (add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)
(setq lsp-clients-clangd-executable "clangd" (setq lsp-clients-clangd-executable "clangd"
lsp-clangd-binary-path "/usr/bin/clangd" lsp-clangd-binary-path "/usr/bin/clangd"
lsp-clients--clangd-default-executable "/usr/bind/clangd" lsp-clients--clangd-default-executable "/usr/bin/clangd"
lsp-completion-provider :none lsp-completion-provider :none
lsp-clients-clangd-args '("--header-insertion=iwyu" "--fallback-style=LLVM") lsp-completion-enable-filtering nil
) lsp-completion-sort-initial-results t
lsp-clients-clangd-args '("--header-insertion=iwyu"
"--fallback-style=LLVM"
"-query-driver=/usr/bin/c++"
"--header-insertion-decorators")
lsp-enable-indentation t
lsp-enable-on-type-formatting nil
))
(with-eval-after-load 'lsp-mode (with-eval-after-load 'lsp-mode
(define-key lsp-command-map (kbd "a") #'lsp-execute-code-action) (define-key lsp-command-map (kbd "a") #'lsp-execute-code-action)
@@ -102,7 +110,7 @@
:new-connection (lsp-stdio-connection '("clangd" "--header-insertion=never")) :new-connection (lsp-stdio-connection '("clangd" "--header-insertion=never"))
:activation-fn (lsp-activate-on "arduino") :activation-fn (lsp-activate-on "arduino")
:server-id 'lsp-arduino-clangd :server-id 'lsp-arduino-clangd
)))) )))
(use-package lsp-ui (use-package lsp-ui
:defer t :defer t
+1 -1
View File
@@ -5,7 +5,7 @@
:config :config
(setq avy-timeout-seconds 0.25 (setq avy-timeout-seconds 0.25
avy-style 'at-full avy-style 'at-full
avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l ?A ?S ?D ?F ?G ?H ?J ?K ?L) avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
avy-orders-alist nil) avy-orders-alist nil)
) )
-1
View File
@@ -1,4 +1,3 @@
(use-package denote (use-package denote
:defer t :defer t
:config :config
-1
View File
@@ -65,4 +65,3 @@ t
(provide 'visuals-packages) (provide 'visuals-packages)