diff options
author | Akshay <[email protected]> | 2023-06-18 20:54:08 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2023-06-18 20:54:08 +0100 |
commit | af9a5edd1fd65b504cad8eee4c2097b8db7de1e0 (patch) | |
tree | 2aff49751493a669e287c19de00dda07886472d4 /docs/posts/plain_text_journaling | |
parent | b1efbd3181a9bbb444a59f8dbafd7aaaba246945 (diff) |
new post: plain text journaling
Diffstat (limited to 'docs/posts/plain_text_journaling')
-rw-r--r-- | docs/posts/plain_text_journaling/index.html | 308 |
1 files changed, 308 insertions, 0 deletions
diff --git a/docs/posts/plain_text_journaling/index.html b/docs/posts/plain_text_journaling/index.html new file mode 100644 index 0000000..1ef9011 --- /dev/null +++ b/docs/posts/plain_text_journaling/index.html | |||
@@ -0,0 +1,308 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <link rel="stylesheet" href="/syntax.css"> | ||
6 | <meta charset="UTF-8"> | ||
7 | <meta name="viewport" content="initial-scale=1"> | ||
8 | <meta content="#ffffff" name="theme-color"> | ||
9 | <meta name="HandheldFriendly" content="true"> | ||
10 | <meta property="og:title" content="Plain Text Journaling"> | ||
11 | <meta property="og:type" content="website"> | ||
12 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
13 | <meta property="og:url" content="https://peppe.rs"> | ||
14 | <link rel="icon" type="image/x-icon" href="/favicon.png"> | ||
15 | <title>Plain Text Journaling · peppe.rs</title> | ||
16 | <body> | ||
17 | <div class="posts"> | ||
18 | <div class="post"> | ||
19 | <a href="/" class="post-end-link">Home</a> | ||
20 | <span>/</span> | ||
21 | <a href="/posts" class="post-end-link">Posts</a> | ||
22 | <span>/</span> | ||
23 | <a class="post-end-link">Plain Text Journaling</a> | ||
24 | <a class="stats post-end-link" href="https://git.peppe.rs/web/site/plain/posts/plain_text_journaling.md | ||
25 | ">View Raw</a> | ||
26 | <div class="separator"></div> | ||
27 | <div class="date"> | ||
28 | 19/06 — 2023 | ||
29 | <div class="stats"> | ||
30 | <span class="stats-number"> | ||
31 | 138.66 | ||
32 | </span> | ||
33 | <span class="stats-unit">cm</span> | ||
34 |   | ||
35 | <span class="stats-number"> | ||
36 | 8.9 | ||
37 | </span> | ||
38 | <span class="stats-unit">min</span> | ||
39 | </div> | ||
40 | </div> | ||
41 | <h1> | ||
42 | Plain Text Journaling | ||
43 | </h1> | ||
44 | <div class="post-text"> | ||
45 | <p>I cobbled together a journaling system with {neo,}vim, coreutils and | ||
46 | <a href="http://www.fresse.org/dateutils">dateutils</a>. This system is | ||
47 | loosely based on <a href="https://www.rydercarroll.com/">Ryder | ||
48 | Caroll’s</a> Bullet Journal method.</p> | ||
49 | <p><a href="https://u.peppe.rs/SpF.png"><img | ||
50 | src="https://u.peppe.rs/SpF.png" /></a></p> | ||
51 | <h3 id="the-format">The format</h3> | ||
52 | <p>The journal for a given year is a directory:</p> | ||
53 | <div class="sourceCode" id="cb1"><pre | ||
54 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ex">λ</span> ls journal/</span> | ||
55 | <span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="ex">2022/</span> 2023/</span></code></pre></div> | ||
56 | <p>In each directory are 12 files, one for each month of the year, | ||
57 | numbered like so:</p> | ||
58 | <div class="sourceCode" id="cb2"><pre | ||
59 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">λ</span> ls journal/2023/</span> | ||
60 | <span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">01</span> 02 03 04 05 06 07 08 09 10 11 12</span></code></pre></div> | ||
61 | <p>We can now begin writing stuff down:</p> | ||
62 | <div class="sourceCode" id="cb3"><pre | ||
63 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">λ</span> vim journal/2023/1</span></code></pre></div> | ||
64 | <p>Every month must start with a calendar of course, fill that in | ||
65 | with:</p> | ||
66 | <pre class="vim"><code>:read !cal -m</code></pre> | ||
67 | <p>Your entry for January might look like this:</p> | ||
68 | <div class="sourceCode" id="cb5"><pre | ||
69 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">λ</span> cat journal/2023/01</span> | ||
70 | <span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">January</span> 2023</span> | ||
71 | <span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="ex">Mo</span> Tu We Th Fr Sa Su</span> | ||
72 | <span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">1</span></span> | ||
73 | <span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">2</span> 3 4 5 6 7 8</span> | ||
74 | <span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">9</span> 10 11 12 13 14 15</span> | ||
75 | <span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a><span class="ex">16</span> 17 18 19 20 21 22</span> | ||
76 | <span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a><span class="ex">23</span> 24 25 26 27 28 29</span> | ||
77 | <span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a><span class="ex">30</span> 31</span></code></pre></div> | ||
78 | <p>I prefer planning week by week, as opposed to creating a task-list | ||
79 | every day, here’s what I have for the first couple of weeks:</p> | ||
80 | <pre><code> January 2023 | ||
81 | Mo Tu We Th Fr Sa Su | ||
82 | 1 | ||
83 | 2 3 4 5 6 7 8 | ||
84 | 9 10 11 12 13 14 15 | ||
85 | 16 17 18 19 20 21 22 | ||
86 | 23 24 25 26 27 28 29 | ||
87 | 30 31 | ||
88 | |||
89 | |||
90 | week 1 | ||
91 | |||
92 | done apply leaves | ||
93 | done dload boarding pass | ||
94 | moved reply to dan | ||
95 | |||
96 | |||
97 | week 2 | ||
98 | |||
99 | todo reply to dan | ||
100 | todo pack bags | ||
101 | done travel insurance | ||
102 | todo weigh luggage</code></pre> | ||
103 | <p>I start the week by writing a header and each item that week is | ||
104 | placed on its own line. The items are prefixed with a <code>todo</code> | ||
105 | or a <code>done</code> signifier.</p> | ||
106 | <h3 id="form-over-function">Form over function</h3> | ||
107 | <p>Right off the bat, the signifiers look very noisy, Even more so once | ||
108 | we start introducing variety (I use “event”, “note” and “moved”):</p> | ||
109 | <pre><code>week 1 | ||
110 | |||
111 | todo apply leaves | ||
112 | done dload boarding pass | ||
113 | todo reply to dan | ||
114 | event fr trip | ||
115 | note weight 68.6</code></pre> | ||
116 | <p>We can clean this up with “abbreviations” | ||
117 | (<code>:h abbreviations</code>):</p> | ||
118 | <pre class="vim"><code>:iabbrev todo · | ||
119 | :iabbrev done ×</code></pre> | ||
120 | <p>Now, typing this:</p> | ||
121 | <pre><code>todo apply leaves</code></pre> | ||
122 | <p>Automatically inserts:</p> | ||
123 | <pre><code>· apply leaves</code></pre> | ||
124 | <p>You can use <code>x</code> and <code>o</code> as well, but | ||
125 | <code>×</code> (U+00D7, MULTIPLICATION SIGN) and <code>·</code> (U+00B7, | ||
126 | MIDDLE DOT) are more … <em>gourmet</em>.</p> | ||
127 | <p>The other signifiers I use are:</p> | ||
128 | <ul> | ||
129 | <li><code>-</code> for note</li> | ||
130 | <li><code>o</code> for event</li> | ||
131 | <li><code>></code> for moved.</li> | ||
132 | </ul> | ||
133 | <p>Nit #2 is the lack of order. We can employ vim to introduce grouping | ||
134 | and sorting. Select the list of entries for this week:</p> | ||
135 | <pre class="vim"><code>vip " line-wise select inner paragraph | ||
136 | :'<,'>sort " the markers '< and '> are automatically inserted, | ||
137 | " they mark the start and end of the selection</code></pre> | ||
138 | <p>We end up with:</p> | ||
139 | <pre><code>week 1 | ||
140 | |||
141 | · apply leaves | ||
142 | · reply to dan | ||
143 | × dload boarding pass</code></pre> | ||
144 | <p>The lines are grouped by their signifiers, segregating todo items | ||
145 | from completed items. Luckily, MIDDLE DOT is lesser than MULTIPLICATION | ||
146 | SIGN, so todo items are placed at the top. The same goes for | ||
147 | <code>o</code> and <code>x</code> symbols, either set of signifiers will | ||
148 | result in the same sorting order.</p> | ||
149 | <p>We can shorten this select-paragraph-invoke-sort dance by setting the | ||
150 | <code>formatprg</code> variable:</p> | ||
151 | <pre class="vim"><code>:set formatprg=sort\ -V</code></pre> | ||
152 | <p>Now, hitting <code>gqip</code> should automatically group and sort | ||
153 | the items for the week under the cursor, moving todo items to the top. | ||
154 | Finding signifier glyphs that suit your sorting preference is a fun | ||
155 | exercise.</p> | ||
156 | <h3 id="syntax-highlighting">Syntax highlighting</h3> | ||
157 | <p>Adding color to items introduces another layer of visual distinction. | ||
158 | In truth, I like to deck it out just because.</p> | ||
159 | <p>First, create a few syntax groups:</p> | ||
160 | <pre class="vim"><code>:syntax match JournalAll /.*/ " captures the entire buffer | ||
161 | :syntax match JournalDone /^×.*/ " lines containing 'done' items: × | ||
162 | :syntax match JournalTodo /^·.*/ " lines containing 'todo' items: · | ||
163 | :syntax match JournalEvent /^o.*/ " lines containing 'event' items: o | ||
164 | :syntax match JournalNote /^- .*/ " lines containing 'note' items: - | ||
165 | :syntax match JournalMoved /^>.*/ " lines containing 'moved' items: ></code></pre> | ||
166 | <p>Add highlights to each group:</p> | ||
167 | <pre class="vim"><code>:highlight JournalAll ctermfg=12 " bright black | ||
168 | :highlight JournalDone ctermfg=12 " bright black | ||
169 | :highlight JournalEvent ctermfg=6 " cyan | ||
170 | :highlight JournalMoved ctermfg=5 " magenta | ||
171 | :highlight JournalNote ctermfg=3 " yellow</code></pre> | ||
172 | <p>In my terminal, this is rendered like so:</p> | ||
173 | <p><a href="https://u.peppe.rs/Du6.png"><img | ||
174 | src="https://u.peppe.rs/Du6.png" /></a></p> | ||
175 | <h3 id="habit-tracking">Habit tracking</h3> | ||
176 | <p>While this is not a part of my journaling system anymore, a few | ||
177 | headers and an awk script is all it takes to track habits. My weekly | ||
178 | entries would include a couple of habit headers like so:</p> | ||
179 | <pre><code>week 1 -------------- | ||
180 | |||
181 | × wake up on time | ||
182 | × water the plants | ||
183 | |||
184 | spend 7.5 7 10 | ||
185 | --------------------- | ||
186 | |||
187 | |||
188 | week 2 -------------- | ||
189 | |||
190 | · make the bed | ||
191 | · go to bed | ||
192 | |||
193 | spend 30 2.75 6 | ||
194 | ---------------------</code></pre> | ||
195 | <p>Here, under the <code>spend</code> header in week 1, are a list of | ||
196 | expenditures accumulated over the week. The monthly spend is calculated | ||
197 | with this awk script:</p> | ||
198 | <div class="sourceCode" id="cb17"><pre | ||
199 | class="sourceCode awk"><code class="sourceCode awk"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="cf">BEGIN</span> <span class="op">{</span>spend<span class="op">=</span><span class="dv">0</span><span class="op">;}</span></span> | ||
200 | <span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a><span class="ot">/</span><span class="ss">spend</span><span class="ot">/</span> <span class="op">{</span><span class="cf">for</span><span class="op">(</span>i<span class="op">=</span><span class="dv">1</span><span class="op">;</span>i<span class="op"><=</span><span class="dt">$NF</span><span class="op">;</span>i<span class="op">++)</span> spend<span class="op">+=</span><span class="dt">$i</span><span class="op">;}</span></span> | ||
201 | <span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a><span class="cf">END</span> <span class="op">{</span> <span class="kw">printf</span> spend <span class="st">"eur"</span><span class="op">}</span></span></code></pre></div> | ||
202 | <p>And invoked like so:</p> | ||
203 | <pre><code>λ awk -f spend.awk journal/2023/01 | ||
204 | 63.25eur</code></pre> | ||
205 | <h3 id="reflection">Reflection</h3> | ||
206 | <p>Journaling is not just about planning what is to come, but also | ||
207 | reflecting on what has passed. It would make sense to simultaneously | ||
208 | look at the past few weeks’ entries while making your current one. To | ||
209 | open multiple months of entries at the same time:</p> | ||
210 | <pre><code>λ vim -O journal/2023/0{1,2,3}</code></pre> | ||
211 | <p>Opens 3 months, side-by-side, in vertical splits:</p> | ||
212 | <pre><code>JANUARY ------------ │ FEBRUARY ----------- │ MARCH -------------- | ||
213 | │ │ | ||
214 | Mo Tu We Th Fr Sa Su │ Mo Tu We Th Fr Sa Su │ Mo Tu We Th Fr Sa Su | ||
215 | 1 │ 1 2 3 4 5 │ 1 2 3 4 5 | ||
216 | 2 3 4 5 6 7 8 │ 6 7 8 9 10 11 12 │ 6 7 8 9 10 11 12 | ||
217 | 9 10 11 12 13 14 15 │ 13 14 15 16 17 18 19 │ 13 14 15 16 17 18 19 | ||
218 | 16 17 18 19 20 21 22 │ 20 21 22 23 24 25 26 │ 20 21 22 23 24 25 26 | ||
219 | 23 24 25 26 27 28 29 │ 27 28 │ 27 28 29 30 31 | ||
220 | 30 31 │ │ | ||
221 | │ │ | ||
222 | │ │ | ||
223 | WEEK 1 ------------- │ WEEK 1 ------------- │ WEEK 1 ------------- | ||
224 | │ │ | ||
225 | > latex setup │ > forex │ - weight: 64 | ||
226 | × make the bed │ × clean shoes │ > close sg-pr | ||
227 | × 03: dentist │ × buy clothes │ × facewash | ||
228 | × integrate tsg │ × draw │ × groceries | ||
229 | │ │ | ||
230 | │ │ | ||
231 | WEEK 2 ------------- │ WEEK 2 ------------- │ WEEK 2 ------------- | ||
232 | │ │ | ||
233 | × latex setup │ - viral fever │ > close sg-pr | ||
234 | × send invoice │ × forex │ × plan meet | ||
235 | × stack-graph pr │ × activate sim │ × sg storage | ||
236 | │ × bitlbee │</code></pre> | ||
237 | <h3 id="reducing-friction">Reducing friction</h3> | ||
238 | <p>Journaling already requires a solid amount of discipline and | ||
239 | consistency. The added friction of typing | ||
240 | <code>vim journal/$CURRENT_YEAR/$CURRENT_MONTH</code> each time is doing | ||
241 | no favors.</p> | ||
242 | <p>To open the current month based on system time:</p> | ||
243 | <div class="sourceCode" id="cb21"><pre | ||
244 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="ex">λ</span> vim <span class="va">$(</span><span class="fu">date</span> +<span class="st">"%Y/%m"</span><span class="va">)</span></span></code></pre></div> | ||
245 | <p>To open all the months within a 2 month window of today, is a little | ||
246 | trickier. The command we wish to generate is (if today is 2023/12):</p> | ||
247 | <div class="sourceCode" id="cb22"><pre | ||
248 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="ex">λ</span> vim <span class="at">-O</span> 2023/10 2023/11 2023/12 2024/01 2024/02</span></code></pre></div> | ||
249 | <p>And that is where <code>dateseq</code> from <a | ||
250 | href="http://www.fresse.org/dateutils">dateutils</a> comes in handy, for | ||
251 | example:</p> | ||
252 | <div class="sourceCode" id="cb23"><pre | ||
253 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="ex">λ</span> dateseq 2012-02-01 2012-03-01</span> | ||
254 | <span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a><span class="ex">2012-02-01</span></span> | ||
255 | <span id="cb23-3"><a href="#cb23-3" aria-hidden="true" tabindex="-1"></a><span class="ex">2012-02-02</span></span> | ||
256 | <span id="cb23-4"><a href="#cb23-4" aria-hidden="true" tabindex="-1"></a><span class="ex">2012-02-03</span></span> | ||
257 | <span id="cb23-5"><a href="#cb23-5" aria-hidden="true" tabindex="-1"></a><span class="ex">...</span></span> | ||
258 | <span id="cb23-6"><a href="#cb23-6" aria-hidden="true" tabindex="-1"></a><span class="ex">2012-02-28</span></span> | ||
259 | <span id="cb23-7"><a href="#cb23-7" aria-hidden="true" tabindex="-1"></a><span class="ex">2012-02-29</span></span> | ||
260 | <span id="cb23-8"><a href="#cb23-8" aria-hidden="true" tabindex="-1"></a><span class="ex">2012-03-01</span></span></code></pre></div> | ||
261 | <p>This script opens all months within a 2 month window of today:</p> | ||
262 | <div class="sourceCode" id="cb24"><pre | ||
263 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="ex">λ</span> vim <span class="at">-O</span> <span class="va">$(</span></span> | ||
264 | <span id="cb24-2"><a href="#cb24-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">dateseq</span> <span class="dt">\</span></span> | ||
265 | <span id="cb24-3"><a href="#cb24-3" aria-hidden="true" tabindex="-1"></a> <span class="st">"</span><span class="va">$(</span><span class="fu">date</span> <span class="at">--date</span> <span class="st">"2 months ago"</span> +%Y/%m<span class="va">)</span><span class="st">"</span> <span class="dt">\</span></span> | ||
266 | <span id="cb24-4"><a href="#cb24-4" aria-hidden="true" tabindex="-1"></a> <span class="st">"</span><span class="va">$(</span><span class="fu">date</span> <span class="at">--date</span> <span class="st">"2 months"</span> +%Y/%m<span class="va">)</span><span class="st">"</span> <span class="dt">\</span></span> | ||
267 | <span id="cb24-5"><a href="#cb24-5" aria-hidden="true" tabindex="-1"></a> <span class="at">-i</span> %Y/%m <span class="dt">\</span></span> | ||
268 | <span id="cb24-6"><a href="#cb24-6" aria-hidden="true" tabindex="-1"></a> <span class="at">-f</span> %Y/%m</span> | ||
269 | <span id="cb24-7"><a href="#cb24-7" aria-hidden="true" tabindex="-1"></a><span class="va">)</span></span></code></pre></div> | ||
270 | <h3 id="fin">Fin</h3> | ||
271 | <p>You can find a sample vimrc file here: <a | ||
272 | href="https://git.peppe.rs/cli/journal/tree">cli/journal</a>, along with | ||
273 | a nix flake file to kick things off.</p> | ||
274 | <p>Plain text journaling can be just as much fun as a pen and paper. | ||
275 | Throw in some ASCII art for each month, use swankier signifiers, or | ||
276 | louder syntax highlighting. Don’t expect forgiveness from org-mode users | ||
277 | though.</p> | ||
278 | <p><a href="https://u.peppe.rs/ZCK.png"><img | ||
279 | src="https://u.peppe.rs/ZCK.png" /></a></p> | ||
280 | |||
281 | </div> | ||
282 | |||
283 | <div class="intro"> | ||
284 | Hi. | ||
285 | <div class="hot-links"> | ||
286 | <a href="https://peppe.rs/index.xml" class="feed-button">Subscribe</a> | ||
287 | </div> | ||
288 | <p>I'm Akshay, programmer and pixel-artist.</p> | ||
289 | <p> | ||
290 | I write <a href="https://git.peppe.rs">open-source stuff</a> to pass time. | ||
291 | I also design fonts: | ||
292 | <a href="https://git.peppe.rs/fonts/scientifica/about">scientifica</a>, | ||
293 | <a href="https://git.peppe.rs/fonts/curie/about">curie</a>. | ||
294 | </p> | ||
295 | <p>Send me a mail at [email protected] or a message at [email protected].</p> | ||
296 | </div> | ||
297 | |||
298 | <a href="/" class="post-end-link">Home</a> | ||
299 | <span>/</span> | ||
300 | <a href="/posts" class="post-end-link">Posts</a> | ||
301 | <span>/</span> | ||
302 | <a class="post-end-link">Plain Text Journaling</a> | ||
303 | <a class="stats post-end-link" href="https://git.peppe.rs/web/site/plain/posts/plain_text_journaling.md | ||
304 | ">View Raw</a> | ||
305 | </div> | ||
306 | </div> | ||
307 | </body> | ||
308 | </html> | ||