Zen search for SearchLink

SearchLink can now look through Zen bookmarks and history the same way it already did with Firefox (and Chrome and Safari). Zen keeps its history and bookmarks in a Mozilla places.sqlite database, so !h grew a z.
If it’s been too long and you’ve forgotten what SearchLink is, it’s one of my favorite projects I’ve ever created. It lets you select any text and search for a link via a ton of sources, inserting Markdown links for everything without opening a browser. If you write in Markdown (or do a lot of show notes), you should check it out.
The shortcuts
!hz searches both Zen history and Zen bookmarks. Add h or b when you only want one of them.
[jekyll](!hzb)
[searchlink privacy](!hzh)
[something I know I opened in Zen](!hz)You can still stack browsers. !hzhfb is Zen history plus Firefox bookmarks. A bare !h searches whatever you have turned on in the config, which now includes Zen if you enable it.
A search term that starts with a single quote is an exact phrase. Every other word has to show up in the URL or the title.
Updating
Select the word update (or upgrade) and run the SearchLink service. On macOS that downloads the latest release and replaces the services in ~/Library/Services. If you installed the cask, brew upgrade --cask searchlink does the same job. The CLI build tracks the repo, so pull and you are current.
You can also always download the latest release from GitHub or below.
SearchLink v2.3.93
Generate Markdown links from web searches without leaving your editor.
Published 11/10/14.
Updated 10/02/26. Changelog
Configuring !h
Explicit shortcuts like !hzh always search Zen. The plain !h shortcut only searches the types listed in ~/.config/searchlink/config.yaml (or ~/.searchlink if you still have the old file).
SearchLink will not edit an existing history_types list for you. Add the Zen lines yourself, and comment out anything you do not want !h to touch:
history_types:
- safari_history
- safari_bookmarks
- zen_history
- zen_bookmarks
# - firefox_history
# - firefox_bookmarksA few limits
This is macOS only. SearchLink reads ~/Library/Application Support/zen/profiles.ini and uses that profile’s places.sqlite. If you have more than one Zen install, it prefers the install default, then the profile marked default, and if several installs are listed it picks the database that was modified most recently. Other profiles are ignored.
It also needs the sqlite3 command. macOS includes that. The database is copied (including the write-ahead log) so a running Zen does not lock the query, and visits from the current session are included. What you get back is the newest matching visit or bookmark, not a ranked “best title” result. Search-result URLs are skipped, including Google, DuckDuckGo, Kagi, Bing, and other result pages, so a history hit should be the page you actually opened.
The same profile lookup is what Firefox uses now, too. Firefox used to grab the first *default-release folder it saw, which was the wrong profile often enough to be annoying.
Linkding
I also tightened up !ld (and !ding). It used to download the whole bookmark library and search a local cache. It now asks your Linkding server, with the same query syntax as the Linkding UI: words, "quoted phrases", #tags, and and / or / not. Archived bookmarks are included, and the link text you wrote stays put.
linkding_server: https://links.example.com
linkding_api_key: your-tokenThe token is under Settings, Integrations on the server. A very broad query only looks at the first thousand matches in active bookmarks and the first thousand in the archive, then picks the best of those. An exact title or tag match wins.
Enjoy!
Like or share this post Twitter.
BrettTerpstra.com is supported by readers like you. Click here if you'd like to help out.
Find Brett on Mastodon, Bluesky, GitHub, and everywhere else.