From cc3587285dd6062094d5963e191f24a4e64764ca Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 3 Jun 2022 21:46:55 +0100 Subject: in good company --- attic/misc.org | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) (limited to 'attic') diff --git a/attic/misc.org b/attic/misc.org index fdfc193..3a31d6a 100644 --- a/attic/misc.org +++ b/attic/misc.org @@ -1,3 +1,65 @@ +* corfu + #+begin_src emacs-lisp + (use-package corfu + :ensure t + :demand t + :init (setq corfu-echo-documentation 0.25 + corfu-cycle t + corfu-count 15 + corfu-quit-no-match t + corfu-auto t + corfu-commit-predicate nil + corfu-preview-current nil + corfu-preselect-first t + corfu-min-width 20 + corfu-max-width 100) + :config + + ;; show eldoc string immediately after accepted completion too + (with-eval-after-load "eldoc" + (eldoc-add-command-completions "corfu-")) + + (defun jao-corfu-enable-no-auto () + (setq-local corfu-auto nil) + (corfu-mode 1)) + + (defmacro jao-corfu-no-auto (mode) + (let ((mode-name (intern (format "%s-mode" mode))) + (hook-name (intern (format "%s-mode-hook" mode)))) + `(with-eval-after-load ',mode + (add-to-list 'corfu-excluded-modes ',mode-name) + (add-hook ',hook-name #'jao-corfu-enable-no-auto)))) + + (jao-corfu-no-auto eshell) + ;; (add-to-list 'corfu-excluded-modes 'notmuch-message-mode) + + (defun jao-corfu--active-p () + (and (>= corfu--index 0) (/= corfu--index corfu--preselect))) + + (defun jao-corfu-quit-or-insert () + (interactive) + (if (jao-corfu--active-p) (corfu-insert) (corfu-quit))) + + (defun jao-corfu-quit-or-previous () + (interactive) + (if (jao-corfu--active-p) + (corfu-previous) + (corfu-quit) + (previous-line))) + + :bind (:map corfu-map + ("C-" . corfu-insert) + ("\r" . jao-corfu-quit-or-insert) + ("C-p" . jao-corfu-quit-or-previous))) + + (defun corfu-in-minibuffer () + (when (not (bound-and-true-p vertico--input)) (corfu-mode 1))) + + (when (display-graphic-p) + (add-hook 'minibuffer-setup-hook #'corfu-in-minibuffer 1) + (global-corfu-mode 1)) + + #+end_src * erc *** package #+begin_src emacs-lisp @@ -168,3 +230,26 @@ (jao-shorten-modes 'signel-chat-mode)) (setq signel-report-deliveries t) #+end_src +* cdlatex + #+begin_src emacs-lisp + (use-package cdlatex + :ensure t + :hook ((org-mode . org-cdlatex-mode)) + :diminish ((cdlatex-mode . " £") + (org-cdlatex-mode . " £"))) + #+end_src +* maps + #+begin_src emacs-lisp + (use-package osm + :ensure t + :init + (with-eval-after-load 'org (require 'osm-ol)) + :config + (transient-define-prefix jao-transient-osm () + ["Open Street Maps" + ("s" "search" osm-search) + ("g" "goto" osm-goto) + ("b" "jump to bookmark" osm-bookmark-jump) + ("t" "server" osm-server)]) + :bind ("C-c M" . #'jao-transient-osm)) + #+end_src -- cgit v1.2.3