From 2616826b7f10b293608a1f5b026648ffb0472cca Mon Sep 17 00:00:00 2001 From: Jacob Walchuk Date: Sat, 13 Sep 2025 14:29:13 +0100 Subject: [PATCH] merged some edits made during my server era --- .#init 2.org | 1 - .init.org.~undo-tree~ | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ early-init.org | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ init.org | 253 ++++++++++++++++++++++++++++++++++++++++++++------------------------------------ 4 files changed, 220 insertions(+), 188 deletions(-) diff --git a/.#init 2.org b/.#init 2.org deleted file mode 120000 index 024e403..0000000 120000 --- a/.#init 2.org +++ /dev/null @@ -1,1 +1,0 @@ -yaqub@14comma15.5539diff --git a/.init.org.~undo-tree~ b/.init.org.~undo-tree~ new file mode 100644 index 0000000..6e8bd53 100644 --- /dev/null +++ a/.init.org.~undo-tree~ @@ -1,0 +1,98 @@ +(undo-tree-save-format-version . 1) +"b5c00a7d7e87f7ce714fa1b33398e564ad3fbe09" +[nil nil nil nil (26772 14669 87734 0) 0 nil] +([nil nil ((#("Flexi " 0 6 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t)) . 1683) (undo-tree-id6 . -6) (undo-tree-id7 . -5) (t 26770 34506 136580 756000)) nil (26772 14669 87733 0) 0 nil]) +([nil nil ((#("IBM " 0 4 (face (font-lock-string-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t)) . 1683) (undo-tree-id4 . -3) (undo-tree-id5 . -4)) nil (26772 14669 87732 0) 0 nil]) +([nil nil ((#("VGA " 0 4 (face (font-lock-string-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t)) . 1683) (undo-tree-id2 . -3) (undo-tree-id3 . -4)) nil (26772 14669 87731 0) 0 nil]) +([nil nil ((#("False" 0 5 (face (font-lock-string-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t)) . 1683) (undo-tree-id0 . -4) (undo-tree-id1 . -5)) nil (26772 14669 87730 0) 0 nil]) +([nil nil ((1686 . 1707) (1683 . 1686)) nil (26772 14669 87721 0) 0 nil]) +([nil nil ((18349 . 18351) (18338 . 18353) (#(" +" 0 1 (fontified nil)) . 18338) (18337 . 18339) (t 26772 14670 360949 882000)) nil (26772 14863 914318 0) 0 nil]) +([nil nil ((#(": t +" 0 4 (face (org-code) fontified t)) . 14566) (undo-tree-id161 . -3) (undo-tree-id162 . -3) (undo-tree-id163 . -2) (undo-tree-id164 . -3) (undo-tree-id165 . -3) (undo-tree-id166 . -2) (undo-tree-id167 . -2) (undo-tree-id168 . -2) (undo-tree-id169 . -2) (undo-tree-id170 . -2) (undo-tree-id171 . -4) 14568) nil (26772 14863 914317 0) 0 nil]) +([nil nil ((#("#+RESULTS: + +" 0 10 (face org-meta-line font-lock-fontified t fontified t) 10 11 (fontified t) 11 12 (fontified t)) . 14555) (undo-tree-id141 . -11) (undo-tree-id142 . -11) (undo-tree-id143 . -12) (undo-tree-id144 . -11) (undo-tree-id145 . -4) (undo-tree-id146 . -4) (undo-tree-id147 . -4) (undo-tree-id148 . -4) (undo-tree-id149 . -11) (undo-tree-id150 . -11) (undo-tree-id151 . -11) (undo-tree-id152 . -11) (undo-tree-id153 . -11) (undo-tree-id154 . -11) (undo-tree-id155 . -11) (undo-tree-id156 . -11) (undo-tree-id157 . -11) (undo-tree-id158 . -11) (undo-tree-id159 . -11) (undo-tree-id160 . -12) 14566) nil (26772 14863 914314 0) 0 nil]) +([nil nil ((#("** /nov.el/ support +Using nov.el for epub reading +#+begin_src emacs-lisp + (use-package nov + :ensure t + :mode (\"\\\\.epub\\\\'\" . nov-mode) + :config + ;; enable olivetti on all nov buffers + (add-hook 'nov-mode-hook 'olivetti-mode)) +#+end_src + +" 0 1 (face org-level-2 fontified t) 1 3 (face org-level-2 fontified t) 3 11 (org-emphasis t font-lock-multiline t face (italic org-level-2) fontified t) 11 19 (face org-level-2 fontified t) 19 20 (fontified t) 20 50 (fontified t) 50 72 (face org-block-begin-line font-lock-multiline t font-lock-fontified t fontified t) 72 73 (face org-block-begin-line font-lock-multiline t font-lock-fontified t fontified t) 73 76 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 76 87 (src-block t face (font-lock-keyword-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 87 96 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 96 103 (src-block t face (font-lock-builtin-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 103 110 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 110 115 (src-block t face (font-lock-builtin-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 115 117 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 117 129 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 129 146 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 146 153 (src-block t face (font-lock-builtin-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 153 158 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 158 161 (src-block t face (font-lock-comment-delimiter-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 161 196 (src-block t face (font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 196 242 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 242 251 (face org-block-end-line font-lock-multiline t font-lock-fontified t fontified t) 251 252 (face org-block-end-line fontified t) 252 253 (face nil fontified t)) . 14555) (undo-tree-id128 . -252) (undo-tree-id129 . -106) (undo-tree-id130 . -20) (undo-tree-id131 . -50) (undo-tree-id132 . -73) (undo-tree-id133 . -92) (undo-tree-id134 . -154) (undo-tree-id135 . -196) (undo-tree-id136 . -242) (undo-tree-id137 . -253) (undo-tree-id138 . -19) (undo-tree-id139 . -19) (undo-tree-id140 . -253)) nil (26772 14863 914309 0) 0 nil]) +([nil nil ((#("** Finder + +#+begin_src emacs-lisp + (use-package reveal-in-osx-finder + :ensure t + :bind (\"C-c z\" . reveal-in-osx-finder)) +#+end_src + +" 0 1 (face org-level-2 fontified t) 1 3 (face org-level-2 fontified t) 3 9 (face org-level-2 fontified t) 9 10 (fontified t) 10 11 (fontified t) 11 33 (face org-block-begin-line font-lock-multiline t font-lock-fontified t fontified t) 33 34 (face org-block-begin-line font-lock-multiline t font-lock-fontified t fontified t) 34 37 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 37 48 (src-block t face (font-lock-keyword-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 48 74 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 74 81 (src-block t face (font-lock-builtin-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 81 88 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 88 93 (src-block t face (font-lock-builtin-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 93 95 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 95 102 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 102 128 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 128 137 (face org-block-end-line font-lock-multiline t font-lock-fontified t fontified t) 137 138 (face org-block-end-line fontified t) 138 139 (face nil fontified t)) . 14594) (undo-tree-id120 . -138) (undo-tree-id121 . -11) (undo-tree-id122 . -34) (undo-tree-id123 . -70) (undo-tree-id124 . -84) (undo-tree-id125 . -128) (undo-tree-id126 . -9) (undo-tree-id127 . -139)) nil (26772 14863 914306 0) 0 nil]) +([nil nil ((#(" +" 0 1 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t)) . -16956) (undo-tree-id17 . -1) (undo-tree-id18 . -1) (undo-tree-id19 . -1) (undo-tree-id20 . -1) (undo-tree-id21 . -1) (undo-tree-id22 . -1) (undo-tree-id23 . -1) (undo-tree-id24 . -1) (undo-tree-id25 . -1) (undo-tree-id26 . -1) (undo-tree-id27 . -1) (undo-tree-id28 . -1) (undo-tree-id29 . -1) (undo-tree-id30 . -1) (undo-tree-id31 . -1) (undo-tree-id32 . -1) (undo-tree-id33 . -1) (undo-tree-id34 . -1) (undo-tree-id35 . -1) (undo-tree-id36 . -1) (undo-tree-id37 . -1) (undo-tree-id38 . -1) (undo-tree-id39 . -1) (undo-tree-id40 . -1) (undo-tree-id41 . -1) (undo-tree-id42 . -1) (undo-tree-id43 . -1) (undo-tree-id44 . -1) (undo-tree-id45 . -1) (undo-tree-id46 . -1) (undo-tree-id47 . -1) (undo-tree-id48 . -1) (undo-tree-id49 . -1) (undo-tree-id50 . -1) (undo-tree-id51 . -1) (undo-tree-id52 . -1) (#(" +" 0 1 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t)) . -16957) (undo-tree-id53 . -1) (undo-tree-id54 . -1) (undo-tree-id55 . -1) (undo-tree-id56 . -1) (undo-tree-id57 . -1) (undo-tree-id58 . -1) (undo-tree-id59 . -1) (undo-tree-id60 . -1) (undo-tree-id61 . -1) (undo-tree-id62 . -1) (undo-tree-id63 . -1) (undo-tree-id64 . -1) (undo-tree-id65 . -1) (undo-tree-id66 . -1) (undo-tree-id67 . -1) (undo-tree-id68 . -1) (undo-tree-id69 . -1) (undo-tree-id70 . -1) (undo-tree-id71 . -1) (undo-tree-id72 . -1) (undo-tree-id73 . -1) (undo-tree-id74 . -1) (undo-tree-id75 . -1) (undo-tree-id76 . -1) (undo-tree-id77 . -1) (undo-tree-id78 . -1) (undo-tree-id79 . -1) (undo-tree-id80 . -1) (undo-tree-id81 . -1) (undo-tree-id82 . -1) (undo-tree-id83 . -1) (undo-tree-id84 . -1) (undo-tree-id85 . -1) (undo-tree-id86 . -1) (undo-tree-id87 . -1) (undo-tree-id88 . -1) 16958 (#(" ;; the command win opens a windows command prompt + (defun win () + \"Open a Windows PowerShell session.\" + (interactive) + (let* ((user \"yaqub\") + (host \"WINVM.local\") + (password (with-temp-buffer + (insert-file-contents \"~/.winssh/password\") + (buffer-string))) + (ssh-command (concat \"sshpass -p '\" password \"' ssh -o StrictHostKeyChecking=no \" user \"@\" host \" powershell.exe -NoExit\")) + (term-buffer (ansi-term \"/bin/bash\"))) ;; Open the terminal buffer + ;; Rename the buffer to *windows* + (with-current-buffer term-buffer + (rename-buffer \"*windows*\")) + ;; Send the SSH command to start PowerShell + (term-send-raw-string (concat ssh-command \"\\r\\n\")) + ;; Send 'cls' after connection (PowerShell also supports 'cls') + (run-with-timer 1 nil + (lambda () + (term-send-raw-string \"cls\\r\\n\")))))" 0 2 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 2 5 (src-block t face (font-lock-comment-delimiter-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 5 52 (src-block t face (font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 52 55 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 55 60 (src-block t face (font-lock-keyword-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 60 61 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 61 64 (src-block t face (font-lock-function-name-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 64 72 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 72 108 (src-block t face (font-lock-doc-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 108 114 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 114 125 (src-block t face (font-lock-keyword-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 125 132 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 132 136 (src-block t face (font-lock-keyword-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 136 144 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 144 151 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 151 170 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 170 183 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 183 207 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 207 223 (src-block t face (font-lock-keyword-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 223 269 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 269 289 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 289 364 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 364 378 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 378 388 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 388 424 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 424 430 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 430 433 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 433 439 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 439 464 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 464 502 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 502 513 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 513 518 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 518 521 (src-block t face (font-lock-comment-delimiter-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 521 546 (src-block t face (font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 546 552 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 552 555 (src-block t face (font-lock-comment-delimiter-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 555 576 (src-block t face (font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 576 585 (src-block t face (font-lock-comment-face org-block) font-lock-fontified t org-emphasis t font-lock-multiline t fontified t) 585 586 (src-block t face (font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 586 593 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 593 612 (src-block t face (font-lock-keyword-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 612 648 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 648 649 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 649 658 (src-block t face (font-lock-string-face org-block) font-lock-fontified t org-emphasis t font-lock-multiline t fontified t) 658 659 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 659 668 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 668 671 (src-block t face (font-lock-comment-delimiter-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 671 712 (src-block t face (font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 712 760 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 760 766 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 766 775 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 775 778 (src-block t face (font-lock-comment-delimiter-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 778 784 (src-block t face (font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 784 787 (src-block t face (font-lock-constant-face font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 787 833 (src-block t face (font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 833 836 (src-block t face (font-lock-constant-face font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 836 839 (src-block t face (font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 839 890 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 890 896 (src-block t face (font-lock-keyword-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 896 946 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 946 955 (src-block t face (font-lock-string-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 955 960 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t)) . 16958) (undo-tree-id89 . -960) (undo-tree-id90 . -662) (undo-tree-id91 . -712) (undo-tree-id92 . -769) (undo-tree-id93 . -839) (undo-tree-id94 . -900) (undo-tree-id95 . -900) (undo-tree-id96 . -712) (undo-tree-id97 . -586) (undo-tree-id98 . -546) (undo-tree-id99 . -467) (undo-tree-id100 . -332) (undo-tree-id101 . -291) (undo-tree-id102 . -291) (undo-tree-id103 . -291) (undo-tree-id104 . -291) (undo-tree-id105 . -291) (undo-tree-id106 . -291) (undo-tree-id107 . -291) (undo-tree-id108 . -291) (undo-tree-id109 . -291) (undo-tree-id110 . -291) (undo-tree-id111 . -291) (undo-tree-id112 . -291) (undo-tree-id113 . -960) (undo-tree-id114 . -960) (undo-tree-id115 . -960) (#("s" 0 1 (fontified t)) . -18276) (undo-tree-id116 . -1) 18277 (18276 . 18277) (#("*" 0 1 (face org-level-2 fontified t)) . 18276) (undo-tree-id117 . -1) (undo-tree-id118 . -1) (undo-tree-id119 . -1)) nil (26772 14863 914303 0) 0 nil]) +([nil nil ((#("#+RESULTS: +" 0 10 (face org-meta-line font-lock-fontified t fontified t) 10 11 (fontified t)) . 16968) (undo-tree-id14 . -10) (undo-tree-id15 . -11) (undo-tree-id16 . -11)) nil (26772 14863 914270 0) 0 nil]) +([nil nil ((#(": win +" 0 2 (face (org-code) fontified t) 2 5 (face (org-code) fontified t) 5 6 (face (org-code) fontified t)) . 16968) (undo-tree-id11 . -5) (undo-tree-id12 . -5) (undo-tree-id13 . -6)) nil (26772 14863 914269 0) 0 nil]) +([nil nil ((#(" +" 0 1 (fontified t)) . 16968) (undo-tree-id8 . 1) (undo-tree-id9 . -1) (undo-tree-id10 . -1)) nil (26772 14863 914267 0) 0 nil]) +([nil nil ((#(" ;; Bootstrap use-package if not installed +" 0 2 (src-block t face (org-block) font-lock-multiline t font-lock-fontified t fontified t) 2 5 (src-block t face (font-lock-comment-delimiter-face org-block) font-lock-multiline t font-lock-fontified t fontified t) 5 44 (src-block t face (font-lock-comment-face org-block) font-lock-multiline t font-lock-fontified t fontified t)) . 712) (undo-tree-id189 . -23) (undo-tree-id190 . -43) (undo-tree-id191 . -23) (undo-tree-id192 . -23) (undo-tree-id193 . -23) 735 (t 26772 14863 916302 158000)) nil (26772 14939 696499 0) 0 nil]) +([nil nil ((#(" ;; Ensure packages are installed automatically +" 0 2 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 2 5 (face (font-lock-comment-delimiter-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 5 49 (face (font-lock-comment-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t)) . 825) (undo-tree-id183 . -48) (undo-tree-id184 . -23) (undo-tree-id185 . -23) (undo-tree-id186 . -23) (undo-tree-id187 . -23) (undo-tree-id188 . -49) 848) nil (26772 14939 696497 0) 0 nil]) +([nil nil ((#(" +" 0 1 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t)) . 824) (undo-tree-id180 . -1) (undo-tree-id181 . -1) (undo-tree-id182 . -1)) nil (26772 14939 696495 0) 0 nil]) +([nil nil ((#(" +" 0 1 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t)) . 861) (undo-tree-id179 . -1)) nil (26772 14939 696494 0) 0 nil]) +([nil nil ((#("** Auto-tangle this init and other literate .el files + +#+begin_src emacs-lisp + (defun yaqub/tangle-if-org-in-yaqubmacs () + \"If the saved file is an .org file within ~/Development/yaqubmacs, tangle it.\" + (let ((target-dir (expand-file-name \"~/Development/yaqubmacs\"))) + (when (and (string-suffix-p \".org\" buffer-file-name) + (eq major-mode 'org-mode) + (string-prefix-p target-dir buffer-file-name)) + (org-babel-tangle)))) + + (add-hook 'after-save-hook 'yaqub/tangle-if-org-in-yaqubmacs) +#+end_src + +" 0 1 (face org-level-2 fontified t) 1 3 (face org-level-2 fontified t) 3 53 (face org-level-2 fontified t) 53 54 (fontified t) 54 55 (fontified t) 55 77 (face org-block-begin-line font-lock-multiline t font-lock-fontified t fontified t) 77 78 (face org-block-begin-line font-lock-multiline t font-lock-fontified t fontified t) 78 81 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 81 86 (face (font-lock-keyword-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 86 87 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 87 119 (face (font-lock-function-name-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 119 127 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 127 205 (face (font-lock-doc-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 205 211 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 211 214 (face (font-lock-keyword-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 214 246 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 246 271 (face (font-lock-string-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 271 282 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 282 286 (face (font-lock-keyword-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 286 288 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 288 291 (face (font-lock-keyword-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 291 309 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 309 315 (face (font-lock-string-face org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 315 534 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 534 536 (face (org-block) font-lock-multiline t src-block t font-lock-fontified t fontified t) 536 545 (face org-block-end-line font-lock-multiline t font-lock-fontified t fontified t) 545 546 (face org-block-end-line fontified t) 546 547 (face nil fontified t)) . 872) (undo-tree-id172 . -546) (undo-tree-id173 . -5) (undo-tree-id174 . -53) (undo-tree-id175 . -5) (undo-tree-id176 . -5) (undo-tree-id177 . -5) (undo-tree-id178 . -547) 877) nil (26772 14939 696492 0) 0 nil]) +([nil nil ((2081 . 2092) (#(" +" 0 1 (fontified nil)) . 2081) (2080 . 2082) (t 26772 14939 698595 658000)) nil (26772 15052 884731 0) 0 nil]) +([nil nil ((#("#+RESULTS: +" 0 10 (face org-meta-line font-lock-fontified t fontified t) 10 11 (fontified t)) . 2081) (undo-tree-id222 . -5) (undo-tree-id223 . -10) (undo-tree-id224 . -5) (undo-tree-id225 . -10) (undo-tree-id226 . -10) (undo-tree-id227 . -9) (undo-tree-id228 . -9) (undo-tree-id229 . -5) (undo-tree-id230 . -5) (undo-tree-id231 . -5) (undo-tree-id232 . -5) (undo-tree-id233 . -5) (undo-tree-id234 . -5) (undo-tree-id235 . -5) (undo-tree-id236 . -5) (undo-tree-id237 . -5) (undo-tree-id238 . -11) 2086) nil (26772 15052 884730 0) 0 nil]) +([nil nil ((2081 . 2092) (#(" +" 0 1 (fontified nil)) . 2081) (2080 . 2082)) nil (26772 15052 884726 0) 0 nil]) +([nil nil ((#("#+RESULTS: +" 0 10 (face org-meta-line font-lock-fontified t fontified t) 10 11 (fontified t)) . 2081) (undo-tree-id209 . -6) (undo-tree-id210 . -10) (undo-tree-id211 . -6) (undo-tree-id212 . -6) (undo-tree-id213 . -6) (undo-tree-id214 . -6) (undo-tree-id215 . -6) (undo-tree-id216 . -6) (undo-tree-id217 . -6) (undo-tree-id218 . -6) (undo-tree-id219 . -6) (undo-tree-id220 . -6) (undo-tree-id221 . -11) 2087) nil (26772 15052 884725 0) 0 nil]) +([nil current ((#(" +" 0 1 (fontified t)) . 2081) (undo-tree-id194 . -1) (undo-tree-id195 . -1) (undo-tree-id196 . -1) (undo-tree-id197 . -1) (undo-tree-id198 . -1) (undo-tree-id199 . -1) (undo-tree-id200 . -1) (undo-tree-id201 . -1) (undo-tree-id202 . -1) (undo-tree-id203 . -1) (undo-tree-id204 . -1) (undo-tree-id205 . -1) (undo-tree-id206 . -1) (undo-tree-id207 . -1) (undo-tree-id208 . -1)) nil (26772 15052 884720 0) 0 nil]) +nil diff --git a/early-init.org b/early-init.org new file mode 100644 index 0000000..8d7cd2f 100644 --- /dev/null +++ a/early-init.org @@ -1,0 +1,56 @@ +#+PROPERTY: header-args :tangle /Users/yaqub/.emacs.d/early-init.el + +* GCC Directory + +#+begin_src emacs-lisp + (defun homebrew-gcc-paths () + "Return GCC library paths from Homebrew installations. + Detects paths for gcc and libgccjit packages to be used in LIBRARY_PATH." + (let* ((paths '()) + (brew-bin (or (executable-find "brew") + (let ((arm-path "/opt/homebrew/bin/brew") + (intel-path "/usr/local/bin/brew")) + (cond + ((file-exists-p arm-path) arm-path) + ((file-exists-p intel-path) intel-path)))))) + + (when brew-bin + ;; Get gcc paths. + (let* ((gcc-prefix (string-trim + (shell-command-to-string + (concat brew-bin " --prefix gcc")))) + (gcc-lib-current (expand-file-name "lib/gcc/current" gcc-prefix))) + (push gcc-lib-current paths) + + ;; Find apple-darwin directory. + (let* ((default-directory gcc-lib-current) + (arch-dirs (file-expand-wildcards "gcc/*-apple-darwin*/*[0-9]"))) + (when arch-dirs + (push (expand-file-name + (car (sort arch-dirs #'string>))) + paths)))) + + ;; Get libgccjit paths + (let* ((jit-prefix (string-trim + (shell-command-to-string + (concat brew-bin " --prefix libgccjit")))) + (jit-lib-current (expand-file-name "lib/gcc/current" jit-prefix))) + (push jit-lib-current paths))) + + (nreverse paths))) + + (defun setup-macos-native-comp-library-paths () + "Set up LIBRARY_PATH for native compilation on macOS. + Includes Homebrew GCC paths and CommandLineTools SDK libraries." + (let* ((existing-paths (split-string (or (getenv "LIBRARY_PATH") "") ":" t)) + (gcc-paths (homebrew-gcc-paths)) + (clt-paths '("/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib")) + (unique-paths (delete-dups + (append existing-paths gcc-paths clt-paths)))) + + (setenv "LIBRARY_PATH" (mapconcat #'identity unique-paths ":")))) + + ;; Set up library paths for native compilation on macOS. + (when (eq system-type 'darwin) + (setup-macos-native-comp-library-paths)) +#+end_src diff --git a/init.org b/init.org index fd6916d..7b5ce89 100644 --- a/init.org +++ a/init.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args :tangle /Users/yaqub/.emacs.d/init.el +#+PROPERTY: header-args :tangle "/home/yaqub/.emacs.d/init.el" * Initial Setup @@ -38,27 +38,13 @@ #+end_src -** Auto-tangle this init and other literate .el files - -#+begin_src emacs-lisp - (defun yaqub/tangle-if-org-in-yaqubmacs () - "If the saved file is an .org file within ~/Development/yaqubmacs, tangle it." - (let ((target-dir (expand-file-name "~/Development/yaqubmacs"))) - (when (and (string-suffix-p ".org" buffer-file-name) - (eq major-mode 'org-mode) - (string-prefix-p target-dir buffer-file-name)) - (org-babel-tangle)))) - - (add-hook 'after-save-hook 'yaqub/tangle-if-org-in-yaqubmacs) -#+end_src - * Appearance ** Fonts #+begin_src emacs-lisp ;; Set the default font for Latin, Greek, and Cyrillic (set-face-attribute 'default nil - :family "Flexi IBM VGA False" + :family "SF Mono Terminal Regular" :height 160) ;; Adjust height as needed (set-face-attribute 'fixed-pitch nil @@ -82,6 +68,7 @@ nil 'append) #+end_src + ** Mac env. specific settings #+begin_src emacs-lisp @@ -174,6 +161,14 @@ :config (evil-collection-init)) + (use-package evil-org + :ensure t + :after org + :hook (org-mode . (lambda () evil-org-mode)) + :config + (require 'evil-org-agenda) + (evil-org-agenda-set-keys)) + ;; Replace buffer switcher with consult-buffer in Evil ex-mode (evil-ex-define-cmd "b" 'consult-buffer) @@ -277,7 +272,28 @@ :init (yas-global-mode 1)) #+end_src + +** Enable dired-sidebar + +#+begin_src emacs-lisp + (use-package dired-sidebar + :bind (("C-x C-n" . dired-sidebar-toggle-sidebar)) + :ensure t + :commands (dired-sidebar-toggle-sidebar) + :init + (add-hook 'dired-sidebar-mode-hook + (lambda () + (unless (file-remote-p default-directory) + (auto-revert-mode)))) + :config + (push 'toggle-window-split dired-sidebar-toggle-hidden-commands) + (push 'rotate-windows dired-sidebar-toggle-hidden-commands) + (setq dired-sidebar-subtree-line-prefix "__") + (setq dired-sidebar-theme 'vscode) + (setq dired-sidebar-use-term-integration t) + (setq dired-sidebar-use-custom-font t)) +#+end_src ** Setup Company-mode Company mode is a text completion framework. @@ -298,6 +314,7 @@ #+end_src ** Setup Editorconfig + #+begin_src emacs-lisp (use-package editorconfig :ensure t @@ -318,7 +335,18 @@ :ensure t :config (setq treesit-auto-install 'prompt) ; Automatically install grammars - (global-treesit-auto-mode))e + (global-treesit-auto-mode)) +#+end_src + +** Smart Parens + +#+begin_src emacs-lisp + (use-package smartparens + :ensure smartparens ;; install the package + :hook (prog-mode text-mode markdown-mode) ;; add `smartparens-mode` to these hooks + :config + ;; load default config + (require 'smartparens-config)) #+end_src * Writing @@ -349,6 +377,7 @@ (define-key org-mode-map (kbd "C-c ") 'org-mark-ring-push) ) #+end_src + *** Org-roam Very important. #+begin_src emacs-lisp @@ -402,15 +431,6 @@ ;; Bind this to the usual attachment keybinding (C-c c-a) (with-eval-after-load 'org (define-key org-mode-map (kbd "C-c c-a") #'yaqub/org-attach-file-to-file-id)) -#+end_src - -*** Org-download -#+begin_src emacs-lisp - (use-package org-download - :ensure t - :custom - (org-download-screenshot-method "screencapture") - (org-download-method 'attach)) #+end_src ** Setup LaTeX @@ -436,100 +456,14 @@ (setq TeX-command-BibTeX "Biber")) #+end_src * Reading -** Using PDF-Tools instead of DocView -#+begin_src emacs-lisp - (use-package pdf-tools - :ensure t - :config - ;; Ensure pdf-tools is initialized after installation - (pdf-tools-install) - - ;; Make sure PDFs fit the page by default - (setq-default pdf-view-display-size 'fit-page) - - ;; Set pdf-view-mode as the default for PDF files - (add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode)) - (setq pdf-cache-prefetch-delay 0.1) - ;; Optional: open PDFs in a new frame by default - ;; (setq pdf-view-use-new-open t) - ;; set keybindings - ;; s-left: image-forward-hscroll 5 - ;; s-right: image-backward-hscroll 5 - ;; s-up: image-previous-line 5 - ;; s-down: image-next-line 5 - (define-key pdf-view-mode-map (kbd "s-") 'image-forward-hscroll) - (define-key pdf-view-mode-map (kbd "s-") 'image-backward-hscroll) - (define-key pdf-view-mode-map (kbd "s-") 'image-previous-line) - (define-key pdf-view-mode-map (kbd "s-") 'image-next-line) - ;; ok now make it scroll 5x faster - (define-key pdf-view-mode-map (kbd "C-s-") (lambda () (interactive) (image-forward-hscroll 5))) - (define-key pdf-view-mode-map (kbd "C-s-") (lambda () (interactive) (image-backward-hscroll 5))) - (define-key pdf-view-mode-map (kbd "C-s-") (lambda () (interactive) (image-previous-line 5))) - (define-key pdf-view-mode-map (kbd "C-s-") (lambda () (interactive) (image-next-line 5))) - ) -#+end_src - -#+RESULTS: -: t - -** /nov.el/ support -Using nov.el for epub reading -#+begin_src emacs-lisp - (use-package nov - :ensure t - :mode ("\\.epub\\'" . nov-mode) - :config - ;; enable olivetti on all nov buffers - (add-hook 'nov-mode-hook 'olivetti-mode)) -#+end_src - -* Links to other applications/services -** Finder - -#+begin_src emacs-lisp - (use-package reveal-in-osx-finder - :ensure t - :bind ("C-c z" . reveal-in-osx-finder)) -#+end_src - -* macOS -** macOS fullscreen -#+begin_src emacs-lisp - (setq ns-use-native-fullscreen t) -#+end_src - -** macOS Mouse -I'm using mitsuharu emacs now, so I'll set mouse scrolling to behave according to my zoomer inclinations - -#+begin_src emacs-lisp - (setq mac-mouse-wheel-smooth-scroll t) -#+end_src - -** Property lists -OSX Plist is a library for reading and writing property lists (`.plist` files) as used in OS X. - -#+begin_src emacs-lisp - (use-package osx-plist - :ensure t - :vc (:url "https://github.com/gonewest818/osx-plist")) -#+end_src - -#+RESULTS: - -In addition, emacs should recognize everything that ends in *.plist as XML and do syntax highlighting / company suggestions / etc appropriately. - +** Setup elfeed +*** Elfeed #+begin_src emacs-lisp - (add-to-list 'auto-mode-alist '("\\.plist\\'" . xml-mode)) -#+end_src - -** Tooltips workaround - -See https://github.com/vedang/pdf-tools/issues/298 - -#+begin_src emacs-lisp - (setq use-system-tooltips t) + (use-package elfeed + :ensure t) #+end_src - +*** TODO Elfeed Org +*** TODO Elfeed Youtube * Anki Integration #+begin_src emacs-lisp (use-package anki-editor @@ -538,6 +472,16 @@ (global-set-key (kbd "C-c a a") 'anki-editor-insert-note) (global-set-key (kbd "C-c a c") 'anki-editor-cloze-region) (global-set-key (kbd "C-c a p") 'anki-editor-push-notes)) +#+end_src + +* Mentor Torrent Client +#+begin_src emacs-lisp + (use-package mentor + :ensure t + :after evil + :config + (setq mentor-rtorrent-external-rpc "~/.rtorrent-rpc.socket") + (evil-set-initial-state 'mentor-mode 'emacs)) #+end_src * Minibuffer Shortcuts @@ -550,83 +494,18 @@ ;; the command "home" opens home orgfile (defun home () (interactive) - (find-file "~/Orgfiles/roam/home.org")) + (find-file "/media/storage/Orgfiles/roam/home.org")) ;; the command "todo" opens todo orgfile (defun todo () (interactive) - (find-file "~/Orgfiles/roam/todo.org")) + (find-file "/media/storage/Orgfiles/roam/todo.org")) ;; the command "yaqubmacs" opens dired at ~/Development/yaqubmacs (defun yaqubmacs () - (interactive) - (dired "~/Development/yaqubmacs")) - - ;; the command nt opens a new term - (defun nt () - "Open a new terminal and prompt for a name." (interactive) - (let ((name (read-string "Terminal name: "))) - (ansi-term "/bin/zsh" (concat "terminal<" name ">")))) - - ;; the command nesh opens a new eshell - (defun nesh () - "Open a new eshell and prompt for a name." - (interactive) - (let ((name (read-string "Eshell name: "))) - (let ((buffer (generate-new-buffer (concat "*eshell*<" name ">")))) - (with-current-buffer buffer - (eshell)) - (switch-to-buffer buffer)))) - - ;; the command win opens a windows command prompt - (defun win () - "Open a Windows PowerShell session." - (interactive) - (let* ((user "yaqub") - (host "WINVM.local") - (password (with-temp-buffer - (insert-file-contents "~/.winssh/password") - (buffer-string))) - (ssh-command (concat "sshpass -p '" password "' ssh -o StrictHostKeyChecking=no " user "@" host " powershell.exe -NoExit")) - (term-buffer (ansi-term "/bin/bash"))) ;; Open the terminal buffer - ;; Rename the buffer to *windows* - (with-current-buffer term-buffer - (rename-buffer "*windows*")) - ;; Send the SSH command to start PowerShell - (term-send-raw-string (concat ssh-command "\r\n")) - ;; Send 'cls' after connection (PowerShell also supports 'cls') - (run-with-timer 1 nil - (lambda () - (term-send-raw-string "cls\r\n"))))) -#+end_src - -* Open home.org by default -#+begin_src emacs-lisp - (add-hook 'emacs-startup-hook - (lambda () - (find-file "~/Orgfiles/roam/home.org") - (delete-other-windows))) -#+end_src - -* Server Config -#+begin_src emacs-lisp - (require 'server) - (unless (server-running-p) - (server-start)) -#+end_src - - -** Helper functions for the rest of the OS -I use shortcuts to trigger these from context menus. - -#+begin_src emacs-lisp - (defun open-new-eshell-at (dir) - "Open a new eshell buffer at the specified directory DIR." - (interactive "Directory: ") ; Ask for the directory interactively - (let ((default-directory (expand-file-name dir))) ; Ensure the directory path is absolute - (eshell 'N))) ; 'N ensures a new eshell buffer is created -#+end_src + (dired "/media/storage/Development/yaqubmacs")) +#+END_SRC * Safe local vars Unsafe, but convenient #+begin_src emacs-lisp -- rgit 0.1.5