summaryrefslogtreecommitdiffhomepage
path: root/attic
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-06-03 21:46:55 +0100
committerjao <jao@gnu.org>2022-06-03 21:46:55 +0100
commitcc3587285dd6062094d5963e191f24a4e64764ca (patch)
tree855e8072a9bf37b6e955f64c5ae77b806a3af5be /attic
parentc2fdc5b445aa5ff8c53aa4ef6e098aa0dd180d96 (diff)
downloadelibs-cc3587285dd6062094d5963e191f24a4e64764ca.tar.gz
elibs-cc3587285dd6062094d5963e191f24a4e64764ca.tar.bz2
in good company
Diffstat (limited to 'attic')
-rw-r--r--attic/misc.org85
1 files changed, 85 insertions, 0 deletions
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-<return>" . 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