summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el36
-rw-r--r--lisp/+Info.el17
-rw-r--r--lisp/+elisp.el2
-rw-r--r--lisp/+modeline.el3
-rw-r--r--lisp/+org-capture.el5
5 files changed, 55 insertions, 8 deletions
diff --git a/init.el b/init.el index cd1e674..13284d1 100644 --- a/init.el +++ b/init.el
@@ -96,15 +96,27 @@
96(setup (:require reading) 96(setup (:require reading)
97 (:global "C-c C-r" #'reading-mode)) 97 (:global "C-c C-r" #'reading-mode))
98 98
99(setup Info
100 (:hook #'reading-mode))
101
102(setup abbrev 99(setup abbrev
103 (:option abbrev-file-name (sync/ "abbrev.el") 100 (:option abbrev-file-name (sync/ "abbrev.el")
104 save-abbrevs 'silent) 101 save-abbrevs 'silent)
105 (:hook-into text-mode 102 (:hook-into text-mode
106 circe-chat-mode)) 103 circe-chat-mode))
107 104
105(setup auto-insert
106 (setf (alist-get '("lisp/.*\\.el\\'" . "+Emacs lisp")
107 auto-insert-alist nil nil #'equal)
108 '("" ";;; " (file-name-nondirectory (buffer-file-name))
109 (make-string (max 2 (- fill-column (current-column) 27)) 32)
110 "-*- lexical-binding: t; -*-"
111 '(setq lexical-binding t)
112 "\n\n;;Copyright (C) " (format-time-string "%Y")
113 " " (progn user-full-name)
114 "\n\n;;; Code:"
115 "\n\n" _
116 "\n\n(provide '" (file-name-base (buffer-file-name)) ")"
117 "\n;;; " (file-name-nondirectory (buffer-file-name)) " ends here\n"))
118 (auto-insert-mode +1))
119
108(setup autorevert 120(setup autorevert
109 (:option global-auto-revert-non-file-buffers t 121 (:option global-auto-revert-non-file-buffers t
110 auto-revert-verbose nil) 122 auto-revert-verbose nil)
@@ -133,7 +145,8 @@
133 "tildes.net" 145 "tildes.net"
134 "taskiq" 146 "taskiq"
135 "twitter.com" "nitter.net" 147 "twitter.com" "nitter.net"
136 "streamable.com")) 148 "streamable.com"
149 "hetzner.cloud"))
137 (add-to-list '+browse-url-secondary-browser-regexps domain)) 150 (add-to-list '+browse-url-secondary-browser-regexps domain))
138 ;; Set up URL handlers. 151 ;; Set up URL handlers.
139 (+browse-url-set-handlers 152 (+browse-url-set-handlers
@@ -147,7 +160,7 @@
147 args))) 160 args)))
148 (cons (rx ; videos 161 (cons (rx ; videos
149 (or "youtube.com" "youtu.be" "yewtu.be" 162 (or "youtube.com" "youtu.be" "yewtu.be"
150 (seq "." (or "mp4" "gif" "mov" "MOV") eos))) 163 (seq "." (or "mp4" "gif" "mov" "MOV" "webm") eos)))
151 (lambda (&rest args) 164 (lambda (&rest args)
152 (apply (if (executable-find "mpv") 165 (apply (if (executable-find "mpv")
153 #'+browse-url-with-mpv 166 #'+browse-url-with-mpv
@@ -328,6 +341,13 @@
328 (ibuffer-auto-mode +1) 341 (ibuffer-auto-mode +1)
329 (ibuffer-switch-to-saved-filter-groups "default")))) 342 (ibuffer-switch-to-saved-filter-groups "default"))))
330 343
344(setup info
345 (:also-load +Info)
346 (:with-mode Info-mode ; -_-
347 (:hook #'reading-mode)
348 (:bind "c" #'+Info-copy-current-node-name
349 "w" #'+Info-copy-current-node-name)))
350
331(setup kmacro 351(setup kmacro
332 (:also-load +kmacro) 352 (:also-load +kmacro)
333 (with-eval-after-load '+kmacro 353 (with-eval-after-load '+kmacro
@@ -521,6 +541,10 @@
521 :repo "duckwork/actually-selected-window.el")) 541 :repo "duckwork/actually-selected-window.el"))
522 (actually-selected-window-mode +1)) 542 (actually-selected-window-mode +1))
523 543
544(setup (:straight adaptive-wrap)
545 (:with-mode adaptive-wrap-prefix-mode
546 (:hook-into visual-column-mode)))
547
524(setup (:straight anzu) 548(setup (:straight anzu)
525 (:option anzu-cons-mode-line-p nil) 549 (:option anzu-cons-mode-line-p nil)
526 (:+key [remap query-replace] #'anzu-query-replace-regexp 550 (:+key [remap query-replace] #'anzu-query-replace-regexp
@@ -670,7 +694,7 @@
670 lui-time-stamp-position 'right-margin 694 lui-time-stamp-position 'right-margin
671 lui-time-stamp-format "[ %H:%M" 695 lui-time-stamp-format "[ %H:%M"
672 lui-track-behavior 'before-switch-to-buffer 696 lui-track-behavior 'before-switch-to-buffer
673 lui-track-indicator 'fringe 697 lui-track-indicator 'bar
674 lui-fill-remove-face-from-newline nil 698 lui-fill-remove-face-from-newline nil
675 lui-formatting-list `((,(+lui-make-formatting-list-rx "*") 699 lui-formatting-list `((,(+lui-make-formatting-list-rx "*")
676 1 lui-strong-face) 700 1 lui-strong-face)
diff --git a/lisp/+Info.el b/lisp/+Info.el new file mode 100644 index 0000000..a3c2fcd --- /dev/null +++ b/lisp/+Info.el
@@ -0,0 +1,17 @@
1;;; +Info.el -*- lexical-binding: t; -*-
2
3;;Copyright (C) 2022 Case Duckworth
4
5;;; Code:
6
7(require 'info)
8
9(defun +Info-copy-current-node-name (&optional arg)
10 "Put the name of the current Info invocation intothe kill ring.
11This is the same as `Info-copy-current-node-name', but with the
12arg reversed."
13 (interactive "P" Info-mode)
14 (Info-copy-current-node-name (unless arg 0)))
15
16(provide '+Info)
17;;; +Info.el ends here
diff --git a/lisp/+elisp.el b/lisp/+elisp.el index d2f018a..3eafbf3 100644 --- a/lisp/+elisp.el +++ b/lisp/+elisp.el
@@ -6,7 +6,7 @@
6 (interactive) 6 (interactive)
7 (if (region-active-p) 7 (if (region-active-p)
8 (eval-region (region-beginning) (region-end)) 8 (eval-region (region-beginning) (region-end))
9 (eval-buffer))) 9 (+eval-region@pulse (lambda (_ _) (eval-buffer)) (point-min) (point-max))))
10 10
11;; Should I move this to `+pulse' ? 11;; Should I move this to `+pulse' ?
12(defun +eval-region@pulse (advised beg end &rest args) 12(defun +eval-region@pulse (advised beg end &rest args)
diff --git a/lisp/+modeline.el b/lisp/+modeline.el index db3deb4..4063d83 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el
@@ -91,7 +91,8 @@ This function makes a lambda, so you can throw it straight into
91 (propertize (+string-truncate (format-mode-line mode-name) 12) 91 (propertize (+string-truncate (format-mode-line mode-name) 12)
92 'face 'bold 92 'face 'bold
93 'keymap mode-line-major-mode-keymap 93 'keymap mode-line-major-mode-keymap
94 'help-echo (concat mode-name " mode\nmouse-1: show menu.") 94 'help-echo (concat (format-mode-line mode-name)
95 " mode\nmouse-1: show menu.")
95 'mouse-face 'mode-line-highlight))) 96 'mouse-face 'mode-line-highlight)))
96 97
97(defcustom +modeline-modified-icon-alist '((ephemeral . "*") 98(defcustom +modeline-modified-icon-alist '((ephemeral . "*")
diff --git a/lisp/+org-capture.el b/lisp/+org-capture.el index 6968657..ba036bd 100644 --- a/lisp/+org-capture.el +++ b/lisp/+org-capture.el
@@ -3,6 +3,7 @@
3;;; Code: 3;;; Code:
4 4
5(require 'cl-lib) 5(require 'cl-lib)
6(require 'acdw)
6;; We don't require `org-capture' here because I'll have to require this library 7;; We don't require `org-capture' here because I'll have to require this library
7;; to init.el /before/ org-capture is fully needed. But I do need to declare 8;; to init.el /before/ org-capture is fully needed. But I do need to declare
8;; `org-capture-templates'. 9;; `org-capture-templates'.
@@ -39,6 +40,10 @@ LIST is a symbol and defaults to `org-capture-templates'."
39 (set list (sort (symbol-value list) (lambda (a b) 40 (set list (sort (symbol-value list) (lambda (a b)
40 (string< (car a) (car b)))))) 41 (string< (car a) (car b))))))
41 42
43(defun +org-capture-sort-after-init (&optional list)
44 "Sort LIST with `+org-capture-sort' after Emacs init."
45 (+ensure-after-init #'+org-capture-sort))
46
42;;;###autoload 47;;;###autoload
43(defun +org-capture-templates-setf (key value &optional list sort-after) 48(defun +org-capture-templates-setf (key value &optional list sort-after)
44 "Add KEY to LIST, using `setf'. 49 "Add KEY to LIST, using `setf'.