summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-09-09 02:53:03 +0300
committerThanos Apollo <[email protected]>2023-09-09 02:53:03 +0300
commitd4ae0ba744eaa05545f7935c4f3aeceae541812a (patch)
tree38893b9b998b14002400d0b7c938654737e90541
parent5025edb33b207f8a69e0513e9be07c821f9ce600 (diff)
emacs(dev): Add corfu, orderless and dabbrev config
-rw-r--r--.emacs.d/modules/thanos-dev.el46
1 files changed, 33 insertions, 13 deletions
diff --git a/.emacs.d/modules/thanos-dev.el b/.emacs.d/modules/thanos-dev.el
index f711bba..90c29f4 100644
--- a/.emacs.d/modules/thanos-dev.el
+++ b/.emacs.d/modules/thanos-dev.el
@@ -28,16 +28,37 @@
;; ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱┃┃
;; ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╰╯
;;; Code:
-(require 'company)
-
-(add-hook 'after-init-hook 'global-company-mode)
-(define-key company-active-map (kbd "TAB") 'company-indent-or-complete-common)
-(setq company-idle-delay
- (lambda () (if (company-in-string-or-comment) nil 0.0)))
-
-(require 'company-box)
-(add-hook 'company-mode-hook 'company-box-mode)
-(setf company-box-icons-alist 'company-box-icons-images)
+(require 'corfu)
+(require 'orderless)
+(require 'dabbrev)
+
+(setf dabbrev-ignored-buffer-regexps '("\\.\\(?:pdf\\|jpe?g\\|png\\)\\'"))
+
+(defun orderless-fast-dispatch (word index total)
+ (and (= index 0) (= total 1) (length< word 4)
+ `(orderless-regexp . ,(concat "^" (regexp-quote word)))))
+
+(orderless-define-completion-style orderless-fast
+ (orderless-style-dispatchers '(orderless-fast-dispatch))
+ (orderless-matching-styles '(orderless-literal orderless-regexp)))
+
+;; Corfu
+(global-corfu-mode)
+(corfu-popupinfo-mode)
+
+(setf corfu-mode t
+ corfu-auto t
+ corfu-auto-delay 0
+ corfu-auto-prefix 2
+ corfu-cycle t
+ completion-styles '(orderless-fast basic)
+ completion-cycle-threshold 3
+ corfu-popupinfo-delay 0
+ corfu-quit-at-boundary 'separator
+ corfu-quit-no-match t
+ corfu-preselect 'first
+ corfu-preview-current t
+ corfu-echo-mode t)
(setq indent-tabs-mode nil)
@@ -76,7 +97,6 @@
(add-to-list 'completion-styles 'initials t)
(add-hook 'emacs-lisp-mode-hook #'rainbow-delimiters-mode)
-(add-hook 'emacs-lisp-mode-hook #'company-mode)
(add-hook 'emacs-lisp-mode-hook #'display-line-numbers-mode)
;; Disable checkdoc flycheck for org-src buffers
@@ -86,9 +106,9 @@
;; Common lisp
(setf inferior-lisp-program "sbcl")
(add-hook 'lisp-mode-hook #'rainbow-delimiters-mode)
-(add-hook 'lisp-mode-hook #'company-mode)
+
+;; Scheme
(add-hook 'scheme-mode-hook #'rainbow-delimiters-mode)
-(add-hook 'scheme-mode-hook #'company-mode)
;; LSP config
(defun thanos/lsp-mode-setup ()