summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-05-15 00:25:40 +0100
committerjao <jao@gnu.org>2021-05-15 00:25:40 +0100
commit7379387d67e5492ae24799f92c1db8fdf4ac42a5 (patch)
tree581a73a41f511fd0f64918d0e40c6ea01b72b34b
parent0df3477db2f54656f1edbe413333b719bac26496 (diff)
downloadelibs-7379387d67e5492ae24799f92c1db8fdf4ac42a5.tar.gz
elibs-7379387d67e5492ae24799f92c1db8fdf4ac42a5.tar.bz2
look ma, no flicker: back to corfu
-rw-r--r--completion.org75
1 files changed, 22 insertions, 53 deletions
diff --git a/completion.org b/completion.org
index 975e0e7..f34deaa 100644
--- a/completion.org
+++ b/completion.org
@@ -3,10 +3,11 @@
* completion styles
#+begin_src emacs-lisp
(use-package emacs
- :init (setq completion-category-defaults nil
- completion-cycle-threshold 3
- completion-category-overrides
- '((file (styles . (partial-completion))))))
+ :init
+ (setq completion-category-defaults nil
+ completion-cycle-threshold 3
+ completion-category-overrides
+ '((file (styles . (partial-completion))))))
#+end_src
* orderless
#+begin_src emacs-lisp
@@ -18,58 +19,25 @@
orderless-matching-styles
'(orderless-literal orderless-regexp orderless-initialism)))
#+end_src
-* company
+* corfu
#+begin_src emacs-lisp
- (use-package company
- :ensure t
- :custom ((company-backends '(company-capf
- company-bbdb
- company-files
- company-dabbrev
- company-keywords))
- (company-global-modes '(not slack-message-buffer-mode
- circe-channel-mode
- telega-chat-mode))
- (company-format-margin-function nil) ;; #'company-text-icons-margin
- (company-idle-delay 0.2)
- (company-lighter "")
- (company-lighter-base "")
- (company-show-numbers nil)
- (company-selection-wrap-around t)
- (company-tooltip-limit 15)
- (company-tooltip-align-annotations t)
- (company-tooltip-offset-display 'lines)) ;; 'scrollbar
-
- :config
- (defun jao-complete-at-point ()
- "Complete using company unless we're in the minibuffer."
- (interactive)
- (if (or (not company-mode) (window-minibuffer-p))
- (completion-at-point)
- (company-manual-begin)))
-
- (defun jao-company-use-in-tab ()
- (global-set-key [remap completion-at-point] #'jao-complete-at-point)
- (global-set-key [remap completion-symbol] #'jao-complete-at-point)
- (global-set-key (kbd "M-TAB") #'jao-complete-at-point))
-
- (jao-company-use-in-tab)
-
- :bind (:map company-active-map
-
- ("<tab>" . #'company-complete-common-or-cycle)
- ("TAB" . #'company-complete-common-or-cycle)
+ (use-package emacs
+ :init (setq completion-styles '(orderless)
+ tab-always-indent 'complete))
- ("C-h" . #'company-show-doc-buffer)
- ("M-." . #'company-show-location)
+ (use-package dabbrev
+ ;; Swap M-/ and C-M-/
+ :bind (("M-/" . dabbrev-completion)
+ ("C-M-/" . dabbrev-expand)))
- :filter (or (not (derived-mode-p 'eshell-mode))
- (company-explicit-action-p))
- ("<return>" . #'company-complete-selection)
- ("RET" . #'company-complete-selection))
- :diminish)
+ (use-package corfu
+ :ensure t
+ :init (setq corfu-cycle t)
+ :bind (:map corfu-map
+ ("TAB" . corfu-next)
+ ("S-TAB" . corfu-previous)))
- (global-company-mode 1)
+ (corfu-global-mode)
#+end_src
* vertico
#+begin_src emacs-lisp
@@ -81,7 +49,8 @@
:config
(defun jao--be-orderless (&rest _any)
(setq-local completion-styles '(orderless)))
- (advice-add 'vertico--setup :before #'jao--be-orderless)
+ (unless (eq completion-styles '(orderless))
+ (advice-add 'vertico--setup :before #'jao--be-orderless))
(vertico-mode))
#+end_src
* marginalia