summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--attic/elisp/misc.el17
-rw-r--r--custom/jao-custom-completion.el37
-rw-r--r--init.el49
3 files changed, 51 insertions, 52 deletions
diff --git a/attic/elisp/misc.el b/attic/elisp/misc.el
index 3e31fc0..90d4639 100644
--- a/attic/elisp/misc.el
+++ b/attic/elisp/misc.el
@@ -564,6 +564,23 @@
(jao-notmuch-tree--next t t exit))
+;;; imenu
+(use-package imenu
+ :config
+ (defun jao-imenu-hook ()
+ (unless (featurep 'pulsar)
+ (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))
+
+;;; elpher/gemini
+(use-package elpher :ensure t)
+(defun jao-elpher--browse (url &rest _) (elpher-go url))
+(add-to-list 'browse-url-handlers
+ '("^\\(gemini\\|gopher\\)://.*" . jao-elpher--browse))
+
;;; snippets
(defun jao-sway-run-or-focus-tidal ()
(interactive)
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))
diff --git a/init.el b/init.el
index 76993c7..b89b210 100644
--- a/init.el
+++ b/init.el
@@ -569,40 +569,21 @@
(setq tmr-sound-file "/usr/share/sounds/freedesktop/stereo/message.oga"))
;;;; pulsar
-(when window-system
- (use-package pulsar
- :ensure t
- :diminish
- :custom ((pulsar-pulse-functions
- '(ace-window
- backward-page
- delete-other-windows
- delete-window
- forward-page
- jao-prev-window
- move-to-window-line-top-bottom
- org-backward-heading-same-level
- org-forward-heading-same-level
- org-next-visible-heading
- org-previous-visible-heading
- other-window
- outline-backward-same-level
- outline-forward-same-level
- outline-next-visible-heading
- outline-previous-visible-heading
- outline-up-heading
- recenter-top-bottom
- reposition-window
- scroll-down-command
- scroll-up-command))
- (pulsar-pulse t)
- (pulsar-delay 0.1)
- (pulsar-iterations 10)
- (pulsar-face 'pulsar-yellow)
- (pulsar-highlight-face 'jao-themes--hilite))
- :hook ((jao-afio-switch . pulsar-pulse-line)))
- (pulsar-global-mode))
-
+(use-package pulsar
+ :ensure t
+ :diminish
+ :custom ((pulsar-pulse t)
+ (pulsar-delay 0.1)
+ (pulsar-iterations 10)
+ (pulsar-face 'pulsar-yellow)
+ (pulsar-highlight-face 'jao-themes--hilite))
+ :config (add-to-list 'pulsar-pulse-functions 'jao-prev-window)
+ :hook ((jao-afio-switch . pulsar-pulse-line)
+ (consult-after-jump . pulsar-recenter-top)
+ (consult-after-jump . pulsar-reveal-entry)
+ (imenu-after-jump . pulsar-recenter-top)
+ (imenu-after-jump . pulsar-reveal-entry)
+ (next-error . pulsar-pulse-line)))
;;; Calendar, diary, weather
;;;; diary