summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-04-30 23:00:23 +0100
committerjao <jao@gnu.org>2021-04-30 23:00:23 +0100
commite4aae6eba1b337194295ce544e453d045ef1b62b (patch)
tree4a062bedf9e7d0f077f284ff274cf3d955852781
parentfc16599a4a1141643916321b6bab2bd49a8e9306 (diff)
downloadelibs-e4aae6eba1b337194295ce544e453d045ef1b62b.tar.gz
elibs-e4aae6eba1b337194295ce544e453d045ef1b62b.tar.bz2
it's company for now
-rw-r--r--completion.org75
1 files changed, 62 insertions, 13 deletions
diff --git a/completion.org b/completion.org
index 4f5787c..7a88913 100644
--- a/completion.org
+++ b/completion.org
@@ -13,30 +13,79 @@
(use-package orderless
:ensure t
:init
- (setq completion-styles '(orderless)
- orderless-skip-highlighting t
+ (setq orderless-skip-highlighting t
orderless-component-separator "[ -/]+"
orderless-matching-styles
'(orderless-literal orderless-regexp orderless-initialism)))
#+end_src
-* corfu and dabbrev
+* company
#+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 '(clojure-mode))
+ ;; (company-global-modes t)
+ (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)))
+
+ (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)
+
+ ("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))
+ :diminish)
+
+ (global-company-mode 1)
+ #+end_src
+* corfu and dabbrev
+ #+begin_src emacs-lisp :load no
(jao-load-path "corfu")
(use-package corfu
:init (setq corfu-cycle t
- corfu-excluded-modes nil)
+ corfu-excluded-modes '(clojure-mode))
- :config (corfu-global-mode)
+ :config
+ ;; (corfu-global-mode)
+ (use-package dabbrev
+ ;; Swap M-/ and C-M-/
+ :bind (("M-/" . dabbrev-completion)
+ ("C-M-/" . dabbrev-expand)))
:bind (:map corfu-map
("TAB" . corfu-next)
("S-TAB" . corfu-previous)))
- (use-package dabbrev
- ;; Swap M-/ and C-M-/
- :bind (("M-/" . dabbrev-completion)
- ("C-M-/" . dabbrev-expand)))
#+end_src
* vertico
#+begin_src emacs-lisp
@@ -47,9 +96,9 @@
:init (setq vertico-count 20)
:config
- ;; (defun jao--be-orderless (&rest _any)
- ;; (setq-local completion-styles '(orderless)))
- ;; (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
@@ -115,7 +164,7 @@
#'consult-narrow-help))
#+end_src
*** notmuch
- #+begin_src emacs-lisp
+ #+begin_src emacs-lisp :load no
(jao-load-path "consult-notmuch")
(use-package consult-notmuch
:config