summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-26 04:26:01 +0100
committerjao <jao@gnu.org>2022-09-26 20:42:10 +0100
commit7cea1859d427a553e6195fba9fc19e56f3fd26ea (patch)
tree72a190b461080486551284706d7db45f1e53a4cf /custom
parent46e40d80f1168755c13781a2df74c0a5b65a2a08 (diff)
downloadelibs-7cea1859d427a553e6195fba9fc19e56f3fd26ea.tar.gz
elibs-7cea1859d427a553e6195fba9fc19e56f3fd26ea.tar.bz2
pulsar tweaks
Diffstat (limited to 'custom')
-rw-r--r--custom/jao-custom-completion.el37
1 files changed, 19 insertions, 18 deletions
diff --git a/custom/jao-custom-completion.el b/custom/jao-custom-completion.el
index 0f8b854..3d9c543 100644
--- a/custom/jao-custom-completion.el
+++ b/custom/jao-custom-completion.el
@@ -1,15 +1,5 @@
;; -*- lexical-binding: t; -*-
-;;; imenu
-(use-package imenu
- :init (setq org-imenu-depth 7)
- :config
- (defun jao-imenu-hook ()
- (cond ((derived-mode-p 'org-mode) (org-reveal t))
- (outline-minor-mode (outline-show-entry))
- ((derived-mode-p 'outline-mode) (outline-show-entry))))
- (add-hook 'imenu-after-jump-hook #'jao-imenu-hook))
-
;;; completion styles
;;;; completion configuration
(setq tab-always-indent 'complete
@@ -76,21 +66,31 @@
;;; vertico
(use-package vertico
:ensure t
+
:init
+ (defvar jao-vertico-reverse t)
+
(setq vertico-count 20
vertico-cycle t
vertico-resize t
- org-refile-use-outline-path t)
+ vertico-multiform-categories nil
+ vertico-buffer-display-action
+ `(display-buffer-below-selected (window-height . 0.5)))
+
+ (dolist (c '(completion-at-point complete-symbol indent-for-tab-command))
+ (add-to-list 'vertico-multiform-commands
+ `(,c buffer (vertico-resize) (jao-vertico-reverse))))
:config
- (defun jao-vertico--display-candidates (lines)
- (move-overlay vertico--candidates-ov (point-min) (point-min))
- (overlay-put vertico--candidates-ov 'after-string (apply #'concat lines))
- (vertico--resize-window (length lines)))
+ (defun jao-vertico--display (fun lines)
+ (if (not jao-vertico-reverse)
+ (funcall fun lines)
+ (move-overlay vertico--candidates-ov (point-min) (point-min))
+ (overlay-put vertico--candidates-ov 'after-string (apply #'concat lines))
+ (vertico--resize-window (length lines))))
- (advice-add 'vertico--display-candidates
- :override #'jao-vertico--display-candidates))
+ (advice-add 'vertico--display-candidates :around #'jao-vertico--display))
(use-package vertico-directory
:after vertico
@@ -132,9 +132,10 @@
:init
(fset 'multi-occur #'consult-multi-occur)
+ (setq org-refile-use-outline-path t
+ org-imenu-depth 7)
:config
-
(defun jao-consult--completion-in-region (&rest args)
(apply (if (and (not (bound-and-true-p corfu-mode))
(not (bound-and-true-p company-mode))