From 9193929177a1164c07482165db6a3c624c0544a1 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 31 Dec 2021 13:13:17 +0000 Subject: attic --- attic/misc.org | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'attic') diff --git a/attic/misc.org b/attic/misc.org index 931aeb4..ddc5cd9 100644 --- a/attic/misc.org +++ b/attic/misc.org @@ -1,5 +1,20 @@ #+title: Miscellaneous config bits that i don't use anymore +* portability macros + #+begin_src emacs-lisp + (defmacro jao-syscase (clauses) + (let ((cls (assoc system-type clauses))) + (when cls `(progn ,@(cdr cls))))) + + (defmacro jao-d-l (darw linux) + `(jao-syscase ((darwin ,darw) (gnu/linux ,linux)))) + + (defmacro jao-when-darwin (&rest body) + `(jao-syscase ((darwin ,@body)))) + + (defmacro jao-when-linux (&rest body) + `(jao-syscase ((gnu/linux ,@body)))) + #+end_src * outlines #+begin_src emacs-lisp @@ -495,6 +510,30 @@ :diminish ((rcirc-omit-mode . ""))) #+end_src +* ace-window + #+begin_src emacs-lisp + (defun jao-ace-switch-buffer-other-window () + (interactive) + (aw-select "Other window" + (if (eq jao-completion-engine 'consult) + (lambda (w) + (aw-switch-to-window w) + (call-interactively 'consult-buffer)) + #'aw-switch-buffer-in-window))) + + (defun jao-ace-find-file-other-window () + (interactive) + (aw-select "Other window" + (lambda (w) + (let ((df default-directory)) + (aw-switch-to-window w) + (let ((default-directory df)) + (call-interactively 'find-file)))))) + + (global-set-key (kbd "C-x 4 f") #'jao-ace-find-file-other-window) + (global-set-key (kbd "C-x 4 b") #'jao-ace-switch-buffer-other-window) + #+end_src + * switch window An alternative for this one is ace-window, but it has the problem of not displaying its overlay over org buffers (sometimes) and @@ -505,6 +544,7 @@ :custom ((switch-window-minibuffer-shortcut ?z) (switch-window-background t) (switch-window-shortcut-style 'qwerty) + (switch-window-shortcut-appearance 'text) (switch-window-timeout 7) (switch-window-threshold 2)) :init (defalias 'jao-other-window 'switch-window) @@ -529,8 +569,8 @@ :bind (("M-o" . switch-window) ("M-O" . switch-window-then-swap-buffer) - ("H-s-o" . switch-window) - ("H-s-O" . switch-window-then-swap-buffer) + ("s-o" . switch-window) + ("s-O" . switch-window-then-swap-buffer) ("C-x 4 d" . jao-switch-window-then-dired) ("C-x 4 f" . jao-switch-window-then-find-file) ("C-x 4 b" . jao-switch-window-then-consult-buffer))) @@ -862,3 +902,11 @@ ;; (vertico-buffer-mode -1)) #+end_src +* window config persistence + #+begin_src emacs-lisp + (use-package bookmark-view + :ensure t + :bind (("C-c v" . bookmark-view) + ("C-c B" . bookmark-set))) + + #+end_src -- cgit v1.2.3