A programming blog by Dylan Kendal

Tap Capslock for Escape, Hold for Control


About a month ago I picked up a Dygma raise1: a split, ergonomic keyboard with programable firmware. At some point I’d like to write more about my foray into mechanical, and more specifically split board keebs but for now the most important part is that the Raise has a programmable firmware. Beyond simple rebinds it also allows for dual function keys, layers, and QMK tap dance2 like contextually sensitive bindings.…
Read more ⟶

Capture paths from a Kitty window in Neovim


Tired of skimming through buffer output, looking for a path? I am! I spent relaxing day at the cottage hacking together a Lua plugin to do this automatically. The script uses kitty’s remote control feature to grab text from all other windows in the current tab. To make things simple the script only cares about visible portion of the scrollback buffer, although you could certainly tweak the options to grab the whole buffer.…
Read more ⟶

Jest code coverage in Neovim


I’ve been wanting to be able to view my code coverage directly within Vim for a long time. Not having to switch to browser or another window shortens the feedback loop, especially when developing a test for code you aren’t familiar with. Wallaby.js is a VSCode extension that handles this really well: it lets you run tests directly in the buffer and annotates lines with a green or red square to indicate if then statement was covered.…
Read more ⟶

How to install Neovim nightly


Here’s a quick little script that you can use build and install the most recent release of Neovim. #!/bin/bash cd ~ || exit 1 sudo rm -r neovim || true git clone https://github.com/neovim/neovim cd neovim || exit 1 sudo make CMAKE_BUILD_TYPE=Release install cd ~ || exit 1 sudo rm -r neovim I’ve used this on both Linux and Mac OSX without issue. This script was originally posted on a Neovim GitHub issue tracker which I’ve long since forgotten.…
Read more ⟶

Change Kitty terminal color-scheme


One of the more persistant complaints about the Kitty terminal emulator is the inability to reload configuration. While you can’t change every option at runtime, you can change most display properties on fly if you enable remote control first. After this small tweak you can change color schemes, window padding, and font sizes on demand in a single, or all windows; current, and future. ❯ kitty @ --help Usage: kitty @ [options] command .…
Read more ⟶

Batch export Org-mode pages


A common task if - like me - you use Org-mode to create static websites; is to export the document to your destination format. Take this blog for instance. It’s written in Org-mode, which is exported to markdown for use by Hugo which will then compile it to HTML. The obvious choice for exporting your content would be to call the command directly within Emacs, but say you wanted to do this as a part of some other build process or as part of an automated continuous deployment process it would be necessary to invoke the export command from the shell.…
Read more ⟶

Capture the output of a Vim command


Vim ships with an internal pager named “more” for displaying command output that is used when the entire screen would be filled. Despite it’s name, more, it is not the command line utility that you might be familiar with, and because it’s a builtin feature vim cannot be configured to use an alternative (like less). Much like it’s namesake, the internal more pager leaves a lot to be desired, like any ability to search the output.…
Read more ⟶

Create a Vim quickfix list from the clipboard


Do you find yourself editing a buffer containing file paths and you want to quickly switch between them? The :cex[pr][!} {expr} command executes any valid vim expression ({expr}) and constructs a quickfix list from each string of the output. Assuming you’ve set clipboard to unnamed or unamedplus, you can supply the clipboard register (@*, or @+ respectively) as a vim expression. 1 2 "assuming :set clipboard=unnamed :cex @* or: "assuming :set clipboard=unnamedplus :cex @+ Now you can set the quickfix to the current contents of your clipboard, note that your input will still have to match your errorformat.…
Read more ⟶