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