diff options
-rw-r--r-- | README.md | 87 |
1 files changed, 72 insertions, 15 deletions
diff --git a/README.md b/README.md index 302d5dc..b839b12 100644 --- a/README.md +++ b/README.md | |||
@@ -787,6 +787,37 @@ UNIX line endings, so I don't want to hear it. | |||
787 | (cuss require-final-newline t) | 787 | (cuss require-final-newline t) |
788 | 788 | ||
789 | 789 | ||
790 | ### Edit files with `sudo` | ||
791 | |||
792 | (straight-use-package 'sudo-edit) | ||
793 | |||
794 | (with-eval-after-load 'sudo-edit | ||
795 | (global-set-key acdw/map (kbd "C-r") #'sudo-edit)) | ||
796 | |||
797 | |||
798 | #### Don’t add `/sudo:` files to `recentf`, though | ||
799 | |||
800 | I’ve pretty much cribbed this from [recentf-remove-sudo-tramp-prefix](https://github.com/ncaq/recentf-remove-sudo-tramp-prefix/) – it’s a small enough package that I can just include it completely here. | ||
801 | |||
802 | (defun recentf-remove-sudo-tramp-prefix (path) | ||
803 | "Remove sudo from PATH." | ||
804 | (require 'tramp) | ||
805 | (if (tramp-tramp-file-p path) | ||
806 | (let ((tx (tramp-dissect-file-name path))) | ||
807 | (if (string-equal "sudo" (tramp-file-name-method tx)) | ||
808 | (tramp-file-name-localname tx) | ||
809 | path)) | ||
810 | path)) | ||
811 | |||
812 | (defun recentf-remove-sudo-tramp-prefix-from-recentf-list () | ||
813 | (require 'recentf) | ||
814 | (setq recentf-list | ||
815 | (mapcar #'recentf-remove-sudo-tramp-prefix recentf-list))) | ||
816 | |||
817 | (advice-add 'recentf-cleanup | ||
818 | :before #'recentf-remove-sudo-tramp-prefix-from-recentf-list) | ||
819 | |||
820 | |||
790 | ## Text editing | 821 | ## Text editing |
791 | 822 | ||
792 | 823 | ||
@@ -956,6 +987,14 @@ UNIX line endings, so I don't want to hear it. | |||
956 | "Don't truncate printed expressions by level.") | 987 | "Don't truncate printed expressions by level.") |
957 | 988 | ||
958 | 989 | ||
990 | ### INI | ||
991 | |||
992 | (straight-use-package 'ini-mode) | ||
993 | |||
994 | (add-to-list 'auto-mode-alist | ||
995 | '("\\.ini\\'" . ini-mode)) | ||
996 | |||
997 | |||
959 | # Writing | 998 | # Writing |
960 | 999 | ||
961 | 1000 | ||
@@ -1426,9 +1465,6 @@ I’m only enabling this at home for now, since it requires building stuff. | |||
1426 | (cuss mu4e-compose-signature | 1465 | (cuss mu4e-compose-signature |
1427 | "Best,\nCase\n") | 1466 | "Best,\nCase\n") |
1428 | 1467 | ||
1429 | ;; (cuss mu4e-get-mail-command "mbsync -a") | ||
1430 | ;; (cuss mu4e-update-interval 300) | ||
1431 | |||
1432 | (cuss mu4e-completing-read-function 'completing-read) | 1468 | (cuss mu4e-completing-read-function 'completing-read) |
1433 | (cuss message-kill-buffer-on-exit t) | 1469 | (cuss message-kill-buffer-on-exit t) |
1434 | (cuss mu4e-confirm-quit nil) | 1470 | (cuss mu4e-confirm-quit nil) |
@@ -1451,7 +1487,7 @@ I’m only enabling this at home for now, since it requires building stuff. | |||
1451 | (:flags . 6) | 1487 | (:flags . 6) |
1452 | (:mailing-list . 10) | 1488 | (:mailing-list . 10) |
1453 | (:from-or-to . 22) | 1489 | (:from-or-to . 22) |
1454 | (:subject))) | 1490 | (:thread-subject))) |
1455 | 1491 | ||
1456 | (cuss mu4e-maildir-shortcuts | 1492 | (cuss mu4e-maildir-shortcuts |
1457 | `(("/INBOX" . ?i) | 1493 | `(("/INBOX" . ?i) |
@@ -1460,10 +1496,22 @@ I’m only enabling this at home for now, since it requires building stuff. | |||
1460 | (,mu4e-drafts-folder . ?d) | 1496 | (,mu4e-drafts-folder . ?d) |
1461 | (,mu4e-trash-folder . ?t))) | 1497 | (,mu4e-trash-folder . ?t))) |
1462 | 1498 | ||
1499 | (defun acdw/setup-mu4e-headers-mode () | ||
1500 | (visual-line-mode -1)) | ||
1501 | |||
1502 | (add-hook 'mu4e-headers-mode #'acdw/setup-mu4e-headers-mode) | ||
1503 | |||
1463 | (defun acdw/setup-mu4e-view-mode () | 1504 | (defun acdw/setup-mu4e-view-mode () |
1464 | (visual-fill-column-mode +1)) | 1505 | (visual-fill-column-mode +1)) |
1465 | 1506 | ||
1466 | (add-hook 'mu4e-view-mode-hook #'acdw/setup-mu4e-view-mode)) | 1507 | (add-hook 'mu4e-view-mode-hook #'acdw/setup-mu4e-view-mode) |
1508 | |||
1509 | (cuss mu4e-get-mail-command (cond ((executable-find "mbsync") | ||
1510 | "mbsync -a")) | ||
1511 | "The command to update mail with.") | ||
1512 | (cuss mu4e-update-interval 300 | ||
1513 | "Update automatically every 5 minutes.") | ||
1514 | (mu4e +1)) | ||
1467 | 1515 | ||
1468 | 1516 | ||
1469 | ### Add a keybinding | 1517 | ### Add a keybinding |
@@ -1481,6 +1529,17 @@ I’m only enabling this at home for now, since it requires building stuff. | |||
1481 | ## Smolweb | 1529 | ## Smolweb |
1482 | 1530 | ||
1483 | 1531 | ||
1532 | ### A common function to make a cohesive smolweb experience | ||
1533 | |||
1534 | (defun acdw/setup-smolweb () | ||
1535 | "Configure emacs to view the smolweb." | ||
1536 | (setq visual-fill-column-center-text t) | ||
1537 | (visual-fill-column-mode +1) | ||
1538 | (visual-line-mode +1) | ||
1539 | (variable-pitch-mode -1) | ||
1540 | (text-scale-increase +1)) | ||
1541 | |||
1542 | |||
1484 | ### Elpher | 1543 | ### Elpher |
1485 | 1544 | ||
1486 | (straight-use-package '(elpher | 1545 | (straight-use-package '(elpher |
@@ -1493,11 +1552,11 @@ I’m only enabling this at home for now, since it requires building stuff. | |||
1493 | (cuss elpher-ipv4-always t) | 1552 | (cuss elpher-ipv4-always t) |
1494 | 1553 | ||
1495 | (cussface '(elpher-gemini-heading1 | 1554 | (cussface '(elpher-gemini-heading1 |
1496 | ((t (:inherit (modus-theme-heading-1)))))) | 1555 | ((t (:inherit (modus-theme-heading-1 variable-pitch)))))) |
1497 | (cussface '(elpher-gemini-heading2 | 1556 | (cussface '(elpher-gemini-heading2 |
1498 | ((t (:inherit (modus-theme-heading-2)))))) | 1557 | ((t (:inherit (modus-theme-heading-2 variable-pitch)))))) |
1499 | (cussface '(elpher-gemini-heading3 | 1558 | (cussface '(elpher-gemini-heading3 |
1500 | ((t (:inherit (modus-theme-heading-3)))))) | 1559 | ((t (:inherit (modus-theme-heading-3 variable-pitch)))))) |
1501 | 1560 | ||
1502 | (defun elpher:eww-browse-url (original url &optional new-window) | 1561 | (defun elpher:eww-browse-url (original url &optional new-window) |
1503 | "Handle gemini/gopher links with eww." | 1562 | "Handle gemini/gopher links with eww." |
@@ -1513,9 +1572,10 @@ I’m only enabling this at home for now, since it requires building stuff. | |||
1513 | (define-key elpher-mode-map "o" #'elpher-follow-current-link) | 1572 | (define-key elpher-mode-map "o" #'elpher-follow-current-link) |
1514 | (define-key elpher-mode-map "G" #'elpher-go-current)) | 1573 | (define-key elpher-mode-map "G" #'elpher-go-current)) |
1515 | 1574 | ||
1516 | (add-hook 'elpher-mode-hook #'visual-fill-column-mode) | 1575 | (add-hook 'elpher-mode-hook #'acdw/setup-smolweb) |
1517 | 1576 | ||
1518 | (bind-key acdw/map "e" #'elpher) | 1577 | (autoload 'elpher-bookmarks "elpher") |
1578 | (define-key acdw/map "e" #'elpher-bookmarks) | ||
1519 | 1579 | ||
1520 | 1580 | ||
1521 | ### Gemini-mode | 1581 | ### Gemini-mode |
@@ -1533,17 +1593,14 @@ I’m only enabling this at home for now, since it requires building stuff. | |||
1533 | (cussface '(gemini-heading-face3 | 1593 | (cussface '(gemini-heading-face3 |
1534 | ((t (:inherit (elpher-gemini-heading3)))))) | 1594 | ((t (:inherit (elpher-gemini-heading3)))))) |
1535 | 1595 | ||
1536 | (defun acdw/setup-gemini-mode () | 1596 | (add-hook 'gemini-mode-hook #'acdw/setup-smolweb) |
1537 | (visual-fill-column-mode +1) | ||
1538 | (variable-pitch-mode -1)) | ||
1539 | |||
1540 | (add-hook 'gemini-mode-hook #'acdw/setup-gemini-mode) | ||
1541 | 1597 | ||
1542 | 1598 | ||
1543 | ### Gemini-write | 1599 | ### Gemini-write |
1544 | 1600 | ||
1545 | (straight-use-package '(gemini-write | 1601 | (straight-use-package '(gemini-write |
1546 | :repo "https://alexschroeder.ch/cgit/gemini-write")) | 1602 | :repo "https://alexschroeder.ch/cgit/gemini-write")) |
1603 | (require 'gemini-write) | ||
1547 | 1604 | ||
1548 | ;; TODO : add tokens ... somehow | 1605 | ;; TODO : add tokens ... somehow |
1549 | 1606 | ||