<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://lizard-heart.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://lizard-heart.github.io/" rel="alternate" type="text/html" /><updated>2026-07-16T05:31:40+00:00</updated><id>https://lizard-heart.github.io/feed.xml</id><title type="html">Henry’s Site</title><subtitle></subtitle><author><name>Henry Gustafson</name><email>hgustafson@protonmail.com</email></author><entry><title type="html">Atom package for bunch syntax published</title><link href="https://lizard-heart.github.io/coding/project/2022/03/20/bunch.html" rel="alternate" type="text/html" title="Atom package for bunch syntax published" /><published>2022-03-20T19:00:00+00:00</published><updated>2022-03-20T19:00:00+00:00</updated><id>https://lizard-heart.github.io/coding/project/2022/03/20/bunch</id><content type="html" xml:base="https://lizard-heart.github.io/coding/project/2022/03/20/bunch.html"><![CDATA[<p><a href="https://bunchapp.co">Bunch</a> is a Mac app that allows you to create plaintext files to launch a “bunch” of apps and change system settings. It is great for <a href="https://en.wikipedia.org/wiki/Context_awareness">contextual computing</a> and I use it to automatically rearrange windows with <a href="http://www.hammerspoon.org">hammerspoon</a>, set a Focus Mode with Shortcuts, open a perspective in <a href="https://www.omnigroup.com/omnifocus/">Omnifocus</a>, and start a timer with <a href="https://timeryapp.com">Timery</a> all at the same time when I switch contexts. The only problem is that it is a little bit annoying to edit these plaintext files without any syntax highlighting to see commands and strings and stuff like that.</p>

<p>To fix this, I created a plugin for my favorite text editor, <a href="https://atom.io">atom</a> (I’m using it right now as I write this), which adds support for <code class="language-plaintext highlighter-rouge">.bunch</code> files. It also includes. snippets for common commands.</p>

<h1 id="install-the-plugin-here"><a href="https://atom.io/packages/language-bunch">install the plugin here</a></h1>
<h1 id="contribute-to-the-plugin-on-github"><a href="https://github.com/lizard-heart/language-bunch">contribute to the plugin on github</a></h1>

<h2 id="creating-atom-language-plugins">Creating atom language plugins</h2>
<p>I created this plugin as a treesitter language plugin for atom. It has a very simple file structure:</p>

<figure class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="s">language-bunch</span>
<span class="s">├── LICENSE</span>
<span class="s">├── README.md</span>
<span class="s">├── grammars</span>
<span class="s">│   └── bunch.cson</span>
<span class="s">├── snippets</span>
<span class="s">│   └── bunch.cson</span>
<span class="s">└── package.json</span></code></pre></figure>

<h3 id="syntax-highlighting">Syntax highlighting</h3>
<p>The <code class="language-plaintext highlighter-rouge">grammars/bunch.cson</code> file has a <code class="language-plaintext highlighter-rouge">patterns</code> field that lets you patch <a href="https://en.wikipedia.org/wiki/Regular_expression">regex</a> patterns, and tell Atom what the text represents, a string, a variable, a command, etc. For example, here is the code to match comments in <code class="language-plaintext highlighter-rouge">.bunch</code> files.</p>

<figure class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="pi">{</span>
    <span class="nv">name</span><span class="pi">:</span> <span class="s1">'</span><span class="s">comment.line.bunch'</span>
    <span class="nv">match</span><span class="pi">:</span> <span class="s1">'</span><span class="s">#.*$'</span>
<span class="pi">}</span></code></pre></figure>

<h3 id="snippets">Snippets</h3>
<p>Then, in the <code class="language-plaintext highlighter-rouge">snippets/bunch.cson</code> file, you can list a “prefix” and a “body” to show autocomplete suggestions for common commands. For example, here are a few commands I use for bunch files.</p>

<figure class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="s1">'</span><span class="s">display'</span><span class="err">:</span>
    <span class="s1">'</span><span class="s">prefix'</span><span class="err">:</span> <span class="s1">'</span><span class="s">di'</span>
    <span class="s1">'</span><span class="s">body'</span><span class="err">:</span> <span class="s1">'</span><span class="s">display</span><span class="nv"> </span><span class="s">'</span>
<span class="s1">'</span><span class="s">dark</span><span class="nv"> </span><span class="s">mode'</span><span class="err">:</span>
    <span class="s1">'</span><span class="s">prefix'</span><span class="err">:</span> <span class="s1">'</span><span class="s">da'</span>
    <span class="s1">'</span><span class="s">body'</span><span class="err">:</span> <span class="s1">'</span><span class="s">dark</span><span class="nv"> </span><span class="s">mode'</span>
<span class="s1">'</span><span class="s">light</span><span class="nv"> </span><span class="s">mode'</span><span class="err">:</span>
    <span class="s1">'</span><span class="s">prefix'</span><span class="err">:</span> <span class="s1">'</span><span class="s">li'</span>
    <span class="s1">'</span><span class="s">body'</span><span class="err">:</span> <span class="s1">'</span><span class="s">light</span><span class="nv"> </span><span class="s">mode'</span>
<span class="s1">'</span><span class="s">wallpaper'</span><span class="err">:</span>
    <span class="s1">'</span><span class="s">prefix'</span><span class="err">:</span> <span class="s1">'</span><span class="s">wal'</span>
    <span class="s1">'</span><span class="s">body'</span><span class="err">:</span> <span class="s1">'</span><span class="s">wallpaper'</span></code></pre></figure>]]></content><author><name>Henry Gustafson</name><email>hgustafson@protonmail.com</email></author><category term="coding" /><category term="project" /><summary type="html"><![CDATA[Bunch is a Mac app that allows you to create plaintext files to launch a “bunch” of apps and change system settings. It is great for contextual computing and I use it to automatically rearrange windows with hammerspoon, set a Focus Mode with Shortcuts, open a perspective in Omnifocus, and start a timer with Timery all at the same time when I switch contexts. The only problem is that it is a little bit annoying to edit these plaintext files without any syntax highlighting to see commands and strings and stuff like that.]]></summary></entry><entry><title type="html">This site is built on jekyll</title><link href="https://lizard-heart.github.io/jekyll/update/2021/08/31/jekyll.html" rel="alternate" type="text/html" title="This site is built on jekyll" /><published>2021-08-31T04:25:09+00:00</published><updated>2021-08-31T04:25:09+00:00</updated><id>https://lizard-heart.github.io/jekyll/update/2021/08/31/jekyll</id><content type="html" xml:base="https://lizard-heart.github.io/jekyll/update/2021/08/31/jekyll.html"><![CDATA[<h2 id="here-is-how-it-works">Here is how it works</h2>

<p>You’ll find this post in your <code class="language-plaintext highlighter-rouge">_posts</code> directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run <code class="language-plaintext highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>

<p>Jekyll requires blog post files to be named according to the following format:</p>

<p><code class="language-plaintext highlighter-rouge">YEAR-MONTH-DAY-title.MARKUP</code></p>

<p>Where <code class="language-plaintext highlighter-rouge">YEAR</code> is a four-digit number, <code class="language-plaintext highlighter-rouge">MONTH</code> and <code class="language-plaintext highlighter-rouge">DAY</code> are both two-digit numbers, and <code class="language-plaintext highlighter-rouge">MARKUP</code> is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.</p>

<p>Jekyll also offers powerful support for code snippets:</p>

<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
  <span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
<span class="c1">#=&gt; prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>

<p>Check out the <a href="https://jekyllrb.com/docs/home">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/jekyll/jekyll">Jekyll’s GitHub repo</a>. If you have questions, you can ask them on <a href="https://talk.jekyllrb.com/">Jekyll Talk</a>.</p>]]></content><author><name>Henry Gustafson</name><email>hgustafson@protonmail.com</email></author><category term="jekyll" /><category term="update" /><summary type="html"><![CDATA[Here is how it works]]></summary></entry></feed>