diff options
author | Case Duckworth | 2020-12-22 20:30:20 -0600 |
---|---|---|
committer | Case Duckworth | 2020-12-22 20:30:20 -0600 |
commit | 7826b68b02188a0d0676ebca4cb113add626367e (patch) | |
tree | fd4d7f4e6703fd336bb76300b338022b03612ae0 | |
parent | Correct set-face-from-alternatives function (diff) | |
download | emacs-7826b68b02188a0d0676ebca4cb113add626367e.tar.gz emacs-7826b68b02188a0d0676ebca4cb113add626367e.zip |
Convert some use-package forms to straight-use-package
-rw-r--r-- | config.org | 359 |
1 files changed, 208 insertions, 151 deletions
diff --git a/config.org b/config.org index 3d39f7a..8de2f37 100644 --- a/config.org +++ b/config.org | |||
@@ -114,19 +114,26 @@ when it errors. | |||
114 | ** Keep a tidy =~/.emacs= | 114 | ** Keep a tidy =~/.emacs= |
115 | 115 | ||
116 | #+begin_src emacs-lisp | 116 | #+begin_src emacs-lisp |
117 | (use-package no-littering | 117 | (straight-use-package 'no-littering) |
118 | :custom | 118 | |
119 | (backup-directory-alist | 119 | (cuss backup-directory-alist `((".*" . ,(no-littering-expand-var-file-name "backup/"))) |
120 | `((".*" . ,(no-littering-expand-var-file-name "backup/")))) | 120 | "Where to store backup files.") |
121 | (auto-save-file-name-transforms | 121 | |
122 | `((".*" ,(no-littering-expand-var-file-name "autosaves/") t))) | 122 | (cuss auto-save-file-name-transforms |
123 | (save-place-file | 123 | `((".*" ,(no-littering-expand-var-file-name "autosaves/") t)) |
124 | (no-littering-expand-var-file-name "places")) | 124 | "Where to store auto-save files.") |
125 | (undo-fu-session-directory | 125 | |
126 | (no-littering-expand-var-file-name "undos/")) | 126 | (cuss save-place-file (no-littering-expand-var-file-name "places") |
127 | (elpher-certificate-directory | 127 | "Where to store place files.") |
128 | (no-littering-expand-var-file-name "elpher-certificates/"))) | 128 | |
129 | (cuss undo-fu-session-directory (no-littering-expand-var-file-name "undos/") | ||
130 | "Where to store undo information.") | ||
131 | |||
132 | (cuss elpher-certificate-directory | ||
133 | (no-littering-expand-var-file-name "elpher-certificates/") | ||
134 | "Where to store elpher client certificates.") | ||
129 | 135 | ||
136 | ;; Make all directories defined above | ||
130 | (dolist (dir '("backup" | 137 | (dolist (dir '("backup" |
131 | "autosaves" | 138 | "autosaves" |
132 | "undos" | 139 | "undos" |
@@ -368,40 +375,40 @@ from [[https://github.com/link0ff/emacs-init][link0ff]]. | |||
368 | ** Theme | 375 | ** Theme |
369 | 376 | ||
370 | #+begin_src emacs-lisp | 377 | #+begin_src emacs-lisp |
371 | (use-package modus-themes | 378 | (straight-use-package '(modus-themes |
372 | :straight (modus-themes | 379 | :host gitlab |
373 | :host gitlab | 380 | :repo "protesilaos/modus-themes" |
374 | :repo "protesilaos/modus-themes" | 381 | :branch "main")) |
375 | :branch "main") | 382 | |
376 | :custom | 383 | (cuss modus-themes-slanted-constructs t) |
377 | (modus-themes-slanted-constructs t) | 384 | (cuss modus-themes-bold-constructs t) |
378 | (modus-themes-bold-constructs t) | 385 | (cuss modus-themes-fringes nil) |
379 | (modus-themes-fringes nil) | 386 | (cuss modus-themes-mode-line '3d) |
380 | (modus-themes-mode-line '3d) | 387 | (cuss modus-themes-syntax 'yellow-comments) |
381 | (modus-themes-syntax 'yellow-comments) | 388 | (cuss modus-themes-intense-hl-line nil) |
382 | (modus-themes-intense-hl-line nil) | 389 | (cuss modus-themes-paren-match 'intense-bold) |
383 | (modus-themes-paren-match 'intense-bold) | 390 | (cuss modus-themes-links nil) |
384 | (modus-themes-links nil) | 391 | (cuss modus-themes-no-mixed-fonts nil) |
385 | (modus-themes-no-mixed-fonts nil) | 392 | (cuss modus-themes-prompts nil) |
386 | (modus-themes-prompts nil) | 393 | (cuss modus-themes-completions nil) |
387 | (modus-themes-completions nil) | 394 | (cuss modus-themes-diffs nil) |
388 | (modus-themes-diffs nil) | 395 | (cuss modus-themes-org-blocks 'grayscale) |
389 | (modus-themes-org-blocks 'grayscale) | 396 | (cuss modus-themes-headings |
390 | (modus-themes-headings | 397 | '((1 . line) |
391 | '((1 . line) | 398 | (t . t))) |
392 | (t . t))) | 399 | (cuss modus-themes-variable-pitch-headings t) |
393 | (modus-themes-variable-pitch-headings t) | 400 | (cuss modus-themes-scale-headings t) |
394 | (modus-themes-scale-headings t) | 401 | (cuss modus-themes-scale-1 1.1) |
395 | (modus-themes-scale-1 1.1) | 402 | (cuss modus-themes-scale-2 1.15) |
396 | (modus-themes-scale-2 1.15) | 403 | (cuss modus-themes-scale-3 1.21) |
397 | (modus-themes-scale-3 1.21) | 404 | (cuss modus-themes-scale-4 1.27) |
398 | (modus-themes-scale-4 1.27) | 405 | (cuss modus-themes-scale-5 1.33) |
399 | (modus-themes-scale-5 1.33) | 406 | |
400 | :custom-face | 407 | ;; :custom-face |
401 | (font-lock-comment-face | 408 | (custom-set-faces `(font-lock-comment-face |
402 | ((t (:inherit (custom-comment italic variable-pitch))))) | 409 | ((t (:inherit (custom-comment italic variable-pitch)))))) |
403 | :init | 410 | |
404 | (load-theme 'modus-operandi t)) | 411 | (load-theme 'modus-operandi t) |
405 | #+end_src | 412 | #+end_src |
406 | 413 | ||
407 | *** Change theme based on time of day | 414 | *** Change theme based on time of day |
@@ -410,20 +417,38 @@ from [[https://github.com/link0ff/emacs-init][link0ff]]. | |||
410 | (cuss calendar-latitude 30.4515) | 417 | (cuss calendar-latitude 30.4515) |
411 | (cuss calendar-longitude -91.1871) | 418 | (cuss calendar-longitude -91.1871) |
412 | 419 | ||
413 | (use-package circadian | 420 | (straight-use-package 'circadian) |
414 | :custom | 421 | |
415 | (circadian-themes '((:sunrise . modus-operandi) | 422 | (cuss circadian-themes '((:sunrise . modus-operandi) |
416 | (:sunset . modus-vivendi))) | 423 | (:sunset . modus-vivendi))) |
417 | :config | 424 | |
418 | (circadian-setup)) | 425 | (circadian-setup) |
419 | #+end_src | 426 | #+end_src |
420 | 427 | ||
421 | *** Modeline | 428 | *** Modeline |
422 | 429 | ||
423 | #+begin_src emacs-lisp | 430 | #+begin_src emacs-lisp |
424 | (use-package mood-line | 431 | (straight-use-package 'smart-mode-line) |
425 | :config | 432 | (cuss sml/no-confirm-load-theme t) |
426 | (mood-line-mode +1)) | 433 | (sml/setup) |
434 | #+end_src | ||
435 | |||
436 | **** Rich minority | ||
437 | |||
438 | Since this /comes/ with smart mode line, I’m just going to use it, instead of =diminish= or another package. I do have to write this helper function, though, to add things to the whitelist. | ||
439 | |||
440 | #+begin_src emacs-lisp | ||
441 | (defun rm/whitelist-add (regexp) | ||
442 | "Add a REGEXP to the whitelist for `rich-minority'." | ||
443 | (if (listp 'rm--whitelist-regexps) | ||
444 | (add-to-list 'rm--whitelist-regexps regexp) | ||
445 | (setq rm--whitelist-regexps `(,regexp))) | ||
446 | (setq rm-whitelist | ||
447 | (mapconcat 'identity rm--whitelist-regexps "\\|"))) | ||
448 | |||
449 | (straight-use-package 'rich-minority) | ||
450 | |||
451 | (rm/whitelist-add "^$") | ||
427 | #+end_src | 452 | #+end_src |
428 | 453 | ||
429 | *** Fonts | 454 | *** Fonts |
@@ -494,8 +519,8 @@ from [[https://github.com/link0ff/emacs-init][link0ff]]. | |||
494 | **** Unicode fonts | 519 | **** Unicode fonts |
495 | 520 | ||
496 | #+begin_src emacs-lisp | 521 | #+begin_src emacs-lisp |
497 | (use-package unicode-fonts | 522 | (straight-use-package 'unicode-fonts) |
498 | :config | 523 | (with-eval-after-load 'unicode-fonts |
499 | (unicode-fonts-setup)) | 524 | (unicode-fonts-setup)) |
500 | #+end_src | 525 | #+end_src |
501 | 526 | ||
@@ -504,8 +529,7 @@ from [[https://github.com/link0ff/emacs-init][link0ff]]. | |||
504 | ** Async | 529 | ** Async |
505 | 530 | ||
506 | #+begin_src emacs-lisp | 531 | #+begin_src emacs-lisp |
507 | (use-package async) | 532 | (straight-use-package 'async) |
508 | |||
509 | (autoload 'dired-async-mode "dired-async.el" nil t) | 533 | (autoload 'dired-async-mode "dired-async.el" nil t) |
510 | (dired-async-mode +1) | 534 | (dired-async-mode +1) |
511 | 535 | ||
@@ -526,22 +550,30 @@ from [[https://github.com/link0ff/emacs-init][link0ff]]. | |||
526 | *** Selectrum | 550 | *** Selectrum |
527 | 551 | ||
528 | #+begin_src emacs-lisp | 552 | #+begin_src emacs-lisp |
529 | (use-package selectrum | 553 | (straight-use-package 'selectrum) |
530 | :config | 554 | (require 'selectrum) |
531 | (selectrum-mode +1)) | 555 | (selectrum-mode +1) |
532 | #+end_src | 556 | #+end_src |
533 | 557 | ||
534 | *** Prescient | 558 | *** Prescient |
535 | 559 | ||
536 | #+begin_src emacs-lisp | 560 | #+begin_src emacs-lisp |
537 | (use-package prescient | 561 | (straight-use-package 'prescient) |
538 | :config | 562 | (require 'prescient) |
539 | (prescient-persist-mode +1)) | 563 | |
540 | 564 | (prescient-persist-mode +1) | |
541 | (use-package selectrum-prescient | 565 | |
542 | :after (selectrum prescient) | 566 | (straight-use-package 'selectrum-prescient) |
543 | :config | 567 | |
544 | (selectrum-prescient-mode +1)) | 568 | (with-eval-after-load 'prescient |
569 | (with-eval-after-load 'selectrum | ||
570 | (selectrum-prescient-mode +1))) | ||
571 | |||
572 | (straight-use-package 'company-prescient) | ||
573 | |||
574 | (with-eval-after-load 'prescient | ||
575 | (with-eval-after-load 'company | ||
576 | (company-prescient-mode +1))) | ||
545 | #+end_src | 577 | #+end_src |
546 | 578 | ||
547 | *** Consult | 579 | *** Consult |
@@ -572,19 +604,19 @@ from [[https://github.com/link0ff/emacs-init][link0ff]]. | |||
572 | *** Marginalia | 604 | *** Marginalia |
573 | 605 | ||
574 | #+begin_src emacs-lisp | 606 | #+begin_src emacs-lisp |
575 | (use-package marginalia | 607 | (straight-use-package '(marginalia |
576 | :straight (marginalia | 608 | :host github |
577 | :host github | 609 | :repo "minad/marginalia" |
578 | :repo "minad/marginalia" | 610 | :branch "main")) |
579 | :branch "main") | 611 | |
580 | :init | 612 | (cuss marginalia-annotators |
581 | (marginalia-mode +1) | 613 | (if (eq system-type 'windows-nt) |
582 | (cuss marginalia-annotators | 614 | '(marginalia-annotators-light |
583 | (if (eq system-type 'windows-nt) | 615 | marginalia-annotators-heavy) |
584 | '(marginalia-annotators-light | 616 | '(marginalia-annotators-heavy |
585 | marginalia-annotators-heavy) | 617 | marginalia-annotators-light))) |
586 | '(marginalia-annotators-heavy | 618 | |
587 | marginalia-annotators-light)))) | 619 | (marginalia-mode +1) |
588 | #+end_src | 620 | #+end_src |
589 | 621 | ||
590 | ** Ignore case | 622 | ** Ignore case |
@@ -735,13 +767,13 @@ Also from link0ff. See the above for a link. | |||
735 | ("C-/" . undo-fu-only-undo) | 767 | ("C-/" . undo-fu-only-undo) |
736 | ("C-?" . undo-fu-only-redo)) | 768 | ("C-?" . undo-fu-only-redo)) |
737 | 769 | ||
738 | (use-package undo-fu-session | 770 | (straight-use-package 'undo-fu-session) |
739 | :custom | 771 | |
740 | (undo-fu-session-incompatible-files | 772 | (cuss undo-fu-session-incompatible-files |
741 | '("/COMMIT_EDITMSG\\'" | 773 | '("/COMMIT_EDITMSG\\'" |
742 | "/git-rebase-todo\\'")) | 774 | "/git-rebase-todo\\'")) |
743 | :config | 775 | |
744 | (global-undo-fu-session-mode +1)) | 776 | (global-undo-fu-session-mode +1) |
745 | #+end_src | 777 | #+end_src |
746 | 778 | ||
747 | * Editing | 779 | * Editing |
@@ -807,11 +839,11 @@ Also from link0ff. See the above for a link. | |||
807 | ** Highlight modified regions | 839 | ** Highlight modified regions |
808 | 840 | ||
809 | #+begin_src emacs-lisp | 841 | #+begin_src emacs-lisp |
810 | (use-package goggles | 842 | (straight-use-package 'goggles) |
811 | :custom | 843 | |
812 | (goggles-pulse nil) | 844 | (cuss goggles-pulse nil) |
813 | :config | 845 | |
814 | (goggles-mode +1)) | 846 | (goggles-mode +1) |
815 | #+end_src | 847 | #+end_src |
816 | 848 | ||
817 | * Files | 849 | * Files |
@@ -903,16 +935,16 @@ Also from link0ff. See the above for a link. | |||
903 | *** Smart parentheses | 935 | *** Smart parentheses |
904 | 936 | ||
905 | #+begin_src emacs-lisp | 937 | #+begin_src emacs-lisp |
906 | (use-package smartparens | 938 | (straight-use-package 'smartparens) |
907 | :init | 939 | (require 'smartparens-config) |
908 | (require 'smartparens-config) | 940 | |
909 | :config | 941 | (show-smartparens-global-mode +1) |
910 | (show-smartparens-global-mode +1) | 942 | (add-to-list 'sp-ignore-modes-list 'org-mode) |
911 | :hook | 943 | |
912 | (prog-mode-hook . smartparens-strict-mode)) | 944 | (add-hook 'prog-mode-hook #'smartparens-strict-mode) |
913 | #+end_src | 945 | #+end_src |
914 | 946 | ||
915 | ** Line numbers | 947 | ** COMMENT Line numbers |
916 | 948 | ||
917 | #+begin_src emacs-lisp | 949 | #+begin_src emacs-lisp |
918 | (defun acdw/enable-line-numbers () | 950 | (defun acdw/enable-line-numbers () |
@@ -932,9 +964,9 @@ Also from link0ff. See the above for a link. | |||
932 | ** Indenting | 964 | ** Indenting |
933 | 965 | ||
934 | #+begin_src emacs-lisp | 966 | #+begin_src emacs-lisp |
935 | (use-package aggressive-indent | 967 | (straight-use-package 'aggressive-indent) |
936 | :config | 968 | |
937 | (global-aggressive-indent-mode +1)) | 969 | (global-aggressive-indent-mode +1) |
938 | #+end_src | 970 | #+end_src |
939 | 971 | ||
940 | ** Completion | 972 | ** Completion |
@@ -1005,25 +1037,53 @@ Also from link0ff. See the above for a link. | |||
1005 | ** Visual Fill Column | 1037 | ** Visual Fill Column |
1006 | 1038 | ||
1007 | #+begin_src emacs-lisp | 1039 | #+begin_src emacs-lisp |
1008 | (use-package visual-fill-column | 1040 | (straight-use-package 'visual-fill-column) |
1009 | :custom | 1041 | |
1010 | (split-window-preferred-function | 1042 | (cuss split-window-preferred-function |
1011 | 'visual-fill-column-split-window-sensibly) | 1043 | 'visual-fill-column-split-window-sensibly) |
1012 | (visual-fill-column-center-text t) | 1044 | (cuss visual-fill-column-center-text t) |
1013 | (fill-column 80) | 1045 | (cuss fill-column 80) |
1014 | :config | 1046 | |
1015 | (advice-add 'text-scale-adjust | 1047 | (advice-add 'text-scale-adjust |
1016 | :after #'visual-fill-column-adjust) | 1048 | :after #'visual-fill-column-adjust) |
1017 | :hook | 1049 | |
1018 | (text-mode-hook . visual-fill-column-mode)) | 1050 | (add-hook 'text-mode-hook #'visual-fill-column-mode) |
1051 | #+end_src | ||
1052 | |||
1053 | *** COMMENT Split windows /more/ sensibly | ||
1054 | |||
1055 | from [[https://stackoverflow.com/questions/23659909/reverse-evaluation-order-of-split-height-threshold-and-split-width-threshold-in][Stack Overflow]]. | ||
1056 | |||
1057 | #+begin_src emacs-lisp | ||
1058 | (defun my-split-window-sensibly (&optional window) | ||
1059 | (let ((window (or window (selected-window)))) | ||
1060 | (or (and (window-splittable-p window t) | ||
1061 | ;; Split window horizontally. | ||
1062 | (with-selected-window window | ||
1063 | (split-window-right))) | ||
1064 | (and (window-splittable-p window) | ||
1065 | ;; Split window vertically. | ||
1066 | (with-selected-window window | ||
1067 | (split-window-below))) | ||
1068 | (and (eq window (frame-root-window (window-frame window))) | ||
1069 | (not (window-minibuffer-p window)) | ||
1070 | ;; If WINDOW is the only window on its frame and is not the | ||
1071 | ;; minibuffer window, try to split it horizontally disregarding | ||
1072 | ;; the value of `split-width-threshold'. | ||
1073 | (let ((split-width-threshold 0)) | ||
1074 | (when (window-splittable-p window t) | ||
1075 | (with-selected-window window | ||
1076 | (split-window-right)))))))) | ||
1077 | |||
1078 | (setq split-window-preferred-function #'my-split-window-sensibly) | ||
1019 | #+end_src | 1079 | #+end_src |
1020 | 1080 | ||
1021 | ** Type nice-looking quote-type marks | 1081 | ** Type nice-looking quote-type marks |
1022 | 1082 | ||
1023 | #+begin_src emacs-lisp | 1083 | #+begin_src emacs-lisp |
1024 | (use-package typo | 1084 | (straight-use-package 'typo) |
1025 | :hook | 1085 | |
1026 | (text-mode-hook . typo-mode)) | 1086 | (add-hook 'text-mode-hook #'typo-mode) |
1027 | #+end_src | 1087 | #+end_src |
1028 | 1088 | ||
1029 | ** Insert /kaomoji/ | 1089 | ** Insert /kaomoji/ |
@@ -1049,31 +1109,25 @@ Also from link0ff. See the above for a link. | |||
1049 | I’ve put org mode under Applications, as opposed to Writing, because it’s more generally-applicable than that. | 1109 | I’ve put org mode under Applications, as opposed to Writing, because it’s more generally-applicable than that. |
1050 | 1110 | ||
1051 | #+begin_src emacs-lisp | 1111 | #+begin_src emacs-lisp |
1052 | (use-package org | 1112 | (straight-use-package 'org) |
1053 | :mode ("\\.org\\'" . org-mode) | ||
1054 | |||
1055 | :bind (:map org-mode-map | ||
1056 | ("M-n" . outline-next-visible-heading) | ||
1057 | ("M-p" . outline-previous-visible-heading)) | ||
1058 | |||
1059 | :custom | ||
1060 | (org-hide-emphasis-markers t) | ||
1061 | (org-fontify-done-headline t) | ||
1062 | (org-fontify-whole-heading-line t) | ||
1063 | (org-fontify-quote-and-verse-blocks t) | ||
1064 | (org-pretty-entities t) | ||
1065 | (org-num-mode +1) | ||
1066 | |||
1067 | (cuss org-directory "~/Org") | ||
1068 | 1113 | ||
1069 | (org-src-tab-acts-natively t) | 1114 | (with-eval-after-load 'org |
1070 | (org-src-fontify-natively t) | ||
1071 | (org-src-window-setup 'current-window) | ||
1072 | (org-confirm-babel-evaluate nil) | ||
1073 | |||
1074 | :config | ||
1075 | (require 'org-tempo) | 1115 | (require 'org-tempo) |
1076 | (require 'ox-md)) | 1116 | (require 'ox-md) |
1117 | (bind-key "M-n" #'outline-next-visible-heading 'org-mode-map) | ||
1118 | (bind-key "M-p" #'outline-previous-visible-heading 'org-mode-map)) | ||
1119 | |||
1120 | (cuss org-hide-emphasis-markers t) | ||
1121 | (cuss org-fontify-done-headline t) | ||
1122 | (cuss org-fontify-whole-heading-line t) | ||
1123 | (cuss org-fontify-quote-and-verse-blocks t) | ||
1124 | (cuss org-pretty-entities t) | ||
1125 | (cuss org-num-mode +1) | ||
1126 | (cuss org-src-tab-acts-natively t) | ||
1127 | (cuss org-src-fontify-natively t) | ||
1128 | (cuss org-src-window-setup 'current-window) | ||
1129 | (cuss org-confirm-babel-evaluate nil) | ||
1130 | (cuss org-directory "~/Org") | ||
1077 | #+end_src | 1131 | #+end_src |
1078 | 1132 | ||
1079 | *** Org Agenda | 1133 | *** Org Agenda |
@@ -1310,9 +1364,9 @@ from [[https://github.com/alphapapa/unpackaged.el#ensure-blank-lines-between-hea | |||
1310 | ** Pastebin | 1364 | ** Pastebin |
1311 | 1365 | ||
1312 | #+begin_src emacs-lisp | 1366 | #+begin_src emacs-lisp |
1313 | (use-package 0x0 | 1367 | (straight-use-package '0x0) |
1314 | :custom | 1368 | |
1315 | (0x0-default-service 'ttm)) | 1369 | (cuss 0x0-default-service 'ttm) |
1316 | #+end_src | 1370 | #+end_src |
1317 | 1371 | ||
1318 | ** RSS | 1372 | ** RSS |
@@ -1387,13 +1441,16 @@ from [[https://karthinks.com/software/more-batteries-included-with-emacs/#regexp | |||
1387 | 1441 | ||
1388 | #+begin_src emacs-lisp | 1442 | #+begin_src emacs-lisp |
1389 | (when (executable-find "bash") | 1443 | (when (executable-find "bash") |
1390 | (use-package bash-completion)) | 1444 | (straight-use-package 'bash-completion)) |
1391 | 1445 | ||
1392 | (when (executable-find "fish") | 1446 | (when (executable-find "fish") |
1393 | (use-package fish-completion | 1447 | (straight-use-package 'fish-completion) |
1394 | :config | 1448 | (require 'fish-completion) |
1395 | (cuss fish-completion-fallback-on-bash-p (executable-find "bash")) | 1449 | (cuss fish-completion-fallback-on-bash-p (executable-find "bash")) |
1396 | (global-fish-completion-mode +1))) | 1450 | (global-fish-completion-mode +1) |
1451 | |||
1452 | (straight-use-package 'fish-mode) | ||
1453 | (add-to-list 'auto-mode-alist '("\\.fish\\'" . fish-mode))) | ||
1397 | #+end_src | 1454 | #+end_src |
1398 | 1455 | ||
1399 | * Appendices | 1456 | * Appendices |