Search and Keyboard Shortcuts on This Blog
Contents
During the recent redesign I moved search and theme switching out of the visual foreground, but I did not remove them. Two small features that used to announce themselves loudly now sit quietly in the corner of the header: a search button, and a set of keyboard shortcuts. This post is a quick reference for people who want to use them.
Search
Search on this site is a client-side overlay. It runs entirely in your browser against an index built from every post and newsletter item, so there are no server round-trips once the page has loaded.
To open it:
- Click the magnifying glass in the header, or
- Press / or s anywhere on the site.
Start typing and results appear as you go. Each entry shows the article title and a short snippet, with a count at the top. Search covers both the title and the full body text of every post, and it tolerates partial or slightly-off matches. The index is particularly good at prefix matches, and if it comes up empty it falls back to plain substring matching, so most of what you remember about an article in fragments will still find it.
Up to twelve results are shown. If there are more, the count line tells you how many were left out.
The overlay opens empty with a few suggested searches — currently emacs, leadership, newsletter, and javascript — so you can click a starting point instead of typing. Press Esc or click outside the dialog to close it; focus returns to wherever you were before.
One note: if the search index fails to load, the overlay points you to the command-line search on the webcmd page, which is a terminal-style interface to the site with a find command of its own. You should not normally need it, but on a flaky connection it is a useful fallback.
Keyboard shortcuts
The site has a small set of keyboard shortcuts. They are deliberately few, and every one of them is something you could do with the mouse instead. They exist to save the small effort of the pointer when your hands are already on the home row.
| Keys | Action |
|---|---|
| / or s | Open search |
| t | Toggle light and dark theme |
| g w | Go to Writing |
| g p | Go to Projects |
| g a | Go to Archive |
| g i | Go to About |
| ? | Show this list of shortcuts |
| Esc | Close an open overlay |
A few behaviour notes:
- The g shortcuts are two-key sequences. Press g and then the destination key within about a second. They are modelled on the
gxnavigation you may know from Vim-style interfaces. - Shortcuts are ignored while you are typing in a search box, a comment form, or any other text field, and when you hold a modifier key like Ctrl or ⌘. So no surprise behaviour while you are mid-sentence.
- Press ? at any point to bring up the reference overlay with the full list. This is the same list shown above, and on a small screen it is easier than trying to remember it.
Why mention this at all
The redesign moved search into a quieter corner, which worried me for a moment. A feature that is not advertised is one people may not discover. But there is a difference between not advertising something and hiding it. The search button is still in the header on every page, the shortcuts are one keypress away from being listed, and this post is an attempt at the documentation side of that decision.
So, everything that used to be loud is still there. It just waits for you to ask for it.