summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el71
-rw-r--r--lisp/+tab-bar.el8
-rw-r--r--lisp/remember.el19
3 files changed, 75 insertions, 23 deletions
diff --git a/init.el b/init.el index d1dc6e3..36c2bed 100644 --- a/init.el +++ b/init.el
@@ -113,7 +113,7 @@
113 (+ensure-after-init #'+pulse-location-mode)) 113 (+ensure-after-init #'+pulse-location-mode))
114 114
115(setup (:require reading) 115(setup (:require reading)
116 (:hook-into view-mode) ; XXX doesn't go back 116 ;;(:hook-into view-mode) ; XXX doesn't go back
117 ) 117 )
118 118
119(setup (:require user-save) 119(setup (:require user-save)
@@ -164,10 +164,11 @@
164 "pixelfed" "instagram.com" "bibliogram.art" 164 "pixelfed" "instagram.com" "bibliogram.art"
165 "reddit.com" "teddit.net" 165 "reddit.com" "teddit.net"
166 "taskiq" 166 "taskiq"
167 "twitter.com" "nitter.net" 167 "twitter.com" "nitter.net" "t.co"
168 "streamable.com" 168 "streamable.com" "spotify.com"
169 "hetzner.cloud")) 169 "hetzner.cloud"))
170 (add-to-list '+browse-url-secondary-browser-regexps domain)) 170 (add-to-list '+browse-url-secondary-browser-regexps
171 (replace-regexp-in-string "\\." "\\\\." domain)))
171 ;; Set up URL handlers. 172 ;; Set up URL handlers.
172 (+browse-url-set-handlers 173 (+browse-url-set-handlers
173 (list 174 (list
@@ -428,7 +429,6 @@
428 (string-match-p "lisp/org\\'" path)) 429 (string-match-p "lisp/org\\'" path))
429 load-path)) 430 load-path))
430 (:also-load +org 431 (:also-load +org
431 ox-md
432 _work) 432 _work)
433 (:option org-adapt-indentation nil 433 (:option org-adapt-indentation nil
434 org-archive-mark-done t 434 org-archive-mark-done t
@@ -444,12 +444,6 @@
444 org-cycle-separator-lines 0 444 org-cycle-separator-lines 0
445 org-directory (sync/ "org/" t) 445 org-directory (sync/ "org/" t)
446 org-ellipsis truncate-string-ellipsis 446 org-ellipsis truncate-string-ellipsis
447 org-export-coding-system 'utf-8-unix
448 org-export-headline-levels 8
449 org-export-with-section-numbers nil
450 org-export-with-smart-quotes t
451 org-export-with-sub-superscripts t
452 org-export-with-toc nil
453 org-fontify-done-headline t 447 org-fontify-done-headline t
454 org-fontify-quote-and-verse-blocks t 448 org-fontify-quote-and-verse-blocks t
455 org-fontify-whole-heading-line t 449 org-fontify-whole-heading-line t
@@ -553,6 +547,17 @@
553 (:option org-contacts-matcher "contact") ; Contacts are tagged "contact" 547 (:option org-contacts-matcher "contact") ; Contacts are tagged "contact"
554 ) 548 )
555 549
550(setup org-export
551 (:also-load ox-md)
552 (:option org-export-coding-system 'utf-8-unix
553 org-export-headline-levels 8
554 org-export-with-section-numbers nil
555 org-export-with-smart-quotes t
556 org-export-with-sub-superscripts t
557 org-export-with-toc nil)
558 (with-eval-after-load 'user-save
559 (add-hook 'org-export-before-processing-hook #'user-save-buffer)))
560
556(setup prog 561(setup prog
557 (:local-set comment-auto-fill-only-comments t) 562 (:local-set comment-auto-fill-only-comments t)
558 (:hook #'prettify-symbols-mode 563 (:hook #'prettify-symbols-mode
@@ -572,7 +577,7 @@
572 577
573(setup tab-bar 578(setup tab-bar
574 (:require +tab-bar) 579 (:require +tab-bar)
575 (:option tab-bar-tab-name-function '+tab-bar-tab-name-truncated-left 580 (:option tab-bar-tab-name-function '+tab-bar-basename
576 tab-bar-tab-name-truncated-max 20 581 tab-bar-tab-name-truncated-max 20
577 tab-bar-tab-name-ellipsis truncate-string-ellipsis 582 tab-bar-tab-name-ellipsis truncate-string-ellipsis
578 tab-bar-show t) 583 tab-bar-show t)
@@ -583,7 +588,8 @@
583 (:hook #'turn-on-auto-fill)) 588 (:hook #'turn-on-auto-fill))
584 589
585(setup time 590(setup time
586 (:option display-time-format "%H:%M") 591 (:option display-time-format "%H:%M"
592 display-time-default-load-average nil)
587 (display-time-mode +1)) 593 (display-time-mode +1))
588 594
589(setup (:straight 0x0) 595(setup (:straight 0x0)
@@ -620,13 +626,22 @@
620 626
621(setup (:straight-when (apheleia 627(setup (:straight-when (apheleia
622 :host github :repo "raxod502/apheleia") 628 :host github :repo "raxod502/apheleia")
623 (executable-find "diff")) 629 (eq system-type 'gnu/linux))
624 (:require apheleia 630 (:require apheleia
625 +apheleia) 631 +apheleia)
632 ;; (setf (alist-get 'prettier apheleia-formatters)
633 ;; '("npx" "prettier" "--stdin-filepath" filepath))
626 (apheleia-global-mode +1)) 634 (apheleia-global-mode +1))
627 635
628(setup (:straight avy) 636(setup (:straight avy)
629 (:require avy +avy) 637 (:require avy +avy)
638 (:option avy-background t
639 avy-lead-faces
640 '(avy-lead-face
641 avy-lead-face-1 avy-lead-face-1 avy-lead-face-1
642 avy-lead-face-1 avy-lead-face-1 avy-lead-face-1))
643 (:face avy-background-face
644 ((t (:foreground "#888888"))))
630 (:+key "M-j" #'avy-goto-char-timer) 645 (:+key "M-j" #'avy-goto-char-timer)
631 (:bind-into isearch 646 (:bind-into isearch
632 "M-j" #'avy-isearch) 647 "M-j" #'avy-isearch)
@@ -779,7 +794,14 @@
779 (,(+lui-make-formatting-list-rx "_") 794 (,(+lui-make-formatting-list-rx "_")
780 1 lui-emphasis-face) 795 1 lui-emphasis-face)
781 (,(+lui-make-formatting-list-rx "/") 796 (,(+lui-make-formatting-list-rx "/")
782 1 lui-emphasis-face))) 797 1 lui-emphasis-face))
798 lui-autopaste-function
799 (defun +0x0-upload-string (string)
800 "Upload a string using 0x0."
801 (with-temp-buffer
802 (insert string)
803 (0x0-upload-text (0x0--choose-server)))
804 (current-kill 0)))
783 (add-to-list '+pulse-location-commands #'lui-track-jump-to-indicator) 805 (add-to-list '+pulse-location-commands #'lui-track-jump-to-indicator)
784 (:hook #'visual-line-mode 806 (:hook #'visual-line-mode
785 #'enable-lui-track 807 #'enable-lui-track
@@ -787,7 +809,8 @@
787 (defun +disable-electric-pair-mode () 809 (defun +disable-electric-pair-mode ()
788 "Disable `electric-pair-mode' in the current buffer." 810 "Disable `electric-pair-mode' in the current buffer."
789 (interactive) 811 (interactive)
790 (electric-pair-local-mode -1))) 812 (electric-pair-local-mode -1))
813 #'enable-lui-autopaste)
791 (:local-set fringes-outside-margins t 814 (:local-set fringes-outside-margins t
792 right-margin-width (length lui-time-stamp-format) 815 right-margin-width (length lui-time-stamp-format)
793 scroll-margin 0 816 scroll-margin 0
@@ -973,6 +996,7 @@ See also `crux-reopen-as-root-mode'."
973 elfeed-show-unique-buffers t 996 elfeed-show-unique-buffers t
974 elfeed-db-directory (elfeed/ "db/" t)) 997 elfeed-db-directory (elfeed/ "db/" t))
975 (:+key "C-x w" #'elfeed) 998 (:+key "C-x w" #'elfeed)
999 (advice-add #'elfeed-search-fetch :after #'beginning of buffer)
976 (:with-mode elfeed-search-mode 1000 (:with-mode elfeed-search-mode
977 (:bind "&" #'+elfeed-search-browse-generic) 1001 (:bind "&" #'+elfeed-search-browse-generic)
978 (:hook #'hl-line-mode) 1002 (:hook #'hl-line-mode)
@@ -1190,7 +1214,10 @@ See also `crux-reopen-as-root-mode'."
1190 (keychain-refresh-environment)) 1214 (keychain-refresh-environment))
1191 1215
1192(setup (:straight lacarte) 1216(setup (:straight lacarte)
1193 (:+key "<f10>" #'lacarte-execute-menu-command)) 1217 (:+key "<f10>" #'lacarte-execute-menu-command)
1218 (with-eval-after-load 'vertico-multiform
1219 (setf (alist-get 'lacarte-execute-menu-command vertico-multiform-commands)
1220 '(buffer grid (vertico-sort-function . vertico-sort-length-alpha)))))
1194 1221
1195(setup (:straight (lin :host gitlab :repo "protesilaos/lin")) 1222(setup (:straight (lin :host gitlab :repo "protesilaos/lin"))
1196 (require 'lin) 1223 (require 'lin)
@@ -1240,7 +1267,8 @@ See also `crux-reopen-as-root-mode'."
1240 :host gitlab 1267 :host gitlab
1241 :repo "protesilaos/modus-themes")) 1268 :repo "protesilaos/modus-themes"))
1242 (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes")) 1269 (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes"))
1243 (:option modus-themes-bold-constructs t 1270 (:option modus-themes-mixed-fonts t
1271 modus-themes-bold-constructs t
1244 modus-themes-italic-constructs t 1272 modus-themes-italic-constructs t
1245 modus-themes-headings '((t . (background)))) 1273 modus-themes-headings '((t . (background))))
1246 (+sunrise-sunset 'modus-themes-load-operandi 'modus-themes-load-vivendi)) 1274 (+sunrise-sunset 'modus-themes-load-operandi 'modus-themes-load-vivendi))
@@ -1324,7 +1352,8 @@ See also `crux-reopen-as-root-mode'."
1324(setup (:straight (simple-modeline 1352(setup (:straight (simple-modeline
1325 :fork (:host github :repo "duckwork/simple-modeline"))) 1353 :fork (:host github :repo "duckwork/simple-modeline")))
1326 (:require +modeline) 1354 (:require +modeline)
1327 (:option simple-modeline-segments 1355 (:option +modeline-minions-icon ";"
1356 simple-modeline-segments
1328 `(( ; left 1357 `(( ; left
1329 +modeline-ace-window-display 1358 +modeline-ace-window-display
1330 +modeline-modified 1359 +modeline-modified
@@ -1361,7 +1390,9 @@ See also `crux-reopen-as-root-mode'."
1361 :host github 1390 :host github
1362 :repo "duckwork/sophomore.el")) 1391 :repo "duckwork/sophomore.el"))
1363 (sophomore-enable #'narrow-to-region) 1392 (sophomore-enable #'narrow-to-region)
1364 (sophomore-disable #'view-hello-file) 1393 (sophomore-disable ; These are mostly annoying commands
1394 #'view-hello-file
1395 #'describe-gnu-project)
1365 (sophomore-mode +1)) 1396 (sophomore-mode +1))
1366 1397
1367(setup (:straight ssh-config-mode) 1398(setup (:straight ssh-config-mode)
diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index 1dc1f68..1ee7606 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el
@@ -21,6 +21,14 @@
21(defvar +tab-bar-show-original nil 21(defvar +tab-bar-show-original nil
22 "Original value of `tab-bar-show'.") 22 "Original value of `tab-bar-show'.")
23 23
24(defun +tab-bar-basename ()
25 "Generate the tab name from the basename of the buffer of the
26 selected window."
27 (let* ((tab-file-name (buffer-file-name (window-buffer (minibuffer-selected-window)))))
28 (if tab-file-name
29 (file-name-nondirectory tab-file-name)
30 (+tab-bar-tab-name-truncated-left))))
31
24(defun +tab-bar-tab-name-truncated-left () 32(defun +tab-bar-tab-name-truncated-left ()
25 "Generate the tab name from the buffer of the selected window. 33 "Generate the tab name from the buffer of the selected window.
26This is just like `tab-bar-tab-name-truncated', but truncates the 34This is just like `tab-bar-tab-name-truncated', but truncates the
diff --git a/lisp/remember.el b/lisp/remember.el index 39476d1..a759419 100644 --- a/lisp/remember.el +++ b/lisp/remember.el
@@ -1,4 +1,17 @@
1;; ABANDON ALL HOPE YE WHO ENTER HERE 1;;; remember.el --- Remember variables and modes -*- lexical-binding: t; -*-
2
3;;; Code:
4
5(defmacro remember-remember (alist)
6 (let* ((template (format "remember--%s-%%s" (gensym)))
7 (reset-fn (intern (format template "recall")))
8 (things (cl-loop for (sym . newval) in alist
9 as rem = (intern (format template sym))
10
11 ;; Collect original values
12
13 )))))
14
2 15
3(defmacro remember-set (&rest symbols) 16(defmacro remember-set (&rest symbols)
4 "Setup a closure remembering symbols to apply with 17 "Setup a closure remembering symbols to apply with
@@ -6,7 +19,7 @@
6SYMBOLS is a plist: the properties are symbols or mode names, and 19SYMBOLS is a plist: the properties are symbols or mode names, and
7their values what to set after `remember-setup'." 20their values what to set after `remember-setup'."
8 (let* ((template (format "remember--%s-%%s" (gensym))) 21 (let* ((template (format "remember--%s-%%s" (gensym)))
9 (reset-fn (intern (format template "reset" "fn"))) 22 (reset-fn (intern (format template "reset")))
10 (list (cl-loop for sym in symbols by #'cddr 23 (list (cl-loop for sym in symbols by #'cddr
11 collect `(,(intern (format template sym)) 24 collect `(,(intern (format template sym))
12 ,sym) 25 ,sym)
@@ -39,5 +52,5 @@ their values what to set after `remember-setup'."
39 52
40;; test 53;; test
41 54
42(setq fn (remember-set display-fill-column-indicator-mode disable)) 55(set 'fn (remember-set display-fill-column-indicator-mode disable))
43(funcall fn) 56(funcall fn)