diff options
author | Case Duckworth | 2021-02-10 20:03:07 -0600 |
---|---|---|
committer | Case Duckworth | 2021-02-10 20:03:07 -0600 |
commit | a1c181c8ed06f8f622ae044c5314af411a47598d (patch) | |
tree | 5ced423c0950f0d68044f51b01b486f8a6449a06 | |
parent | Add feed (diff) | |
parent | Add `display-fill-column-indicator-mode' to `acdw/reading-mode' (diff) | |
download | emacs-a1c181c8ed06f8f622ae044c5314af411a47598d.tar.gz emacs-a1c181c8ed06f8f622ae044c5314af411a47598d.zip |
Merge branch 'main' of tildegit.org:acdw/emacs
-rw-r--r-- | config.org | 122 | ||||
-rw-r--r-- | init.el | 2 |
2 files changed, 94 insertions, 30 deletions
diff --git a/config.org b/config.org index 1a17b8f..7c51838 100644 --- a/config.org +++ b/config.org | |||
@@ -531,8 +531,8 @@ I want the git version. | |||
531 | modus-themes-bold-constructs t | 531 | modus-themes-bold-constructs t |
532 | modus-themes-region 'bg-only | 532 | modus-themes-region 'bg-only |
533 | modus-themes-org-blocks 'grayscale | 533 | modus-themes-org-blocks 'grayscale |
534 | modus-themes-headings '((1 . line) | 534 | modus-themes-headings '((1 . section) |
535 | (t . t)) | 535 | (t . no-color)) |
536 | modus-themes-scale-headings nil | 536 | modus-themes-scale-headings nil |
537 | modus-themes-mode-line 'borderless-3d) | 537 | modus-themes-mode-line 'borderless-3d) |
538 | #+end_src | 538 | #+end_src |
@@ -1266,6 +1266,12 @@ contents of the files the represent on-disk. Thus, we have | |||
1266 | (setq-default fill-column 80) | 1266 | (setq-default fill-column 80) |
1267 | #+end_src | 1267 | #+end_src |
1268 | 1268 | ||
1269 | I also want to display the fill-column: | ||
1270 | |||
1271 | #+begin_src emacs-lisp :noweb-ref modes | ||
1272 | (global-display-fill-column-indicator-mode +1) | ||
1273 | #+end_src | ||
1274 | |||
1269 | By default, Emacs uses =C-x f= to set the =fill-column=. I think it's | 1275 | By default, Emacs uses =C-x f= to set the =fill-column=. I think it's |
1270 | pretty dumb that such an easy-to-reach binding (for Emacs) is set to a function | 1276 | pretty dumb that such an easy-to-reach binding (for Emacs) is set to a function |
1271 | that I /literally/ never use. So I'm going to bind it to =find-file= ... since | 1277 | that I /literally/ never use. So I'm going to bind it to =find-file= ... since |
@@ -1570,14 +1576,13 @@ don't know if it's that useful. | |||
1570 | (add-hook 'text-mode-hook #'hook--wc-mode-no-keybinds) | 1576 | (add-hook 'text-mode-hook #'hook--wc-mode-no-keybinds) |
1571 | #+end_src | 1577 | #+end_src |
1572 | 1578 | ||
1573 | *** Keybinding :crux: | 1579 | *** Keybinding |
1574 | 1580 | ||
1575 | I just found out that =M-== counts the words in a region. That's great, but I | 1581 | I just found out that =M-== counts the words in a region. That's great, but I |
1576 | often want to count the words in the whole buffer. Enter | 1582 | often want to count the words in the whole buffer. |
1577 | =crux-with-region-or-buffer=. I could change the binding. .... but I don't want to. | ||
1578 | 1583 | ||
1579 | #+begin_src emacs-lisp :noweb-ref bindings | 1584 | #+begin_src emacs-lisp :noweb-ref bindings |
1580 | (crux-with-region-or-buffer count-words-region) | 1585 | (define-key acdw/map (kbd "M-=") #'count-words) |
1581 | #+end_src | 1586 | #+end_src |
1582 | 1587 | ||
1583 | ** Spell checking | 1588 | ** Spell checking |
@@ -1635,10 +1640,27 @@ Display corrections with =completing-read=. | |||
1635 | #'(lambda () (blackout 'iscroll-mode))) | 1640 | #'(lambda () (blackout 'iscroll-mode))) |
1636 | #+end_src | 1641 | #+end_src |
1637 | 1642 | ||
1638 | ** TODO Reading mode | 1643 | ** Reading mode |
1639 | 1644 | ||
1640 | A custom mode to make reading comfy | 1645 | A custom mode to make reading comfy |
1641 | 1646 | ||
1647 | #+begin_src emacs-lisp :noweb-ref modes | ||
1648 | (define-minor-mode acdw/reading-mode | ||
1649 | "Make reading comfier." | ||
1650 | :lighter " Read" ; later: book emoji | ||
1651 | (if acdw/reading-mode | ||
1652 | (progn ;; turn on | ||
1653 | (text-scale-increase +1) | ||
1654 | (visual-fill-column-mode +1) | ||
1655 | (iscroll-mode +1) | ||
1656 | (display-fill-column-indicator-mode -1)) | ||
1657 | (progn ;; turn off | ||
1658 | (text-scale-increase 0) | ||
1659 | (visual-fill-column-mode -1) | ||
1660 | (iscroll-mode -1) | ||
1661 | (display-fill-column-indicator-mode +1)))) | ||
1662 | #+end_src | ||
1663 | |||
1642 | * Programming | 1664 | * Programming |
1643 | 1665 | ||
1644 | ** Comments | 1666 | ** Comments |
@@ -1775,6 +1797,15 @@ checks for a shebang). | |||
1775 | 1797 | ||
1776 | ** Language-specific | 1798 | ** Language-specific |
1777 | 1799 | ||
1800 | *** Generic-x | ||
1801 | |||
1802 | from [[https://www.reddit.com/r/emacs/comments/lfww57/weekly_tipstricketc_thread/gmtk79e/][u/Bodertz]], apparently =generic-x= just ... has syntax highlighting for a ton | ||
1803 | of (I suppose) generic files. | ||
1804 | |||
1805 | #+begin_src emacs-lisp :noweb-ref packages | ||
1806 | (require 'generic-x) | ||
1807 | #+end_src | ||
1808 | |||
1778 | *** Emacs Lisp | 1809 | *** Emacs Lisp |
1779 | 1810 | ||
1780 | **** Don't limit the length of evaluated expressions | 1811 | **** Don't limit the length of evaluated expressions |
@@ -2064,12 +2095,7 @@ See [[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/mast | |||
2064 | #+end_src | 2095 | #+end_src |
2065 | 2096 | ||
2066 | #+begin_src emacs-lisp :noweb-ref hooks | 2097 | #+begin_src emacs-lisp :noweb-ref hooks |
2067 | (defun hook--elfeed-show () | 2098 | (add-hook 'elfeed-show-mode-hook #'acdw/reading-mode) |
2068 | (text-scale-adjust +1) | ||
2069 | (visual-fill-column-mode +1) | ||
2070 | (iscroll-mode +1)) | ||
2071 | |||
2072 | (add-hook 'elfeed-show-mode-hook #'hook--elfeed-show) | ||
2073 | #+end_src | 2099 | #+end_src |
2074 | 2100 | ||
2075 | #+begin_src emacs-lisp :noweb-ref bindings | 2101 | #+begin_src emacs-lisp :noweb-ref bindings |
@@ -2229,11 +2255,14 @@ others. | |||
2229 | (setq-default elpher-ipv4-always t) | 2255 | (setq-default elpher-ipv4-always t) |
2230 | 2256 | ||
2231 | (doremi-face-set 'elpher-gemini-heading1 | 2257 | (doremi-face-set 'elpher-gemini-heading1 |
2232 | '((t (:inherit (modus-theme-heading-1))))) | 2258 | '((t (:inherit (modus-theme-heading-1) |
2259 | :height 1.0)))) | ||
2233 | (doremi-face-set 'elpher-gemini-heading2 | 2260 | (doremi-face-set 'elpher-gemini-heading2 |
2234 | '((t (:inherit (modus-theme-heading-2))))) | 2261 | '((t (:inherit (modus-theme-heading-2) |
2262 | :height 1.0)))) | ||
2235 | (doremi-face-set 'elpher-gemini-heading3 | 2263 | (doremi-face-set 'elpher-gemini-heading3 |
2236 | '((t (:inherit (modus-theme-heading-3))))) | 2264 | '((t (:inherit (modus-theme-heading-3) |
2265 | :height 1.0)))) | ||
2237 | #+end_src | 2266 | #+end_src |
2238 | 2267 | ||
2239 | #+begin_src emacs-lisp :noweb-ref no-littering | 2268 | #+begin_src emacs-lisp :noweb-ref no-littering |
@@ -2250,6 +2279,10 @@ others. | |||
2250 | (define-key elpher-mode-map "G" #'elpher-go-current)) | 2279 | (define-key elpher-mode-map "G" #'elpher-go-current)) |
2251 | #+end_src | 2280 | #+end_src |
2252 | 2281 | ||
2282 | #+begin_src emacs-lisp :noweb-ref hooks | ||
2283 | (add-hook 'elpher-mode-hook #'acdw/reading-mode) | ||
2284 | #+end_src | ||
2285 | |||
2253 | *** Gemini-mode :package: | 2286 | *** Gemini-mode :package: |
2254 | 2287 | ||
2255 | #+begin_src emacs-lisp :noweb-ref packages | 2288 | #+begin_src emacs-lisp :noweb-ref packages |
@@ -2720,7 +2753,7 @@ TODO, and Diary. | |||
2720 | :empty-lines 1) | 2753 | :empty-lines 1) |
2721 | ;; Books to read | 2754 | ;; Books to read |
2722 | ("b" "Book to read" entry | 2755 | ("b" "Book to read" entry |
2723 | (file "books.org") | 2756 | (file+headline "books.org" "Later") |
2724 | "* TOREAD %^{Title} | 2757 | "* TOREAD %^{Title} |
2725 | :PROPERTIES: | 2758 | :PROPERTIES: |
2726 | :Author: %^{Author} | 2759 | :Author: %^{Author} |
@@ -2870,22 +2903,46 @@ Emacs (or the [[https://chrome.google.com/webstore/detail/edit-with-emacs/ljobjl | |||
2870 | (add-hook 'after-init-hook #'edit-server-start) | 2903 | (add-hook 'after-init-hook #'edit-server-start) |
2871 | #+end_src | 2904 | #+end_src |
2872 | 2905 | ||
2873 | *** =git-sync= ~/org | 2906 | *** =git-sync= stuff |
2874 | 2907 | ||
2875 | I don't know where else to put this, but it's just a little command to | 2908 | This function require [[https://github.com/simonthum/git-sync][git-sync]]. |
2876 | run =git-sync= in =org-directory=. | ||
2877 | 2909 | ||
2878 | #+begin_src emacs-lisp :noweb-ref functions | 2910 | #+begin_src emacs-lisp :noweb-ref functions |
2879 | (defun acdw/org-sync () | 2911 | (defun acdw/git-sync (directory) |
2880 | "Run git-sync in `org-directory'. | 2912 | "Run git-sync in DIRECTORY." |
2913 | (interactive) | ||
2914 | (message "Git-Syncing %s..." directory) | ||
2915 | (let ((proc (start-process "git-sync" | ||
2916 | (get-buffer-create (format "*git-sync:%s*" directory)) | ||
2917 | "git" "-C" (expand-file-name directory) "sync"))) | ||
2918 | (add-function :after (process-sentinel proc) | ||
2919 | (lambda (proc ev) | ||
2920 | (cond | ||
2921 | ((string-match "finished\n\\'" ev) | ||
2922 | (message "Git-Syncing %s...Done." directory))))))) | ||
2923 | #+end_src | ||
2924 | |||
2925 | **** ~/org | ||
2926 | |||
2927 | #+begin_src emacs-lisp :noweb-ref bindings | ||
2928 | (defun acdw/git-sync-org () | ||
2929 | "Run `acdw/git-sync' on `org-directory'." | ||
2930 | (interactive) | ||
2931 | (acdw/git-sync org-directory)) | ||
2932 | |||
2933 | (define-key acdw/leader (kbd "C-M-o") #'acdw/git-sync-org) | ||
2934 | #+end_src | ||
2935 | |||
2936 | **** ~/.cache/elfeed/db | ||
2881 | 2937 | ||
2882 | Requires git-sync." | 2938 | #+begin_src emacs-lisp :noweb-ref bindings |
2939 | (defun acdw/git-sync-elfeed-db () | ||
2940 | "Run `acdw/git-sync' on `elfeed-db-directory'." | ||
2883 | (interactive) | 2941 | (interactive) |
2884 | (save-some-buffers :no-query nil) | 2942 | (save-some-buffers :no-query nil) |
2885 | (async-shell-command | 2943 | (acdw/git-sync elfeed-db-directory)) |
2886 | (format "git -C %s sync" (expand-file-name org-directory)))) | ||
2887 | 2944 | ||
2888 | (define-key acdw/leader (kbd "C-M-o") #'acdw/org-sync) | 2945 | (define-key acdw/leader (kbd "C-M-f") #'acdw/git-sync-elfeed-db) |
2889 | #+end_src | 2946 | #+end_src |
2890 | 2947 | ||
2891 | ** Linux (home) | 2948 | ** Linux (home) |
@@ -2893,8 +2950,6 @@ run =git-sync= in =org-directory=. | |||
2893 | :header-args: :noweb-ref linux-specific | 2950 | :header-args: :noweb-ref linux-specific |
2894 | :END: | 2951 | :END: |
2895 | 2952 | ||
2896 | *** Settings | ||
2897 | |||
2898 | *** Scripts | 2953 | *** Scripts |
2899 | 2954 | ||
2900 | **** em | 2955 | **** em |
@@ -2943,6 +2998,15 @@ I use Windows at work, where I /also/ don't have Admin rights. So I | |||
2943 | kind of fly-by-night there. Many of the ideas and scripts in this | 2998 | kind of fly-by-night there. Many of the ideas and scripts in this |
2944 | section come from [[https://github.com/termitereform/JunkPile/blob/master/emacs-on-windows.md][termitereform]] on Github. | 2999 | section come from [[https://github.com/termitereform/JunkPile/blob/master/emacs-on-windows.md][termitereform]] on Github. |
2945 | 3000 | ||
3001 | *** Environment variables | ||
3002 | |||
3003 | **** DICPATH, for Hunspell | ||
3004 | |||
3005 | #+begin_src emacs-lisp :noweb-ref windows-specific | ||
3006 | (setenv "DICPATH" (expand-file-name "exe/share/hunspell" | ||
3007 | "~/Applications/")) | ||
3008 | #+end_src | ||
3009 | |||
2946 | *** Settings | 3010 | *** Settings |
2947 | 3011 | ||
2948 | See also [[https://www.gnu.org/software/emacs/manual/html_mono/efaq-w32.html][the GNU FAQ for Windows]]. At some point I should really dig | 3012 | See also [[https://www.gnu.org/software/emacs/manual/html_mono/efaq-w32.html][the GNU FAQ for Windows]]. At some point I should really dig |
@@ -3197,7 +3261,7 @@ the needed boolean expression to tangle config.org. Booleans, yall! | |||
3197 | #+begin_src emacs-lisp | 3261 | #+begin_src emacs-lisp |
3198 | (let* (;; Speed up init | 3262 | (let* (;; Speed up init |
3199 | (gc-cons-threshold most-positive-fixnum) | 3263 | (gc-cons-threshold most-positive-fixnum) |
3200 | (gc-cons-percentage 0.6) | 3264 | ;; (gc-cons-percentage 0.6) |
3201 | (file-name-handler-alist nil) | 3265 | (file-name-handler-alist nil) |
3202 | ;; Config file names | 3266 | ;; Config file names |
3203 | (config (expand-file-name "config" | 3267 | (config (expand-file-name "config" |
diff --git a/init.el b/init.el index cadfaca..405bf9b 100644 --- a/init.el +++ b/init.el | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | (let* (;; Speed up init | 19 | (let* (;; Speed up init |
20 | (gc-cons-threshold most-positive-fixnum) | 20 | (gc-cons-threshold most-positive-fixnum) |
21 | (gc-cons-percentage 0.6) | 21 | ;; (gc-cons-percentage 0.6) |
22 | (file-name-handler-alist nil) | 22 | (file-name-handler-alist nil) |
23 | ;; Config file names | 23 | ;; Config file names |
24 | (config (expand-file-name "config" | 24 | (config (expand-file-name "config" |