diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 105 |
1 files changed, 75 insertions, 30 deletions
diff --git a/init.el b/init.el index 26f8c47..bb6006d 100644 --- a/init.el +++ b/init.el | |||
@@ -21,20 +21,19 @@ | |||
21 | private)) | 21 | private)) |
22 | (require (or (car-safe feature) feature) (cdr-safe feature) :noerror)) | 22 | (require (or (car-safe feature) feature) (cdr-safe feature) :noerror)) |
23 | 23 | ||
24 | (setq debug-on-error t) | 24 | (setq debug-on-error (memq system-type '(msdos windows-nt))) |
25 | 25 | ||
26 | (setup (:require +emacs) | 26 | (setup (:require +emacs) |
27 | (:also-load +lisp) | ||
28 | ;; +emacs.el contains super-basic defaults that are basically necessary for | 27 | ;; +emacs.el contains super-basic defaults that are basically necessary for |
29 | ;; good functioning. In this block, I add extra things or more "experimental" | 28 | ;; good functioning. In this block, I add extra things or more "experimental" |
30 | ;; ones that might not belong in a separate file. | 29 | ;; ones that might not belong in a separate file. |
30 | (:also-load +lisp) | ||
31 | (:option truncate-string-ellipsis "…") | 31 | (:option truncate-string-ellipsis "…") |
32 | ;; Bindings | 32 | ;; Bindings |
33 | (:global "C-x C-k" #'kill-current-buffer | 33 | (:global "C-x C-k" #'kill-current-buffer |
34 | "C-x 4 n" #'clone-buffer | 34 | "C-x 4 n" #'clone-buffer |
35 | "C-c v" #'visible-mode | 35 | "C-c v" #'visible-mode |
36 | "C-M-;" #'+lisp-comment-or-uncomment-sexp | 36 | "C-M-;" #'+lisp-comment-or-uncomment-sexp) |
37 | "<f12>" #'consult-buffer) | ||
38 | ;; Unbind stuff, too. | 37 | ;; Unbind stuff, too. |
39 | (dolist (key '("C-M-j" | 38 | (dolist (key '("C-M-j" |
40 | "M-j")) | 39 | "M-j")) |
@@ -56,10 +55,7 @@ | |||
56 | (+ensure-after-init #'+key-global-mode)) | 55 | (+ensure-after-init #'+key-global-mode)) |
57 | 56 | ||
58 | (setup (:require auth-source) | 57 | (setup (:require auth-source) |
59 | (:option auth-sources (list (private/ "authinfo") | 58 | (:option auth-sources (list (private/ "authinfo")))) |
60 | (private/ "authinfo.gpg") | ||
61 | "~/.authinfo" | ||
62 | "~/.authinfo.gpg"))) | ||
63 | 59 | ||
64 | (setup (:require goto-addr) | 60 | (setup (:require goto-addr) |
65 | (if (fboundp #'global-goto-address-mode) | 61 | (if (fboundp #'global-goto-address-mode) |
@@ -139,7 +135,7 @@ | |||
139 | (cons (+browse-url-secondary-browser-regexps-combine) ; non-text websites | 135 | (cons (+browse-url-secondary-browser-regexps-combine) ; non-text websites |
140 | browse-url-secondary-browser-function) | 136 | browse-url-secondary-browser-function) |
141 | (cons "." ; everything else | 137 | (cons "." ; everything else |
142 | browse-url-browser-function))) | 138 | +browse-url-browser-function))) |
143 | ;; Transform URLs before passing to `browse-url' | 139 | ;; Transform URLs before passing to `browse-url' |
144 | (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" | 140 | (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" |
145 | "youtu.be")) | 141 | "youtu.be")) |
@@ -193,11 +189,16 @@ | |||
193 | dired+) | 189 | dired+) |
194 | (:option dired-recursive-copies 'always | 190 | (:option dired-recursive-copies 'always |
195 | dired-recursive-deletes 'always | 191 | dired-recursive-deletes 'always |
196 | dired-create-destination-dirs 'ask | 192 | dired-create-destination-dirs 'always |
193 | dired-do-revert-buffer t | ||
194 | dired-hide-details-hide-symlink-targets nil | ||
195 | dired-isearch-filenames 'dwim | ||
197 | delete-by-moving-to-trash t | 196 | delete-by-moving-to-trash t |
197 | dired-auto-revert-buffer t | ||
198 | dired-listing-switches "-Al" | 198 | dired-listing-switches "-Al" |
199 | ls-lisp-dirs-first t | 199 | ls-lisp-dirs-first t |
200 | dired-ls-F-marks-symlinks t | 200 | dired-ls-F-marks-symlinks t |
201 | dired-clean-confirm-killing-deleted-buffers nil | ||
201 | dired-no-confirm '(byte-compile | 202 | dired-no-confirm '(byte-compile |
202 | load chgrp chmod chown | 203 | load chgrp chmod chown |
203 | copy move hardlink symlink | 204 | copy move hardlink symlink |
@@ -256,8 +257,14 @@ | |||
256 | (add-hook 'eshell-mode-hook | 257 | (add-hook 'eshell-mode-hook |
257 | (defun +eshell@setup () | 258 | (defun +eshell@setup () |
258 | "Eshell improperly does loading. Gah." | 259 | "Eshell improperly does loading. Gah." |
260 | (interactive) | ||
259 | (dolist (setting `((outline-regexp . ,eshell-prompt-regexp) | 261 | (dolist (setting `((outline-regexp . ,eshell-prompt-regexp) |
260 | (page-delimiter . ,eshell-prompt-regexp))) | 262 | (page-delimiter . ,eshell-prompt-regexp) |
263 | (imenu-generic-expression | ||
264 | . ,`(("Prompt" | ||
265 | ,(concat eshell-prompt-regexp | ||
266 | "\\(.*\\)") | ||
267 | 1))))) | ||
261 | (set (make-local-variable (car setting)) (cdr setting))) | 268 | (set (make-local-variable (car setting)) (cdr setting))) |
262 | (dolist (binding `(("C-d" . +eshell-quit-or-delete-char))) | 269 | (dolist (binding `(("C-d" . +eshell-quit-or-delete-char))) |
263 | (define-key eshell-mode-map | 270 | (define-key eshell-mode-map |
@@ -328,14 +335,7 @@ | |||
328 | ;; This setup is weird because of dependency issues | 335 | ;; This setup is weird because of dependency issues |
329 | (:straight (transient :host github :repo "magit/transient" :branch "master") | 336 | (:straight (transient :host github :repo "magit/transient" :branch "master") |
330 | (magit :host github :repo "magit/magit") | 337 | (magit :host github :repo "magit/magit") |
331 | (git-modes :host github :repo "magit/git-modes")) | 338 | (git-modes :host github :repo "magit/git-modes"))) |
332 | (when (eq system-type 'gnu/linux) | ||
333 | (:straight (forge :host github :repo "magit/forge")) | ||
334 | (with-eval-after-load 'magit | ||
335 | (require 'forge) | ||
336 | (add-to-list 'forge-alist | ||
337 | '("tildegit.org" "tildegit.org/api/v1" "tildegit.org" | ||
338 | forge-gitea-repository))))) | ||
339 | 339 | ||
340 | (setup minibuffer | 340 | (setup minibuffer |
341 | (:require +minibuffer) | 341 | (:require +minibuffer) |
@@ -775,8 +775,15 @@ | |||
775 | (:option consult--regexp-compiler 'consult--orderless-regexp-compiler)))) | 775 | (:option consult--regexp-compiler 'consult--orderless-regexp-compiler)))) |
776 | 776 | ||
777 | (setup (:straight crux) | 777 | (setup (:straight crux) |
778 | (:+key "C-o" #'crux-smart-open-line | 778 | ;; yes it's silly I have an addon to this addon. |
779 | "C-x 4 t" #'crux-transpose-windows) | 779 | (:also-load +crux) |
780 | (:option crux-shell-func #'crux-eshell) | ||
781 | (:global "C-o" #'crux-smart-open-line | ||
782 | "C-x 4 t" #'crux-transpose-windows | ||
783 | "M-w" #'+crux-kill-ring-save | ||
784 | "C-k" #'crux-kill-and-join-forward | ||
785 | "C-c d" #'+crux-insert-date-or-time) | ||
786 | (:+leader "s" #'crux-visit-shell-buffer) | ||
780 | 787 | ||
781 | (el-patch-feature crux) | 788 | (el-patch-feature crux) |
782 | (with-eval-after-load 'crux | 789 | (with-eval-after-load 'crux |
@@ -826,21 +833,36 @@ See also `crux-reopen-as-root-mode'." | |||
826 | 833 | ||
827 | (setup (:straight elfeed) | 834 | (setup (:straight elfeed) |
828 | (:also-load +elfeed) | 835 | (:also-load +elfeed) |
829 | (:option elfeed-use-curl t | 836 | (+define-dir elfeed/ (sync/ "emacs/elfeed/" t)) |
830 | elfeed-curl-extra-arguments '("--insecure") | 837 | (:option |
831 | elfeed-show-unique-buffers t | 838 | elfeed-curl-program-name (executable-find "curl") |
832 | elfeed-db-directory (sync/ "elfeed/db/" t)) | 839 | elfeed-use-curl elfeed-curl-program-name |
840 | elfeed-curl-extra-arguments '("--insecure") | ||
841 | elfeed-enclosure-default-dir (cl-loop for dir in '("~/var/download/" | ||
842 | "~/Downloads/") | ||
843 | if (file-exists-p dir) | ||
844 | return dir) | ||
845 | elfeed-search-filter "@1-month-ago +unread" | ||
846 | elfeed-search-trailing-width 24 | ||
847 | elfeed-search-title-min-width 24 | ||
848 | elfeed-search-title-max-width 78 | ||
849 | elfeed-show-unique-buffers t | ||
850 | elfeed-db-directory (elfeed/ "db/" t)) | ||
833 | ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ | 851 | ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ |
834 | (advice-add #'elfeed-search-update--force :after #'elfeed-db-save) | 852 | (advice-add #'elfeed-search-update--force :after #'elfeed-db-save) |
835 | (:with-mode elfeed-show-mode | 853 | (:with-mode elfeed-show-mode |
836 | (:bind "SPC" #'+elfeed-scroll-up-command | 854 | (:bind "SPC" #'+elfeed-scroll-up-command |
837 | "S-SPC" #'+elfeed-scroll-down-command) | 855 | "S-SPC" #'+elfeed-scroll-down-command) |
838 | (:hook #'reading-mode))) | 856 | (:hook #'reading-mode) |
857 | (define-advice elfeed-show-entry (:after (&rest _)) | ||
858 | (run-at-time 0 nil #'elfeed-show-refresh)))) | ||
839 | 859 | ||
840 | (setup (:straight elfeed-org) | 860 | (setup (:straight elfeed-org) |
841 | (:option rmh-elfeed-org-files (list (sync/ "elfeed/elfeed.org" t))) | 861 | (:option rmh-elfeed-org-files (list (elfeed/ "/elfeed.org" t))) |
842 | (elfeed-org)) | 862 | (elfeed-org)) |
843 | 863 | ||
864 | (setup (:straight elpher)) | ||
865 | |||
844 | (setup (:straight embark) | 866 | (setup (:straight embark) |
845 | (:option prefix-help-command 'embark-prefix-help-command) | 867 | (:option prefix-help-command 'embark-prefix-help-command) |
846 | (:+key "C-." #'embark-act | 868 | (:+key "C-." #'embark-act |
@@ -864,6 +886,9 @@ See also `crux-reopen-as-root-mode'." | |||
864 | (:hook-into emacs-lisp-mode | 886 | (:hook-into emacs-lisp-mode |
865 | lisp-interaction-mode)) | 887 | lisp-interaction-mode)) |
866 | 888 | ||
889 | (setup (:straight eshell-bookmark) | ||
890 | (add-hook 'eshell-mode-hook #'eshell-bookmark-setup)) | ||
891 | |||
867 | (setup (:straight eshell-syntax-highlighting) | 892 | (setup (:straight eshell-syntax-highlighting) |
868 | (:hook-into eshell-mode)) | 893 | (:hook-into eshell-mode)) |
869 | 894 | ||
@@ -890,6 +915,14 @@ See also `crux-reopen-as-root-mode'." | |||
890 | :repo "duckwork/filldent.el")) | 915 | :repo "duckwork/filldent.el")) |
891 | (:+key "M-q" #'filldent-dwim)) | 916 | (:+key "M-q" #'filldent-dwim)) |
892 | 917 | ||
918 | (setup (:straight-when (forge | ||
919 | :host github :repo "magit/forge") | ||
920 | (eq system-type 'gnu/linux)) | ||
921 | (require 'forge) | ||
922 | (add-to-list 'forge-alist | ||
923 | '("tildegit.org" "tildegit.org/api/v1" "tildegit.org" | ||
924 | forge-gitea-repository))) | ||
925 | |||
893 | (setup (:straight (frowny | 926 | (setup (:straight (frowny |
894 | :host github | 927 | :host github |
895 | :repo "duckwork/frowny.el")) | 928 | :repo "duckwork/frowny.el")) |
@@ -1078,7 +1111,7 @@ See also `crux-reopen-as-root-mode'." | |||
1078 | 1111 | ||
1079 | (setup (:straight-when pdf-tools | 1112 | (setup (:straight-when pdf-tools |
1080 | (eq system-type 'gnu/linux)) | 1113 | (eq system-type 'gnu/linux)) |
1081 | (pdf-tools-install)) | 1114 | (pdf-tools-install t)) |
1082 | 1115 | ||
1083 | (setup (:straight (shell-command+ | 1116 | (setup (:straight (shell-command+ |
1084 | :host nil | 1117 | :host nil |
@@ -1161,7 +1194,18 @@ See also `crux-reopen-as-root-mode'." | |||
1161 | 0)))) | 1194 | 0)))) |
1162 | (funcall topsy-fn)))))) | 1195 | (funcall topsy-fn)))))) |
1163 | 1196 | ||
1164 | (setup (:straight transpose-frame)) | 1197 | (setup (:straight transpose-frame) |
1198 | (defvar +transpose-frame-map | ||
1199 | (let ((map (make-sparse-keymap))) | ||
1200 | (dolist (bind '(("t" . transpose-frame) | ||
1201 | ("v" . flip-frame) | ||
1202 | ("h" . flop-frame) | ||
1203 | ("r" . rotate-frame-clockwise) | ||
1204 | ("R" . rotate-frame-anticlockwise))) | ||
1205 | (define-key map (car bind) (cdr bind))) | ||
1206 | map) | ||
1207 | "Map for transposing frames.") | ||
1208 | (define-key +key-mode-map (kbd "C-x 5 t") +transpose-frame-map)) | ||
1165 | 1209 | ||
1166 | (setup (:straight trashed) | 1210 | (setup (:straight trashed) |
1167 | (:option trashed-action-confirmer #'y-or-n-p)) | 1211 | (:option trashed-action-confirmer #'y-or-n-p)) |
@@ -1209,7 +1253,8 @@ See also `crux-reopen-as-root-mode'." | |||
1209 | (:require vlf-setup)) | 1253 | (:require vlf-setup)) |
1210 | 1254 | ||
1211 | (setup (:straight whitespace-cleanup-mode) | 1255 | (setup (:straight whitespace-cleanup-mode) |
1212 | (:option whitespace-cleanup-mode-preserve-point t) | 1256 | (:option whitespace-cleanup-mode-preserve-point t |
1257 | whitespace-cleanup-mode-only-if-initially-clean nil) | ||
1213 | (global-whitespace-cleanup-mode +1)) | 1258 | (global-whitespace-cleanup-mode +1)) |
1214 | 1259 | ||
1215 | (setup (:straight zoom-frm)) | 1260 | (setup (:straight zoom-frm)) |