diff options
| author | jao <jao@gnu.org> | 2021-07-24 02:11:35 +0100 | 
|---|---|---|
| committer | jao <jao@gnu.org> | 2021-07-24 02:11:35 +0100 | 
| commit | 9e089dab9af327d4a6b392475f54871291bc0bc3 (patch) | |
| tree | a414064988b0774a78c7dd4c266a14e1c9884aee /completion.org | |
| parent | 707dcd085b7c4800639af5f01035430142478abc (diff) | |
| download | elibs-9e089dab9af327d4a6b392475f54871291bc0bc3.tar.gz elibs-9e089dab9af327d4a6b392475f54871291bc0bc3.tar.bz2 | |
corfu: auto becoming really comfortable
Diffstat (limited to 'completion.org')
| -rw-r--r-- | completion.org | 25 | 
1 files changed, 15 insertions, 10 deletions
| diff --git a/completion.org b/completion.org index a56f1fb..b3ca9d0 100644 --- a/completion.org +++ b/completion.org @@ -40,11 +40,23 @@                    corfu-count 15                    corfu-quit-no-match t ; setting this to nil                    corfu-auto t          ; and this to nil is another option -                  corfu-commit-predicate nil +                  corfu-commit-predicate nil            ; when nil, we set: +                  orderless-component-separator "[-/]+" ; no space (it aborts)                    corfu-min-width 20 -                  corfu-max-width 100 -                  corfu-excluded-modes '(eshell-mode)) +                  corfu-max-width 100)        :config +      (defun jao-corfu-enable-no-auto () +        (setq-local corfu-auto nil) +        (corfu-mode 1)) + +      (defmacro jao-corfu-no-auto (mode) +        (let ((mode-name (intern (format "%s-mode" mode))) +              (hook-name (intern (format "%s-mode-hook" mode)))) +          `(with-eval-after-load ',mode +             (add-to-list 'corfu-excluded-modes ',mode-name) +             (add-hook ',hook-name #'jao-corfu-enable-no-auto)))) + +      (jao-corfu-no-auto eshell)        :bind (:map corfu-map               ("TAB" . corfu-next) @@ -52,11 +64,6 @@      (corfu-global-mode 1) -    (with-eval-after-load "eshell" -      (defun jao-corfu-eshell () -        (setq-local corfu-auto nil) -        (corfu-mode 1)) -      (add-hook 'eshell-mode-hook #'jao-corfu-eshell))    #+end_src  * vertico    #+begin_src emacs-lisp @@ -97,8 +104,6 @@          :bind (("C-x M-:" . consult-complex-command)                 ("C-x b" . consult-buffer)                 ("C-x C-b" . consult-buffer) -               ;; ("C-x 4 b" . consult-buffer-other-window) -               ;; ("C-x 5 b" . consult-buffer-other-frame)                 ("C-c b" . project-find-file)                 ("C-c B" . bookmark-set)                 ("C-c h" . consult-history) | 
