diff options
author | jao <jao@gnu.org> | 2021-04-17 04:01:45 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-04-17 04:01:45 +0100 |
commit | 3d6a8ed794357e9764fe7281c2070601be6daae0 (patch) | |
tree | a41c9ceff2e3629ea8f17ca0adeac18c6ec33e73 | |
parent | 45bf5ca9f1ab4fcec6388ba9624e6eac719e0b24 (diff) | |
download | elibs-3d6a8ed794357e9764fe7281c2070601be6daae0.tar.gz elibs-3d6a8ed794357e9764fe7281c2070601be6daae0.tar.bz2 |
the popup keeps me company
-rw-r--r-- | attic/counsel.org | 61 | ||||
-rw-r--r-- | completion.org | 76 |
2 files changed, 63 insertions, 74 deletions
diff --git a/attic/counsel.org b/attic/counsel.org index a2147b5..f6814ae 100644 --- a/attic/counsel.org +++ b/attic/counsel.org @@ -1,66 +1,5 @@ #+title: Completion configuration using ivy, counsel and friends -* company - #+begin_src emacs-lisp - (use-package company - :ensure t - :custom - ((company-global-modes '(clojure-mode - clojurec-mode - emacs-lisp-mode - ;; eshell-mode - haskell-mode - haskell-interactive-mode - idris-mode - lisp-interaction-mode - message-mode - org-mode - pie-mode - scheme-mode)) - (company-idle-delay 0.15) - (company-lighter "") - (company-lighter-base "") - (company-show-numbers nil) - (company-tooltip-limit 15) - (company-tooltip-align-annotations t) - (company-transformers '(company-sort-by-occurrence))) - - :config - - (defun jao-complete-at-point () - "Complete using company unless we're in the minibuffer." - (interactive) - (if (window-minibuffer-p) (completion-at-point) (company-manual-begin))) - - :bind (;; ([remap completion-at-point] . #'jao-complete-at-point) - ;; ([remap complete-symbol] . #'jao-complete-at-point) - - ;; The following are keybindings that take effect whenever - ;; the completions menu is visible, even if the user has not - ;; explicitly interacted with Company. - :map company-active-map - - ("<tab>" . #'company-complete-common-or-cycle) - ("TAB" . #'company-complete-common-or-cycle) - - ("C-h" . #'company-show-doc-buffer) - ("M-." . #'company-show-location) - - :filter (or (not (derived-mode-p 'eshell-mode)) - (company-explicit-action-p)) - ("<return>" . #'company-complete-selection) - ("RET" . #'company-complete-selection)) - - :bind* (("M-TAB" . #'jao-complete-at-point)) - - :diminish) - - ;; (use-package company-math :ensure t :after company) - - ;; (global-company-mode 1) - - #+end_src - * selectrum #+begin_src emacs-lisp :load no (use-package selectrum diff --git a/completion.org b/completion.org index dc8e959..38377c3 100644 --- a/completion.org +++ b/completion.org @@ -1,20 +1,71 @@ #+title: Completion configuration using vertico, consult and friends +* completion styles + #+begin_src emacs-lisp + (use-package emacs + :init (setq completion-styles '(basic emacs22 initials) + completion-category-defaults nil + completion-cycle-threshold 3 + completion-category-overrides + '((file (styles . (partial-completion))) ; path expansion on / + (recoll-result . (partial-completion emacs22 initials))))) + #+end_src * orderless #+begin_src emacs-lisp (use-package orderless :ensure t :init - (setq completion-category-defaults nil - completion-category-overrides - '((file (styles . (partial-completion))) ; path expansion on / - (recoll-result . (partial-completion emacs22 initials))) - orderless-skip-highlighting t + (setq orderless-skip-highlighting t orderless-component-separator "[ -/]+" orderless-matching-styles '(orderless-literal orderless-regexp orderless-initialism))) #+end_src +* company + #+begin_src emacs-lisp + (use-package company + :ensure t + :custom ((company-backends '(company-capf + company-bbdb + company-files + company-keywords)) + (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 (window-minibuffer-p) (completion-at-point) (company-manual-begin))) + + :bind (([remap completion-at-point] . #'jao-complete-at-point) + ([remap complete-symbol] . #'jao-complete-at-point) + :map company-active-map + + ("<tab>" . #'company-complete-common-or-cycle) + ("TAB" . #'company-complete-common-or-cycle) + + ("C-h" . #'company-show-doc-buffer) + ("M-." . #'company-show-location) + + :filter (or (not (derived-mode-p 'eshell-mode)) + (company-explicit-action-p)) + ("<return>" . #'company-complete-selection) + ("RET" . #'company-complete-selection)) + + :bind* (("M-TAB" . #'jao-complete-at-point)) + + :diminish) + + (global-company-mode 1) + + #+end_src * corfu #+begin_src emacs-lisp (jao-load-path "corfu") @@ -22,7 +73,6 @@ :init (setq tab-always-indent 'complete completion-styles '(orderless) - completion-cycle-threshold 3 corfu-cycle t) ;; Optionally use TAB for cycling, default is `corfu-complete'. @@ -30,12 +80,12 @@ ;; ("TAB" . corfu-next) ;; ("S-TAB" . corfu-previous)) - :hook ((eshell-mode . corfu-mode) - (haskell-interactive-mode . corfu-mode) - (message-mode . corfu-mode) - (org-mode . corfu-mode) - (prog-mode . corfu-mode) - (lisp-interaction-mode . corfu-mode))) + ;; :hook ((eshell-mode . corfu-mode) + ;; (haskell-interactive-mode . corfu-mode) + ;; (message-mode . corfu-mode) + ;; (prog-mode . corfu-mode) + ;; (lisp-interaction-mode . corfu-mode)) + ) #+end_src * vertico #+begin_src emacs-lisp @@ -43,9 +93,9 @@ :ensure t :init (setq vertico-count 20) :config - ;; (advice-add 'vertico--setup :before #'jao--be-orderless) (defun jao--be-orderless (&rest _any) (setq-local completion-styles '(orderless))) + (advice-add 'vertico--setup :before #'jao--be-orderless) (vertico-mode)) #+end_src * marginalia |