From 3c6e40cfe291558a5d041201d65dd1fef58d7a82 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 15 Apr 2021 22:38:05 +0100 Subject: my family and other animals --- attic/counsel.org | 61 ++++++++++++++++++++++++++++++ completion.org | 96 ++++++++++++++---------------------------------- lib/themes/jao-themes.el | 5 +++ 3 files changed, 93 insertions(+), 69 deletions(-) diff --git a/attic/counsel.org b/attic/counsel.org index f6814ae..a2147b5 100644 --- a/attic/counsel.org +++ b/attic/counsel.org @@ -1,5 +1,66 @@ #+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 + + ("" . #'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)) + ("" . #'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 600243e..db042c0 100644 --- a/completion.org +++ b/completion.org @@ -1,92 +1,50 @@ #+title: Completion configuration using vertico, consult 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 - - ("" . #'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)) - ("" . #'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 - * orderless #+begin_src emacs-lisp (use-package orderless :ensure t :init - (setq completion--styles '(partial-completion emacs22 initials) - completion-category-defaults nil + (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 orderless-component-separator "[ -/]+" orderless-matching-styles - '(orderless-literal orderless-regexp orderless-initialism)) - - (defun jao--be-orderless (&rest _any) - (setq-local completion-styles '(orderless))) + '(orderless-literal orderless-regexp orderless-initialism))) + #+end_src - (add-hook 'minibuffer-setup-hook #'jao--be-orderless)) +* corfu + #+begin_src emacs-lisp + (jao-load-path "corfu") + (use-package corfu + :init + (setq tab-always-indent 'complete + completion-styles '(orderless) + corfu-cycle t) + + ;; Optionally use TAB for cycling, default is `corfu-complete'. + :bind (:map corfu-map + ("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))) #+end_src * vertico #+begin_src emacs-lisp (use-package vertico :ensure t :init (setq vertico-count 20) - :config (vertico-mode)) + :config + ;; (advice-add 'vertico--setup :before #'jao--be-orderless) + (defun jao--be-orderless (&rest _any) + (setq-local completion-styles '(orderless))) + (vertico-mode)) #+end_src * marginalia #+begin_src emacs-lisp diff --git a/lib/themes/jao-themes.el b/lib/themes/jao-themes.el index 5d2ee79..6e55cc6 100644 --- a/lib/themes/jao-themes.el +++ b/lib/themes/jao-themes.el @@ -391,6 +391,10 @@ (compilation-warning nbf (p warning) nul) (completions-common-part nbf :width normal) (completions-first-difference bf dfg dbg) + (corfu-background (p hilite)) + (corfu-bar (p hilite)) + (corfu-border (~ corfu-bar)) + (corfu-current (~ corfu-bar) ul) (cursor dfg dbg) (custom-button (~ button)) (custom-button-mouse (~ button)) @@ -725,6 +729,7 @@ (Info-quoted (p f01)) (info-xref link) (info-xref-visited vlink) + (inform-color link) (isearch bf (p hilite)) (isearch-fail (p error)) (italic (p italic)) -- cgit v1.2.3