---
title: Better Keyboard Shortcut Formatting for Writers
date: 2026-03-24 07:04
slug: better-keyboard-shortcut-formatting-for-writers
categories:
- Blog
- Code
tags:
- shortcuts
- keyboard
- scripting
- automator
- formatting
- service
- macOS
- ruby
- kbd
---

If you write documentation, tutorials, or notes that include keyboard shortcuts, you know how annoying consistency can be. Sometimes you want plain text like `Shift-Command-K`, sometimes you want nice symbolic output like `⇧⌘K`, and sometimes you want HTML keycaps.

This project started as a [Jekyll plugin](https://github.com/ttscoff/JekyllPlugins/tree/master/KBDTag), then became a [WordPress plugin](https://wordpress.org/plugins/bt-keyboard-shortcuts/), and now I'm offering it as [a CLI and Automator Actions](https://github.com/ttscoff/kbd) you can use anywhere.

[![Video](https://brettterpstra.com/uploads/2026/03/KBD.compressed.jpg)](https://brettterpstra.com/uploads/2026/03/KBD.compressed.mp4)

### What the scripts do

The project ships two Ruby scripts that parse keyboard shortcut text and normalize it into consistent output, following Apple's guidelines by default:

- `kbd.rb` outputs HTML keycap markup.
- `kbd-text.rb` outputs plain text shortcuts.

Both scripts accept flexible input formats, including:

- Keybinding Symbol style: `"$@k"`
- Text style: `"shift cmd k"`
- Hyphenated style: `"Shift-Command-k"`
- Multiple combos separated by `" / "`

For keybinding style:

| Modifier | Symbol | Shortcut |
| --------:	| ------	| 
| Shift    | ⇧ | `$`     |
| Option   | ⌥| `~`     |
| Command  | ⌘ | `@`     |
|  Control   | ⌃ | `^`     |

In practice, this means you can type shortcuts however you naturally type them, and the tool will clean and format them for you.

### Download and install as Quick Actions

Grab the latest release from:

- [Latest release download](https://github.com/ttscoff/kbd/releases/latest)

Then install:

1. Download `KBD Automator Actions.zip`.
2. Unzip it.
3. Double-click each `.workflow` file.
4. Confirm installation when macOS prompts.

After that, the actions show up as Services/Quick Actions for text handling.

### Add keyboard shortcuts for the Services

Once installed, assign your own hotkeys:

1. Open **System Settings**.
2. Go to **Keyboard**.
3. Click **Keyboard Shortcuts**.
4. Select **Services** on the left.
5. Find **Text -> KBD \***.
6. Click the shortcut field on the right.
7. Press the shortcut you want.

That is it. You now have a fast shortcut-to-formatted-shortcut pipeline available from anywhere.

### Configuration

The scripts read config from:

- `~/.config/kbd/config.yaml`

You do not need to create this manually. The first time either script runs, it writes
this file with default values.

Available keys under `kbd:`:

- `use_modifier_symbols` (default: `true`)
  - `true`: prefer symbols like `⌘`, `⌥`, `⇧`
  - `false`: use words like `Command`, `Option`, `Shift`
- `use_key_symbols` (default: `true`)
  - `true`: use symbolic key names where possible
  - `false`: use text key names
- `use_plus_sign` (default: `false`)
  - `false`: combine modifier symbols with no separator (`⇧⌘K`)
  - `true`: join with `+` (`⇧+⌘+K`)

### Build and release it yourself

If you want to generate or ship your own builds, the repo includes Rake tasks for:

- building self-contained scripts
- generating signed Automator workflows
- packaging release zip files
- bumping versions and publishing GitHub releases

Project link:

- [ttscoff/kbd on GitHub](https://github.com/ttscoff/kbd)

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
