aboutsummaryrefslogtreecommitdiff
path: root/docs/index.xml
diff options
context:
space:
mode:
Diffstat (limited to 'docs/index.xml')
-rw-r--r--docs/index.xml77
1 files changed, 75 insertions, 2 deletions
diff --git a/docs/index.xml b/docs/index.xml
index eb43379..046b4d2 100644
--- a/docs/index.xml
+++ b/docs/index.xml
@@ -12,6 +12,79 @@
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>Snip Snap</title>
16<description>&lt;p&gt;I regularly switch between exactly two things while working, a
17“current” and an “alternate” item; a lot of tools I use seem to support
18this flow.&lt;/p&gt;
19&lt;h4 id="git"&gt;git&lt;/h4&gt;
20&lt;p&gt;Pass &lt;code&gt;-&lt;/code&gt; to &lt;code&gt;git-checkout&lt;/code&gt; to switch to the
21previously active branch:&lt;/p&gt;
22&lt;div class="sourceCode" id="cb1"&gt;&lt;pre
23class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb1-1"&gt;&lt;a href="#cb1-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; git branch&lt;/span&gt;
24&lt;span id="cb1-2"&gt;&lt;a href="#cb1-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;*&lt;/span&gt; foo&lt;/span&gt;
25&lt;span id="cb1-3"&gt;&lt;a href="#cb1-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt; &lt;span class="ex"&gt;bar&lt;/span&gt;&lt;/span&gt;
26&lt;span id="cb1-4"&gt;&lt;a href="#cb1-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;/span&gt;
27&lt;span id="cb1-5"&gt;&lt;a href="#cb1-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; git checkout bar&lt;/span&gt;
28&lt;span id="cb1-6"&gt;&lt;a href="#cb1-6" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; git branch&lt;/span&gt;
29&lt;span id="cb1-7"&gt;&lt;a href="#cb1-7" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt; &lt;span class="ex"&gt;foo&lt;/span&gt;&lt;/span&gt;
30&lt;span id="cb1-8"&gt;&lt;a href="#cb1-8" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;*&lt;/span&gt; bar&lt;/span&gt;
31&lt;span id="cb1-9"&gt;&lt;a href="#cb1-9" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;/span&gt;
32&lt;span id="cb1-10"&gt;&lt;a href="#cb1-10" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; git checkout &lt;span class="at"&gt;-&lt;/span&gt;&lt;/span&gt;
33&lt;span id="cb1-11"&gt;&lt;a href="#cb1-11" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; git branch&lt;/span&gt;
34&lt;span id="cb1-12"&gt;&lt;a href="#cb1-12" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;*&lt;/span&gt; foo&lt;/span&gt;
35&lt;span id="cb1-13"&gt;&lt;a href="#cb1-13" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt; &lt;span class="ex"&gt;bar&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
36&lt;h4 id="bash---cd"&gt;bash - cd&lt;/h4&gt;
37&lt;p&gt;This may not be exclusive to &lt;code&gt;bash&lt;/code&gt;:&lt;/p&gt;
38&lt;div class="sourceCode" id="cb2"&gt;&lt;pre
39class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb2-1"&gt;&lt;a href="#cb2-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;~/foo&lt;/span&gt; $ cd ~/bar&lt;/span&gt;
40&lt;span id="cb2-2"&gt;&lt;a href="#cb2-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;~/bar&lt;/span&gt; $ cd &lt;span class="at"&gt;-&lt;/span&gt;&lt;/span&gt;
41&lt;span id="cb2-3"&gt;&lt;a href="#cb2-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;~/foo&lt;/span&gt; $&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
42&lt;p&gt;This is especially handy in combination with my &lt;a
43href="../curing_a_case_of_git-UX/"&gt;git-worktree flow&lt;/a&gt;:&lt;/p&gt;
44&lt;div class="sourceCode" id="cb3"&gt;&lt;pre
45class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb3-1"&gt;&lt;a href="#cb3-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;~/main-branch&lt;/span&gt; $ gwj feature&lt;/span&gt;
46&lt;span id="cb3-2"&gt;&lt;a href="#cb3-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;~/feat-branch&lt;/span&gt; $ cd &lt;span class="at"&gt;-&lt;/span&gt;&lt;/span&gt;
47&lt;span id="cb3-3"&gt;&lt;a href="#cb3-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;~/main-branch&lt;/span&gt; $&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
48&lt;h4 id="bash---jobs"&gt;bash - jobs&lt;/h4&gt;
49&lt;p&gt;I often suspend multiple &lt;code&gt;vim&lt;/code&gt; sessions with
50&lt;code&gt;Ctrl-Z&lt;/code&gt;:&lt;/p&gt;
51&lt;div class="sourceCode" id="cb4"&gt;&lt;pre
52class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb4-1"&gt;&lt;a href="#cb4-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; jobs&lt;/span&gt;
53&lt;span id="cb4-2"&gt;&lt;a href="#cb4-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;[1]+&lt;/span&gt; Stopped vim transpiler/src/transform.rs&lt;/span&gt;
54&lt;span id="cb4-3"&gt;&lt;a href="#cb4-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;[2]-&lt;/span&gt; Stopped git commit &lt;span class="at"&gt;--verbose&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
55&lt;p&gt;In the above example: I suspended &lt;code&gt;vim&lt;/code&gt; when working on
56&lt;code&gt;transform.rs&lt;/code&gt;, and then began working on a commit by running
57&lt;code&gt;git commit&lt;/code&gt; without a message flag (lets you craft a message
58in &lt;code&gt;$EDITOR&lt;/code&gt;). To bring the current job to the foreground,
59you can use &lt;code&gt;fg&lt;/code&gt;:&lt;/p&gt;
60&lt;div class="sourceCode" id="cb5"&gt;&lt;pre
61class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb5-1"&gt;&lt;a href="#cb5-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; fg&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
62&lt;p&gt;With a job identifier:&lt;/p&gt;
63&lt;div class="sourceCode" id="cb6"&gt;&lt;pre
64class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb6-1"&gt;&lt;a href="#cb6-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; fg %2 &lt;span class="co"&gt;# resumes interactive git commit&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
65&lt;p&gt;Or switch to “last” job, or the second-most-recently-resumed job:&lt;/p&gt;
66&lt;div class="sourceCode" id="cb7"&gt;&lt;pre
67class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb7-1"&gt;&lt;a href="#cb7-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; fg %-&lt;/span&gt;
68&lt;span id="cb7-2"&gt;&lt;a href="#cb7-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; %- &lt;span class="co"&gt;# shorthand&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
69&lt;h4 id="vim"&gt;vim&lt;/h4&gt;
70&lt;p&gt;Switch to the last active buffer with &lt;code&gt;Ctrl+^&lt;/code&gt;. In
71command-mode, &lt;code&gt;#&lt;/code&gt; refers to the last active buffer, you can
72use this as an argument to a few commands:&lt;/p&gt;
73&lt;pre class="vimscript"&gt;&lt;code&gt;:b# &amp;quot; switch to alternate buffer (same as Ctrl+^)
74:vsp# &amp;quot; create a vertical split with the alternate buffer
75:read# &amp;quot; read contents of alternate buffer into current buffer
76:!wc # &amp;quot; pass file name of alternate buffer to the command `wc`&lt;/code&gt;&lt;/pre&gt;
77&lt;p&gt;See &lt;code&gt;:help c_#&lt;/code&gt; for more.&lt;/p&gt;
78&lt;h4 id="tmux"&gt;tmux&lt;/h4&gt;
79&lt;p&gt;Switch to the last active tmux session with
80&lt;code&gt;&amp;lt;prefix&amp;gt;+shift+L&lt;/code&gt;.&lt;/p&gt;
81&lt;h4 id="qutebrowser"&gt;qutebrowser&lt;/h4&gt;
82&lt;p&gt;Switch to the last active tab with &lt;code&gt;g$&lt;/code&gt;.&lt;/p&gt;</description>
83<link>https://peppe.rs/posts/snip_snap/</link>
84<pubDate>Wed, 08 May 2024 10:38:00 +0000</pubDate>
85<guid>https://peppe.rs/posts/snip_snap/</guid>
86</item>
87<item>
15<title>Plain Text Journaling</title> 88<title>Plain Text Journaling</title>
16<description>&lt;p&gt;I cobbled together a journaling system with {neo,}vim, coreutils and 89<description>&lt;p&gt;I cobbled together a journaling system with {neo,}vim, coreutils and
17&lt;a href="http://www.fresse.org/dateutils"&gt;dateutils&lt;/a&gt;. This system is 90&lt;a href="http://www.fresse.org/dateutils"&gt;dateutils&lt;/a&gt;. This system is
@@ -1014,10 +1087,10 @@ class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb20
1014your dependencies:&lt;/p&gt; 1087your dependencies:&lt;/p&gt;
1015&lt;div class="sourceCode" id="cb21"&gt;&lt;pre 1088&lt;div class="sourceCode" id="cb21"&gt;&lt;pre
1016class="sourceCode toml"&gt;&lt;code class="sourceCode toml"&gt;&lt;span id="cb21-1"&gt;&lt;a href="#cb21-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;# within Cargo.toml&lt;/span&gt;&lt;/span&gt; 1089class="sourceCode toml"&gt;&lt;code class="sourceCode toml"&gt;&lt;span id="cb21-1"&gt;&lt;a href="#cb21-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;# within Cargo.toml&lt;/span&gt;&lt;/span&gt;
1017&lt;span id="cb21-2"&gt;&lt;a href="#cb21-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="kw"&gt;[&lt;/span&gt;&lt;span class="dt"&gt;dependencies&lt;/span&gt;&lt;span class="kw"&gt;]&lt;/span&gt;&lt;/span&gt; 1090&lt;span id="cb21-2"&gt;&lt;a href="#cb21-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="kw"&gt;[dependencies]&lt;/span&gt;&lt;/span&gt;
1018&lt;span id="cb21-3"&gt;&lt;a href="#cb21-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="dt"&gt;tree-sitter&lt;/span&gt; &lt;span class="op"&gt;=&lt;/span&gt; &lt;span class="st"&gt;&amp;quot;0.20&amp;quot;&lt;/span&gt;&lt;/span&gt; 1091&lt;span id="cb21-3"&gt;&lt;a href="#cb21-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="dt"&gt;tree-sitter&lt;/span&gt; &lt;span class="op"&gt;=&lt;/span&gt; &lt;span class="st"&gt;&amp;quot;0.20&amp;quot;&lt;/span&gt;&lt;/span&gt;
1019&lt;span id="cb21-4"&gt;&lt;a href="#cb21-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;/span&gt; 1092&lt;span id="cb21-4"&gt;&lt;a href="#cb21-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;/span&gt;
1020&lt;span id="cb21-5"&gt;&lt;a href="#cb21-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="kw"&gt;[&lt;/span&gt;&lt;span class="dt"&gt;dependencies&lt;/span&gt;&lt;span class="kw"&gt;.&lt;/span&gt;&lt;span class="dt"&gt;tree-sitter-rust&lt;/span&gt;&lt;span class="kw"&gt;]&lt;/span&gt;&lt;/span&gt; 1093&lt;span id="cb21-5"&gt;&lt;a href="#cb21-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="kw"&gt;[dependencies.tree-sitter-rust]&lt;/span&gt;&lt;/span&gt;
1021&lt;span id="cb21-6"&gt;&lt;a href="#cb21-6" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="dt"&gt;git&lt;/span&gt; &lt;span class="op"&gt;=&lt;/span&gt; &lt;span class="st"&gt;&amp;quot;https://github.com/tree-sitter/tree-sitter-rust&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; 1094&lt;span id="cb21-6"&gt;&lt;a href="#cb21-6" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="dt"&gt;git&lt;/span&gt; &lt;span class="op"&gt;=&lt;/span&gt; &lt;span class="st"&gt;&amp;quot;https://github.com/tree-sitter/tree-sitter-rust&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
1022&lt;p&gt;Let’s load in some Rust code to work with. As &lt;a 1095&lt;p&gt;Let’s load in some Rust code to work with. As &lt;a
1023href="https://en.wikipedia.org/wiki/Self-reference"&gt;an ode to Gödel&lt;/a&gt; 1096href="https://en.wikipedia.org/wiki/Self-reference"&gt;an ode to Gödel&lt;/a&gt;