added descriptions to all posts
This commit is contained in:
parent
0ee8ca6e5c
commit
5cda6c844e
16 changed files with 155 additions and 143 deletions
|
@ -2,9 +2,11 @@
|
||||||
title: How I'm Surviving The AI Programming Epidemic
|
title: How I'm Surviving The AI Programming Epidemic
|
||||||
date: Wed 09 Jul 2025
|
date: Wed 09 Jul 2025
|
||||||
draft: true
|
draft: true
|
||||||
|
description: |
|
||||||
|
My thoughts on AI programming, and my self-imposed rules and workflow when it comes
|
||||||
|
to AI integration.
|
||||||
---
|
---
|
||||||
|
|
||||||
This post should cover my thoughts about AI assisted programming,
|
This post should cover my thoughts about AI assisted programming, vibe-coding,
|
||||||
vibe-coding, and my personal rules and workflow when it comes to AI
|
and my personal rules and workflow when it comes to AI integration to keep
|
||||||
integration to keep myself from becoming reliant on it and to help myself
|
myself from becoming reliant on it and to help myself keep learning.
|
||||||
keep learning.
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
title: angels and wires
|
title: angels and wires
|
||||||
date: 2025-07-16
|
date: 2025-07-16
|
||||||
|
description: A poem about technology. And mushrooms.
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="image-container">
|
<div class="image-container">
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
title: Building My Own Static Site Generator
|
title: Building My Own Static Site Generator
|
||||||
date: 2025-07-10
|
date: 2025-07-10
|
||||||
draft: true
|
draft: true
|
||||||
|
description: |
|
||||||
|
An overview of static site generators and my experience of developing Zona.
|
||||||
---
|
---
|
||||||
|
|
||||||
*[SSG]: Static Site Generator
|
*[SSG]: Static Site Generator
|
||||||
|
@ -17,75 +19,73 @@ draft: true
|
||||||
|
|
||||||
[^jd]: [jdugan6240.dev](https://jdugan6240.dev/posts/custom_site_generator.html#why)
|
[^jd]: [jdugan6240.dev](https://jdugan6240.dev/posts/custom_site_generator.html#why)
|
||||||
|
|
||||||
[^long-sentence]: I disabled the "long sentences" linter in my grammar
|
[^long-sentence]: I disabled the "long sentences" linter in my grammar checker.
|
||||||
checker. Take that for being unapologetic!
|
Take that for being unapologetic!
|
||||||
|
|
||||||
[^small-web]: The "small web" is a way to collectively refer to
|
[^small-web]: The "small web" is a way to collectively refer to independent,
|
||||||
independent, home-made, personal websites --- often with a focus on
|
home-made, personal websites --- often with a focus on creativity,
|
||||||
creativity, anti-capitalism, and technology.
|
anti-capitalism, and technology.
|
||||||
|
|
||||||
Those of us in the open-source world tend to be very _passionate_ about
|
Those of us in the open-source world tend to be very _passionate_ about what we
|
||||||
what we do — and passion often manifests itself in _blogging_. Rolling
|
do — and passion often manifests itself in _blogging_. Rolling your own blogging
|
||||||
your own blogging setup seems to be a rite of passage. It's a project of
|
setup seems to be a rite of passage. It's a project of moderate complexity, fun,
|
||||||
moderate complexity, fun, and not particularly time-consuming.
|
and not particularly time-consuming.
|
||||||
|
|
||||||
Personal websites and blogs are very... personal. Why not maximize the
|
Personal websites and blogs are very... personal. Why not maximize the control
|
||||||
control we have over them? Many of the programmers I respect publish blogs
|
we have over them? Many of the programmers I respect publish blogs using a
|
||||||
using a [homebrewed] SSG. I figured it was time to join them!
|
[homebrewed] SSG. I figured it was time to join them!
|
||||||
|
|
||||||
This article is about how (and why) I built [zona], the SSG that built and
|
This article is about how (and why) I built [zona], the SSG that built and
|
||||||
rendered the blog post you're reading. Without any further ado, let's get
|
rendered the blog post you're reading. Without any further ado, let's get into
|
||||||
into it!
|
it!
|
||||||
|
|
||||||
[TOC]
|
[TOC]
|
||||||
|
|
||||||
## Zonelets & Zoner
|
## Zonelets & Zoner
|
||||||
|
|
||||||
I don't remember how I found out about the small web,[^small-web], but I
|
I don't remember how I found out about the small web,[^small-web], but I _do_
|
||||||
_do_ recall how it immediately sparked something in me. As an autist with
|
recall how it immediately sparked something in me. As an autist with very
|
||||||
very particular interests that's always struggled to fit in, the premise
|
particular interests that's always struggled to fit in, the premise of having my
|
||||||
of having my very own corner of the internet where I could
|
very own corner of the internet where I could unapologetically be myself without
|
||||||
unapologetically be myself without fear of retribution from rude
|
fear of retribution from rude social-media commenters or being subject to the
|
||||||
social-media commenters or being subject to the whims of some grumpy
|
whims of some grumpy content moderator was _very_ appealing to me.[^long-sentence]
|
||||||
content moderator was _very_ appealing to me.[^long-sentence]
|
|
||||||
|
|
||||||
## Reinventing The Wheel
|
## Reinventing The Wheel
|
||||||
|
|
||||||
There's no shortage of excellent SSG tools out there. [Hugo] is fast,
|
There's no shortage of excellent SSG tools out there. [Hugo] is fast,
|
||||||
configurable, and very popular. [Jekyll] is the default on GitHub pages,
|
configurable, and very popular. [Jekyll] is the default on GitHub pages, which
|
||||||
which makes it _(I'm guessing)_ the most commonly-used SSG by a long shot.
|
makes it _(I'm guessing)_ the most commonly-used SSG by a long shot. [Zola] is
|
||||||
[Zola] is tiny, dependency free, and _very_ flexible.
|
tiny, dependency free, and _very_ flexible.
|
||||||
|
|
||||||
You can certainly build some awesome blogs with these tools, and customize
|
You can certainly build some awesome blogs with these tools, and customize them
|
||||||
them as much as you want. For example, my friend Alisa uses [Zola] to
|
as much as you want. For example, my friend Alisa uses [Zola] to publish
|
||||||
publish [her blog](https://axlefublr.github.io/), which is a great example
|
[her blog](https://axlefublr.github.io/), which is a great example of how a
|
||||||
of how a minimal website can truly shine with the right styling and
|
minimal website can truly shine with the right styling and customization.
|
||||||
customization.
|
|
||||||
|
|
||||||
So: if there's such an abundance of great static site generators, why did
|
So: if there's such an abundance of great static site generators, why did I
|
||||||
I write my own? JD[^jd], a fellow Kakoune enjoyer, puts it well:
|
write my own? JD[^jd], a fellow Kakoune enjoyer, puts it well:
|
||||||
|
|
||||||
> 1. It's a good learning experience \[...\]
|
> 1. It's a good learning experience \[...\]
|
||||||
> 2. Many static site generators are complex and take time to learn to
|
> 2. Many static site generators are complex and take time to learn to configure
|
||||||
> configure \[...\]
|
> \[...\]
|
||||||
> 3. A custom solution grants complete control over how exactly the site
|
> 3. A custom solution grants complete control over how exactly the site is
|
||||||
> is generated \[...\]
|
> generated \[...\]
|
||||||
|
|
||||||
My main motivation for starting work on [zona] was the third point:
|
My main motivation for starting work on [zona] was the third point: **complete
|
||||||
**complete control**. I don't think being a control freak makes me an
|
control**. I don't think being a control freak makes me an outlier among Linux
|
||||||
outlier among Linux users — why else would we be breaking our operating
|
users — why else would we be breaking our operating system near-daily, if not
|
||||||
system near-daily, if not for some obsessive customization?
|
for some obsessive customization?
|
||||||
|
|
||||||
It's happened very often that I find some tool I like, and during the
|
It's happened very often that I find some tool I like, and during the process of
|
||||||
process of tweaking it, I find _something_ that can't be changed --- which
|
tweaking it, I find _something_ that can't be changed --- which ends up
|
||||||
ends up bothering me immensely. I figured that I'd rather avoid this
|
bothering me immensely. I figured that I'd rather avoid this experience while
|
||||||
experience while writing my own blog. This way, if something is missing,
|
writing my own blog. This way, if something is missing, it's my fault, and no
|
||||||
it's my fault, and no one else's.
|
one else's.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
The features I implemented in [zona] are informed by what I want from my
|
The features I implemented in [zona] are informed by what I want from my own
|
||||||
own blog. The primary user is myself, after all! I knew I wanted:
|
blog. The primary user is myself, after all! I knew I wanted:
|
||||||
|
|
||||||
- Writing in Markdown with as little embedded HTML as possible.
|
- Writing in Markdown with as little embedded HTML as possible.
|
||||||
- A convenient live preview.
|
- A convenient live preview.
|
||||||
|
@ -96,6 +96,6 @@ own blog. The primary user is myself, after all! I knew I wanted:
|
||||||
|
|
||||||
## Snakes Eating Gophers: A Valiant First Attempt
|
## Snakes Eating Gophers: A Valiant First Attempt
|
||||||
|
|
||||||
I started work on [zona] in October, 2024. At this point, I had written a
|
I started work on [zona] in October, 2024. At this point, I had written a few
|
||||||
few (smaller) projects in Go, and I wanted to work on something more
|
(smaller) projects in Go, and I wanted to work on something more complicated to
|
||||||
complicated to learn the language better.
|
learn the language better.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
title: Building This Site
|
title: Building This Site
|
||||||
date: 2025-04-10
|
date: 2025-04-10
|
||||||
|
description: Short post about why I'm publishing this website.
|
||||||
---
|
---
|
||||||
|
|
||||||
I care about thoughtful design, and forcing your visitors to download dozens of
|
I care about thoughtful design, and forcing your visitors to download dozens of
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
---
|
---
|
||||||
title: Email Formatting Is Harder Than It Looks
|
title: Email Formatting Is Harder Than It Looks
|
||||||
date: 2025-07-14
|
date: 2025-07-14
|
||||||
|
description: |
|
||||||
|
A detailed overview of plain-text email formatting, what makes it deceptively
|
||||||
|
hard, and how I wrote mailfmt.
|
||||||
---
|
---
|
||||||
|
|
||||||
*[UTF-8]: Unicode Transformation Format – 8 bit. Text encoding standard.
|
*[UTF-8]: Unicode Transformation Format – 8 bit. Text encoding standard.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
title: Writing Emails In Helix
|
title: Writing Emails In Helix
|
||||||
date: 2025-05-29
|
date: 2025-05-29
|
||||||
|
description: Tutorial on configuring Helix for email composition.
|
||||||
---
|
---
|
||||||
|
|
||||||
This article is all about writing emails in Helix. Obviously, Helix isn't an
|
This article is all about writing emails in Helix. Obviously, Helix isn't an
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
---
|
---
|
||||||
title: Writing Emails In Kakoune
|
title: Writing Emails In Kakoune
|
||||||
date: 2025-06-01
|
date: 2025-06-01
|
||||||
|
description: Tutorial on configuring Kakoune for email reading & composition.
|
||||||
---
|
---
|
||||||
|
|
||||||
This post will guide you through my setup for using Kakoune as an email
|
This post will guide you through my setup for using Kakoune as an email composer
|
||||||
composer inside `aerc`. I'll also explain how to configure Kakoune to act
|
inside `aerc`. I'll also explain how to configure Kakoune to act as the _pager_
|
||||||
as the _pager_ for reading `text/plain` emails. If you only care about the
|
for reading `text/plain` emails. If you only care about the final config, feel
|
||||||
final config, feel free to skip to it [here](#final-configuration).
|
free to skip to it [here](#final-configuration).
|
||||||
|
|
||||||
[TOC]
|
[TOC]
|
||||||
|
|
||||||
## Naive Approach
|
## Naive Approach
|
||||||
|
|
||||||
Since `aerc` uses your `$EDITOR` for composition, you don't technically
|
Since `aerc` uses your `$EDITOR` for composition, you don't technically have to
|
||||||
have to do anything. I prefer setting it explicitly in `aerc.conf`, for
|
do anything. I prefer setting it explicitly in `aerc.conf`, for good measure:
|
||||||
good measure:
|
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[compose]
|
[compose]
|
||||||
|
@ -25,9 +25,8 @@ The rest of the magic happens in your `kakrc`.
|
||||||
|
|
||||||
## Composer Setup
|
## Composer Setup
|
||||||
|
|
||||||
Essentially, we want to hook `filetype=mail` and set our buffer
|
Essentially, we want to hook `filetype=mail` and set our buffer configuration
|
||||||
configuration there. I'll share a recommended configuration with some
|
there. I'll share a recommended configuration with some explanation.
|
||||||
explanation.
|
|
||||||
|
|
||||||
```kak
|
```kak
|
||||||
hook global WinSetOption filetype=mail %~
|
hook global WinSetOption filetype=mail %~
|
||||||
|
@ -42,53 +41,51 @@ hook global WinSetOption filetype=mail %~
|
||||||
~
|
~
|
||||||
```
|
```
|
||||||
|
|
||||||
I use a custom formatter to format emails. It automatically hard-wraps
|
I use a custom formatter to format emails. It automatically hard-wraps lines
|
||||||
lines while preserving certain markup elements, code blocks, sign-offs,
|
while preserving certain markup elements, code blocks, sign-offs, and signature
|
||||||
and signature blocks. For more details, check the formatting section of my
|
blocks. For more details, check the formatting section of my post on
|
||||||
post on [Helix](/blog/email/helix#formatting).
|
[Helix](/blog/email/helix#formatting).
|
||||||
|
|
||||||
I find that setting `>` as the `comment_line` token is convenient for
|
I find that setting `>` as the `comment_line` token is convenient for working
|
||||||
working with quotes in replies.
|
with quotes in replies.
|
||||||
|
|
||||||
The `try autospell-enable` enables my
|
The `try autospell-enable` enables my
|
||||||
[kak-autospell](https://codeberg.org/ficd/kak-autospell) plugin for the
|
[kak-autospell](https://codeberg.org/ficd/kak-autospell) plugin for the buffer.
|
||||||
buffer. Essentially, it provides spellchecking that's continuously
|
Essentially, it provides spellchecking that's continuously refreshed and hidden
|
||||||
refreshed and hidden in insert mode.
|
in insert mode.
|
||||||
|
|
||||||
The remaining commands configure auto-formatting on save. I always prefer
|
The remaining commands configure auto-formatting on save. I always prefer having
|
||||||
having this on so I never forget to format my message before sending it.
|
this on so I never forget to format my message before sending it.
|
||||||
|
|
||||||
## Reader Setup
|
## Reader Setup
|
||||||
|
|
||||||
I find that using Kakoune to **read** emails is helpful because of how
|
I find that using Kakoune to **read** emails is helpful because of how easy it
|
||||||
easy it is to copy quotes, open links, etc. Configuring this is a tad
|
is to copy quotes, open links, etc. Configuring this is a tad hackier, however.
|
||||||
hackier, however. The basic idea is to set Kakoune as the viewer `pager`
|
The basic idea is to set Kakoune as the viewer `pager` in `aerc.conf`.
|
||||||
in `aerc.conf`.
|
|
||||||
|
|
||||||
However, all this does is pipe the email to `kak` through standard input,
|
However, all this does is pipe the email to `kak` through standard input, so we
|
||||||
so we need to tell the editor to treat it like an email:
|
need to tell the editor to treat it like an email:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[viewer]
|
[viewer]
|
||||||
pager=kak -e 'set buffer filetype mail'
|
pager=kak -e 'set buffer filetype mail'
|
||||||
```
|
```
|
||||||
|
|
||||||
When you're using Kakoune as a pager, you'll probably want to configure
|
When you're using Kakoune as a pager, you'll probably want to configure some
|
||||||
some things differently. In my case, I like to set the buffer as
|
things differently. In my case, I like to set the buffer as `readonly`, remove
|
||||||
`readonly`, remove the `number-lines` and `show-whitespaces` highlighters,
|
the `number-lines` and `show-whitespaces` highlighters, disable soft-wrap & my
|
||||||
disable soft-wrap & my scrolloff settings, and _not_ set any formatters.
|
scrolloff settings, and _not_ set any formatters.
|
||||||
|
|
||||||
The `pager` command above sets the filetype, but we need to distinguish
|
The `pager` command above sets the filetype, but we need to distinguish between
|
||||||
between _composing_ and _reading_ in our Kakoune hook. When Kakoune is
|
_composing_ and _reading_ in our Kakoune hook. When Kakoune is opened with input
|
||||||
opened with input through standard input, it loads a buffer that's
|
through standard input, it loads a buffer that's conveniently named `*stdin*`.
|
||||||
conveniently named `*stdin*`. Thus, we can check the buffer name before
|
Thus, we can check the buffer name before continuing.
|
||||||
continuing.
|
|
||||||
|
|
||||||
If we're in "reading mode", we define a hidden command called
|
If we're in "reading mode", we define a hidden command called `ismailreader`
|
||||||
`ismailreader` which doesn't do anything. Why? If the command is defined,
|
which doesn't do anything. Why? If the command is defined, and we try to invoke
|
||||||
and we try to invoke it... well, nothing happens! But if it's **not**
|
it... well, nothing happens! But if it's **not** defined, we get an error
|
||||||
defined, we get an error instead. We can combine this with the `try`
|
instead. We can combine this with the `try` command to for some simple boolean
|
||||||
command to for some simple boolean logic.
|
logic.
|
||||||
|
|
||||||
```kak
|
```kak
|
||||||
evaluate-commands %sh{
|
evaluate-commands %sh{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
title: Implementing Kakoune Syntax Highlighting In Pygments
|
title: Implementing Kakoune Syntax Highlighting In Pygments
|
||||||
date: July 04, 2025
|
date: July 04, 2025
|
||||||
|
description: An account of my implementation of a Kakoune lexer in Pygments.
|
||||||
---
|
---
|
||||||
|
|
||||||
As a programmer, one thing I care about a _lot_ is syntax highlighting. In fact,
|
As a programmer, one thing I care about a _lot_ is syntax highlighting. In fact,
|
||||||
|
@ -108,4 +109,5 @@ own projects.
|
||||||
[Kakoune]: https://kakoune.org
|
[Kakoune]: https://kakoune.org
|
||||||
[Helix]: https://github.com/helix-editor/helix
|
[Helix]: https://github.com/helix-editor/helix
|
||||||
[Pygments]: https://pygments.org/
|
[Pygments]: https://pygments.org/
|
||||||
|
|
||||||
*[SSG]: Static Site Generator
|
*[SSG]: Static Site Generator
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
title: "Kakoune: Markdown Formatter Ignore"
|
title: "Kakoune: Markdown Formatter Ignore"
|
||||||
date: 2025-07-09
|
date: 2025-07-09
|
||||||
draft: true
|
draft: true
|
||||||
|
description: |
|
||||||
|
An account of Markdown formatter pre-processing. In Kakoune, just because.
|
||||||
---
|
---
|
||||||
|
|
||||||
This post about the markdown formatting mini-plugin I wrote which can
|
This post about the markdown formatting mini-plugin I wrote which can ignore
|
||||||
ignore block images by regex.
|
block images by regex.
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
---
|
---
|
||||||
title: Opening URLs In Kakoune
|
title: Opening URLs In Kakoune
|
||||||
date: 07 Jul 2025
|
date: 07 Jul 2025
|
||||||
|
description: |
|
||||||
|
A brief post about how I implemented URL opening in Kakoune.
|
||||||
---
|
---
|
||||||
|
|
||||||
[Kakoune]: https://kakoune.org
|
[Kakoune]: https://kakoune.org
|
||||||
|
|
||||||
One feature built into [Helix](https://docs.helix-editor.com/) is the
|
One feature built into [Helix](https://docs.helix-editor.com/) is the ability to
|
||||||
ability to super-easily open URLs in your browser. All you need to do is
|
super-easily open URLs in your browser. All you need to do is move your cursor
|
||||||
move your cursor over a URL, and press `gf`. This is _very_ helpful when
|
over a URL, and press `gf`. This is _very_ helpful when reading documentation,
|
||||||
reading documentation, emails, et cetera...
|
emails, et cetera...
|
||||||
|
|
||||||
So, how can we do this in [Kakoune]?
|
So, how can we do this in [Kakoune]?
|
||||||
|
|
||||||
|
@ -24,16 +26,15 @@ Here's our target user experience:
|
||||||
4. The user is notified of any errors or success.
|
4. The user is notified of any errors or success.
|
||||||
|
|
||||||
Like any bit of custom functionality, the best way to go is to define a
|
Like any bit of custom functionality, the best way to go is to define a
|
||||||
**command**. This gives us re-usability, and greater flexibility (since
|
**command**. This gives us re-usability, and greater flexibility (since `map`
|
||||||
`map` only allows mapping to _key sequences_, not any arbitrary string of
|
only allows mapping to _key sequences_, not any arbitrary string of commands).
|
||||||
commands).
|
|
||||||
|
|
||||||
## Selecting
|
## Selecting
|
||||||
|
|
||||||
First, we need to find the URL under the cursor. Of course, if there
|
First, we need to find the URL under the cursor. Of course, if there _isn't_
|
||||||
_isn't_ one, we should fail at this step. The standard way to do this in
|
one, we should fail at this step. The standard way to do this in Kakoune is by
|
||||||
Kakoune is by using a regular expression to filter the selection. If
|
using a regular expression to filter the selection. If there's no matches at
|
||||||
there's no matches at all, that's something we can `try/catch`.
|
all, that's something we can `try/catch`.
|
||||||
|
|
||||||
We won't get far without a URL regex. When I'm including long regexes in
|
We won't get far without a URL regex. When I'm including long regexes in
|
||||||
`#!kak execute-keys` commands, I like saving them to a register, like so:
|
`#!kak execute-keys` commands, I like saving them to a register, like so:
|
||||||
|
@ -42,24 +43,23 @@ We won't get far without a URL regex. When I'm including long regexes in
|
||||||
set-register b 'https?://(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)'
|
set-register b 'https?://(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)'
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, we just need to check if this regex exists around the user's cursor.
|
Then, we just need to check if this regex exists around the user's cursor. Since
|
||||||
Since URLs don't have spaces, we can select the surrounding `WORD`, and
|
URLs don't have spaces, we can select the surrounding `WORD`, and filter from
|
||||||
filter from there:
|
there:
|
||||||
|
|
||||||
```kak
|
```kak
|
||||||
execute-keys -draft '<a-a><a-w>s<c-r>b<ret>"ay'
|
execute-keys -draft '<a-a><a-w>s<c-r>b<ret>"ay'
|
||||||
```
|
```
|
||||||
|
|
||||||
The above command selects the outer `WORD`, then runs the select command
|
The above command selects the outer `WORD`, then runs the select command with
|
||||||
with our regex (stored in register `b`). Once the URL has been selected,
|
our regex (stored in register `b`). Once the URL has been selected, it's copied
|
||||||
it's copied to the `a` register. If there is no URL, the command fails.
|
to the `a` register. If there is no URL, the command fails.
|
||||||
|
|
||||||
## Cleaning
|
## Cleaning
|
||||||
|
|
||||||
It's usually better to allow regex to be a bit greedier, and then
|
It's usually better to allow regex to be a bit greedier, and then filter
|
||||||
filter unwanted characters out of the result. In our case, some
|
unwanted characters out of the result. In our case, some trailing punctuation is
|
||||||
trailing punctuation is included in the capture -- we can use `sed`
|
included in the capture -- we can use `sed` in a shell block to strip them.
|
||||||
in a shell block to strip them.
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
clean_url="$(echo "$kak_reg_a" | sed 's/[][(){}.,;!?]*$//')"
|
clean_url="$(echo "$kak_reg_a" | sed 's/[][(){}.,;!?]*$//')"
|
||||||
|
@ -67,37 +67,37 @@ clean_url="$(echo "$kak_reg_a" | sed 's/[][(){}.,;!?]*$//')"
|
||||||
|
|
||||||
## Opening
|
## Opening
|
||||||
|
|
||||||
Our next step is to figure out how we'd open a URL from the shell --
|
Our next step is to figure out how we'd open a URL from the shell -- after all,
|
||||||
after all, anything we implement in Kakoune ends up running shell
|
anything we implement in Kakoune ends up running shell commands! If you have
|
||||||
commands! If you have `xdg-open` available (part of the `xdg-utils`
|
`xdg-open` available (part of the `xdg-utils` package on Arch Linux), this is
|
||||||
package on Arch Linux), this is simple:
|
simple:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
xdg-open https://ficd.sh
|
xdg-open https://ficd.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
XDG handles figuring out the correct application to forward the URL to. If
|
XDG handles figuring out the correct application to forward the URL to. If your
|
||||||
your environment is set up properly, this is probably your default
|
environment is set up properly, this is probably your default browser. If you
|
||||||
browser. If you don't have (or don't want to use) `xdg-open`, most
|
don't have (or don't want to use) `xdg-open`, most browsers let you open URLs
|
||||||
browsers let you open URLs from the command line directly:
|
from the command line directly:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
firefox https://ficd.sh
|
firefox https://ficd.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Depending on the browser -- if you already have an open session, the link
|
Depending on the browser -- if you already have an open session, the link will
|
||||||
will be opened as a new tab in an existing window. Nice!
|
be opened as a new tab in an existing window. Nice!
|
||||||
|
|
||||||
Let's define an **option** which contains the shell command we'll
|
Let's define an **option** which contains the shell command we'll use to open
|
||||||
use to open the link:
|
the link:
|
||||||
|
|
||||||
```kak
|
```kak
|
||||||
# %s gets replaced with the URL
|
# %s gets replaced with the URL
|
||||||
declare-option str url_open_cmd 'xdg-open %s'
|
declare-option str url_open_cmd 'xdg-open %s'
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, in our shell block, we can substitute the cleaned URL into the `%s`
|
Then, in our shell block, we can substitute the cleaned URL into the `%s` format
|
||||||
format specifier, and evaluate the resulting string as a command:
|
specifier, and evaluate the resulting string as a command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
if eval "$(printf "$kak_opt_url_open_cmd" "$clean_url")" >/dev/null 2>&1; then
|
if eval "$(printf "$kak_opt_url_open_cmd" "$clean_url")" >/dev/null 2>&1; then
|
||||||
|
@ -109,8 +109,8 @@ fi
|
||||||
|
|
||||||
## Completed Plugin
|
## Completed Plugin
|
||||||
|
|
||||||
That's it, that's all! We now have a command called `url-open`,
|
That's it, that's all! We now have a command called `url-open`, which we can
|
||||||
which we can easily bind to something like `gu`:
|
easily bind to something like `gu`:
|
||||||
|
|
||||||
```kak
|
```kak
|
||||||
map global goto u '<esc>: url-open<ret>'
|
map global goto u '<esc>: url-open<ret>'
|
||||||
|
@ -148,4 +148,3 @@ define-command -docstring %{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
title: Automatically Mirror Sr.ht To GitHub
|
title: Automatically Mirror Sr.ht To GitHub
|
||||||
date: 2025-05-15
|
date: 2025-05-15
|
||||||
|
description: Brief tutorial on setting up automatic mirroring from sr.ht to github.
|
||||||
---
|
---
|
||||||
|
|
||||||
For a variety of reasons, I've recently migrated to [sr.ht](https://sr.ht/~ficd)
|
For a variety of reasons, I've recently migrated to [sr.ht](https://sr.ht/~ficd)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
title: On Websites (Or The Case For The Personal Web)
|
title: On Websites (Or The Case For The Personal Web)
|
||||||
date: 2025-05-05
|
date: 2025-05-05
|
||||||
|
description: My thoughts on websites, DIY, and the small web.
|
||||||
---
|
---
|
||||||
|
|
||||||
## Preamble
|
## Preamble
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
title: Rediscovering Email
|
title: Rediscovering Email
|
||||||
date: 2025-03-24
|
date: 2025-03-24
|
||||||
|
description: My experience of delving into email. Nerdily.
|
||||||
---
|
---
|
||||||
|
|
||||||
## Preamble
|
## Preamble
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
title: Why Text Editing Matters
|
title: Why Text Editing Matters
|
||||||
date: Wed 09 Jul 2025
|
date: Wed 09 Jul 2025
|
||||||
draft: true
|
draft: true
|
||||||
|
description: A manifesto on why we should care about our text editing experience.
|
||||||
---
|
---
|
||||||
|
|
||||||
This post will gather my thoughts in general about why text editing, and
|
This post will gather my thoughts in general about why text editing, and caring
|
||||||
caring about your text editor experience, really matters, especially for
|
about your text editor experience, really matters, especially for programmers
|
||||||
programmers and writers.
|
and writers.
|
||||||
|
|
||||||
- Keep this less focused on any particular editor, and more about the
|
- Keep this less focused on any particular editor, and more about the general
|
||||||
general principles of why modal editing is cool and the
|
principles of why modal editing is cool and the ideological/personal reasons I
|
||||||
ideological/personal reasons I have for caring so much about my editor.
|
have for caring so much about my editor. Can reference vim & kakoune but the
|
||||||
Can reference vim & kakoune but the kakoune deep-dive will get its own
|
kakoune deep-dive will get its own post.
|
||||||
post.
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
title: The Lovecraftian Internet
|
title: The Lovecraftian Internet
|
||||||
date: 2025-04-05
|
date: 2025-04-05
|
||||||
|
description: Brief post about how the internet is very, very big.
|
||||||
---
|
---
|
||||||
|
|
||||||
The web we know is spun by gluttonous spiders no longer satiated by flies and
|
The web we know is spun by gluttonous spiders no longer satiated by flies and
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
title: Why Kakoune?
|
title: Why Kakoune?
|
||||||
date: July 6, 2025
|
date: July 6, 2025
|
||||||
draft: true
|
draft: true
|
||||||
|
description: Detailing my experience with Kakoune and why I think it's so great.
|
||||||
---
|
---
|
||||||
|
|
||||||
Blog post explaining why I switched to and really enjoy using Kakoune.
|
Blog post explaining why I switched to and really enjoy using Kakoune.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue