summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--config.org146
1 files changed, 105 insertions, 41 deletions
diff --git a/config.org b/config.org index 01e5ac2..38f3d66 100644 --- a/config.org +++ b/config.org
@@ -35,22 +35,28 @@
35 "If the current buffer is `config.org', tangle it, then compile 35 "If the current buffer is `config.org', tangle it, then compile
36 and load the resulting files." 36 and load the resulting files."
37 (when (equal (buffer-file-name) 37 (when (equal (buffer-file-name)
38 (expand-file-name 38 (expand-file-name
39 (concat user-emacs-directory "config.org"))) 39 (concat user-emacs-directory "config.org")))
40 (let ((prog-mode-hook nil)) 40 (require 'async)
41 (require 'org) 41 (async-start
42 (org-babel-tangle-file 42 (lambda ()
43 (expand-file-name 43 (let ((prog-mode-hook nil))
44 (concat user-emacs-directory "config.org")))))) 44 (require 'org)
45 (org-babel-tangle-file
46 (expand-file-name
47 (concat user-emacs-directory "config.org")))))
48 (lambda (response)
49 (acdw/load-init)
50 (message "Tangled and loaded: %s" response)))))
45 51
46 (add-hook 'after-save-hook #'acdw/tangle-init) 52 (add-hook 'after-save-hook #'acdw/tangle-init)
47 53
48 (defun acdw/load-init () 54 (defun acdw/load-init ()
49 (interactive) 55 (interactive)
50 (load-file (expand-file-name 56 (load-file (expand-file-name
51 (concat user-emacs-directory "early-init.el"))) 57 (concat user-emacs-directory "early-init.el")))
52 (load-file (expand-file-name 58 (load-file (expand-file-name
53 (concat user-emacs-directory "init.el")))) 59 (concat user-emacs-directory "init.el"))))
54#+end_src 60#+end_src
55 61
56* Early initiation 62* Early initiation
@@ -60,28 +66,66 @@
60 66
61 (setq load-prefer-newer t) 67 (setq load-prefer-newer t)
62 68
69#+end_src
70
71** Add PortableGit to the =exec-path= on Windows
72
73#+begin_src emacs-lisp :tangle early-init.el
63 (when (eq system-type 'windows-nt) 74 (when (eq system-type 'windows-nt)
64 (add-to-list 'exec-path "~/bin") 75 (add-to-list 'exec-path "~/bin")
65 (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin")) 76 (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin"))
77#+end_src
66 78
79** Bootstrap =straight.el=
80
81#+begin_src emacs-lisp :tangle early-init.el
67 (defvar bootstrap-version) 82 (defvar bootstrap-version)
68 (let ((bootstrap-file 83 (let ((bootstrap-file
69 (expand-file-name "straight/repos/straight.el/bootstrap.el" 84 (expand-file-name "straight/repos/straight.el/bootstrap.el"
70 user-emacs-directory)) 85 user-emacs-directory))
71 (bootstrap-version 5)) 86 (bootstrap-version 5))
72 (unless (file-exists-p bootstrap-file) 87 (unless (file-exists-p bootstrap-file)
73 (with-current-buffer 88 (with-current-buffer
74 (url-retrieve-synchronously 89 (url-retrieve-synchronously
75 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 90 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
76 'silent 'inhibit-cookies) 91 'silent 'inhibit-cookies)
77 (goto-char (point-max)) 92 (goto-char (point-max))
78 (eval-print-last-sexp))) 93 (eval-print-last-sexp)))
79 (load bootstrap-file nil 'nomessage)) 94 (load bootstrap-file nil 'nomessage))
95#+end_src
96
97** Use =use-package=
80 98
99#+begin_src emacs-lisp :tangle early-init.el
81 (setq straight-use-package-by-default t) 100 (setq straight-use-package-by-default t)
82 (straight-use-package 'use-package) 101 (straight-use-package 'use-package)
83#+end_src 102#+end_src
84 103
104** Keep =~/.emacs.d= tidy
105
106#+begin_src emacs-lisp
107 (straight-use-package 'no-littering)
108 (require 'no-littering)
109#+end_src
110
111** Additional =use-package= keywords
112
113*** =:custom-update=
114
115#+begin_src emacs-lisp
116 (use-package use-package-custom-update
117 :straight (use-package-custom-update
118 :host github
119 :repo "a13/use-package-custom-update"))
120#+end_src
121
122** Setup async
123
124#+begin_src emacs-lisp :tangle early-init.el
125 (straight-use-package 'async)
126 (require 'async)
127#+end_src
128
85* Macros 129* Macros
86 130
87** Customizing variables 131** Customizing variables
@@ -176,6 +220,14 @@ I also want to switch themes between night and day.
176 (rm/whitelist-add "^$")) 220 (rm/whitelist-add "^$"))
177#+end_src 221#+end_src
178 222
223** Show =^L= as a line
224
225#+begin_src emacs-lisp
226 (use-package form-feed
227 :hook
228 ((text-mode prog-mode) . form-feed-mode))
229#+end_src
230
179* Fonts 231* Fonts
180 232
181#+begin_src emacs-lisp 233#+begin_src emacs-lisp
@@ -221,27 +273,7 @@ I also want to switch themes between night and day.
221 (add-hook 'text-mode-hook #'variable-pitch-mode) 273 (add-hook 'text-mode-hook #'variable-pitch-mode)
222#+end_src 274#+end_src
223 275
224* Emacs configuration [meta] 276* Ease of use
225
226** Keep =~/.emacs.d= tidy
227
228#+begin_src emacs-lisp
229 (straight-use-package 'no-littering)
230 (require 'no-littering)
231#+end_src
232
233** Additional =use-package= keywords
234
235*** =:custom-update=
236
237#+begin_src emacs-lisp
238 (use-package use-package-custom-update
239 :straight (use-package-custom-update
240 :host github
241 :repo "a13/use-package-custom-update"))
242#+end_src
243
244* TODO Ease of use
245 277
246** Selectrum & Prescient 278** Selectrum & Prescient
247 279
@@ -279,7 +311,23 @@ I also want to switch themes between night and day.
279 (cuss initial-scratch-message ";; Hi there!\n") 311 (cuss initial-scratch-message ";; Hi there!\n")
280#+end_src 312#+end_src
281 313
282** TODO Ignore case 314** Ignore case
315
316#+BEGIN_SRC emacs-lisp
317 (cuss completion-ignore-case t)
318 (cuss read-buffer-completion-ignore-case t)
319 (cuss read-file-name-completion-ignore-case t)
320#+END_SRC
321
322** Which key
323
324#+begin_src emacs-lisp
325 (use-package which-key
326 :custom
327 (which-key-popup-type 'minibuffer)
328 :config
329 (which-key-mode))
330#+end_src
283 331
284* Persistence 332* Persistence
285 333
@@ -316,6 +364,19 @@ I also want to switch themes between night and day.
316 (recentf-mode 1)) 364 (recentf-mode 1))
317#+end_src 365#+end_src
318 366
367*** Easily navigate recent files
368
369#+begin_src emacs-lisp
370 (defun recentf-find-file ()
371 "Find a recent file using `completing-read'."
372 (interactive)
373 (let ((file (completing-read "Recent file: " recentf-list nil t)))
374 (when file
375 (find-file file))))
376
377 (bind-key "C-x C-r" #'recentf-find-file)
378#+end_src
379
319** Save places in visited files 380** Save places in visited files
320 381
321#+begin_src emacs-lisp 382#+begin_src emacs-lisp
@@ -432,11 +493,14 @@ I also want to switch themes between night and day.
432 (org-src-tab-acts-natively t) 493 (org-src-tab-acts-natively t)
433 (org-hide-emphasis-markers t) 494 (org-hide-emphasis-markers t)
434 (org-fontify-done-headline t) 495 (org-fontify-done-headline t)
496 (org-fontify-whole-heading-line t)
435 (org-hide-leading-stars t) 497 (org-hide-leading-stars t)
436 (org-pretty-entities t)) 498 (org-hidden-keywords '(author date title))
499 (org-src-window-setup 'current-window)
500 (org-pretty-entities t))
437#+end_src 501#+end_src
438 502
439* TODO Coding 503* Coding
440 504
441** Indenting 505** Indenting
442 506