feat(completion): replace orderless with fussy

Use fussy instead of orderless for filtering and scoring/ordering
completion candidates. This seems to overall order results in a much
better way than just orderless.

Technically orderless is still used to filter the candidate list, but
fzf-native is used to score/order the results.
This commit is contained in:
2022-06-09 00:58:38 +01:00
parent 0e1de284fd
commit f6ecda7bf4
3 changed files with 45 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
;;; siren-fussy.el --- jimeh's Emacs Siren: fussy configuration.
;;; Commentary:
;; Basic configuration for fussy.
;;; Code:
(use-package fussy
:ensure t
:custom
(completion-category-overrides nil)
(completion-ignore-case t)
(pcomplete-ignore-case t)
(fussy-ignore-case t)
(fussy-filter-fn 'fussy-filter-orderless-flex)
(fussy-score-fn 'fussy-fzf-native-score)
:preface
(defun siren-fussy--company-transform-advice (f &rest args)
"Manage `company-transformers'."
(let ((company-transformers '(fussy-company-sort-by-completion-score)))
(apply f args)))
:config
(add-to-list 'completion-styles 'fussy)
(advice-add 'company--transform-candidates
:around 'siren-fussy--company-transform-advice)
(setq completion-category-defaults nil))
(use-package orderless
:commands (orderless-filter))
(use-package fzf-native
:straight (fzf-native :repo "dangduc/fzf-native" :host github
:files (:defaults "bin"))
:config
(fzf-native-load-dyn))
(provide 'siren-fussy)
;;; siren-fussy.el ends here