summary refs log tree commit diff stats
path: root/config.org
blob: 08a5418e2a080df9864cdb85d4f21706c413cd11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
#+TITLE: Emacs configuration, literate style
#+AUTHOR: Case Duckworth
#+PROPERTY: header-args :tangle init.el
#+OPTIONS: toc:nil
#+BANKRUPTCY_COUNT: 2

* Bootstrap

** Original init.el

#+begin_src emacs-lisp :tangle no
  ;; This file replaces itself with the actual configuration when
  ;; first run.  To keep only this version in git, run this command:
  ;;
  ;; git update-index --assume-unchanged init.el
  ;;
  ;; If it needs to be changed, start tracking it again thusly:
  ;;
  ;; git update-index --no-assume-unchanged init.el

  (require 'org)
  (find-file (concat user-emacs-directory "config.org"))
  (org-babel-tangle)
  (load-file (concat user-emacs-directory "early-init.el"))
  (load-file (concat user-emacs-directory "init.el"))
  (byte-compile-file (concat user-emacs-directory "init.el"))
#+end_src

** Tangling

#+begin_src emacs-lisp
  ;; init.el -*- lexical-binding: t -*-

  (defun acdw/tangle-init ()
    "If the current buffer is `config.org', tangle it, then compile
  and load the resulting files."
    (when (equal (buffer-file-name)
		 (expand-file-name
		  (concat user-emacs-directory "config.org")))
      (let ((prog-mode-hook nil))
	(require 'org)
	(org-babel-tangle-file
	 (expand-file-name
	  (concat user-emacs-directory "config.org"))))))

  (defun acdw/load-init ()
    (interactive)
    (load-file (expand-file-name
		(concat user-emacs-directory "early-init.el")))
    (load-file (expand-file-name
		(concat user-emacs-directory "init.el"))))
#+end_src

* Early initiation

#+begin_src emacs-lisp :tangle early-init.el
  ;; early-init.el -*- lexical-binding: t; no-byte-compile: t -*-

  (setq load-prefer-newer t)

  (when (eq system-type 'windows-nt)
    (add-to-list 'exec-path "~/bin")
    (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin"))

  (defvar bootstrap-version)
  (let ((bootstrap-file
	 (expand-file-name "straight/repos/straight.el/bootstrap.el"
			   user-emacs-directory))
	(bootstrap-version 5))
    (unless (file-exists-p bootstrap-file)
      (with-current-buffer
	  (url-retrieve-synchronously
	   "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
	   'silent 'inhibit-cookies)
	(goto-char (point-max))
	(eval-print-last-sexp)))
    (load bootstrap-file nil 'nomessage))

  (setq straight-use-package-by-default t)
  (straight-use-package 'use-package)
#+end_src

* Theme

I want to try using the [[https://github.com/kunalb/poet][Poet]] theme.

#+begin_src emacs-lisp
  (use-package poet-theme)
#+end_src

I also want to switch themes between night and day.

#+begin_src emacs-lisp
  (use-package theme-changer
    :custom
    (calendar-latitude 30.39)
    (calendar-longitude -91.83)
    :config
    (change-theme 'poet 'poet-dark))
#+end_src

* Simplify GUI

#+begin_src emacs-lisp
  (menu-bar-mode -1)
  (tool-bar-mode -1)
  (scroll-bar-mode -1)

  (global-visual-line-mode 1)
#+end_src

* Fonts

#+begin_src emacs-lisp
  (require 'cl)
  (defun font-candidate (&rest fonts)
    (loop for font in fonts
	  when (find-font (font-spec :name font))
	  return font))

  (set-face-attribute 'default nil
		      :font
		      (font-candidate
		       "Go Mono-11"
		       "Consolas-11"))

  (set-face-attribute 'fixed-pitch nil
		      :font
		      (font-candidate
		       "Go Mono-11"
		       "Consolas-11"))

  (set-face-attribute 'variable-pitch nil
		      :font
		      (font-candidate
		       "Go-12"
		       "Georgia-11"))
#+end_src

** Unicode

#+begin_src emacs-lisp
  (use-package unicode-fonts
    :config
    (unicode-fonts-setup))
#+end_src

** Variable pitch faces

#+begin_src emacs-lisp
  (add-hook 'text-mode-hook
	    (lambda ()
	      (variable-pitch-mode 1)))
#+end_

* TODO Emacs configuration [meta]

** Keep =~/.emacs.d= tidy

* TODO Ease of use

** Selectrum

** Prescient

** CtrlF

** Startup

** Ignore case

* TODO Persistence

** Auto-saves

** Backup files

** Recent files

** Save places in visited files

** Save history

** Undo

* TODO General editing

** Undo

** Find/replace

** Expand region

* TODO Writing

** Word count

** Visual fill column mode

** Org mode

* TODO Coding

** Display

*** Prettify symbols mode

*** Parentheses and frens

*** Line numbers

** Git

** Programming languages

*** Shell

*** Lisp

*** Fennel

*** Lua

*** Web (HTML/CSS/JS)

* Applications

** Elpher

** Pastebin (0x0)