Firefox bookmark keywords for faster navigation

A short entry on how you can use bookmark keywords in Firefox to speed up navigating to common pages. Not sure how many folks are aware of this, but Firefox lets you create “keywords” for

A short entry on how you can use bookmark keywords in Firefox to speed up navigating to common pages.

Not sure how many folks are aware of this, but Firefox lets you create “keywords” for bookmarks which can be used to directly navigate to a page. For example, if you often go into GitHub notifications page, you can create a bookmark for it and add a short keyword. I personally use gn as the keyword.

With this, whenever I want to go to GitHub navigations page, I would do ctrl+t > gn > enter. Very easy to remember and after you use it for a while, it becomes second nature.

This on its own is pretty neat and I have a lot of such bookmarks with keywords, but one very powerful usecase I have this is for GitHub repos, ie link all the pages within a repo that you visit with a common prefix. Let me show you an example for NixOS/nixpkgs (https://github.com/NixOS/nixpkgs) repo. I use nip as the common prefix for nixpkgs.

• nip goes to the repo

• nipi goes to issues

• nipim goes to issues opened by me

• nipp goes to PRs

• nippm goes to PRs opened by me

• nippr goes to PRs that have review requests

• nipa goes to actions

• nipq goes to merge queue

… and more, but you get the idea. Adding this manually can get a bit tiring, but is totally worth it if you were to ask me. I do however add these via nix which makes it a lot easier.

UPDATE: Using bookmark keywords with text substitution

Lobsters user pushcx and donio pointed out that we can use this along with %s so that FF would substitute text we type after that. This could come in really handy for cases like GH PRs, linear tickets or search engines.

Here are few examples to give you an idea of how to use it:

https://linear.app/company/issue/%s : navigate to linear ticket (I map it to lin)

https://duckduckgo.com/?q=%s : DuckDuckGo search (I map it to ddg)

https://duckduckgo.com/?q=!ducky+%s : DuckDuckGo’s I’m feeling lucky search (I map it to ddd)

Using nix to simplify creating bookmarks # (https://blog.meain.io/2024/firefox-bookmark-keywords/#using-nix-to-simplify-creating-bookmarks)

You can find my FF nix config in my dotfiles (https://github.com/meain/dotfiles/blob/9e4b91bdfbdba794bb15af62f896ca59b64c4f22/home-manager/.config/home-manager/firefox.nix#L99)

Here is an example of generic bookmarks in my nix FF config:

[ { name = “GitHub Notifications”; keyword = “gn”; url = “https://github.com/notifications”; } { name = “Calendar”; keyword = “gcal”; url = “https://calendar.google.com/calendar/r”; } { name = “Email”; keyword = “gmail”; url = “https://mail.google.com/mail/u/0/#inbox”; } { name = “Outlook Calendar”; keyword = “ocal”; url = “https://outlook.office.com/calendar/view/month”; } { name = “Outlook Mail”; keyword = “omail”; url = “https://outlook.office.com/mail/inbox”; } { name = “Syncthing”; keyword = “sync”; url = “http://localhost:8384/”; } ] Now to get to how I do GitHub bookmarks in nix. I have a utility function named gh-bookmarks defined in utils.nix (https://github.com/meain/dotfiles/blob/9e4b91bdfbdba794bb15af62f896ca59b64c4f22/home-manager/.config/home-manager/utils.nix#L37) in my config.

gh-bookmarks = { repo, basename, basekeyword }: [ { name = basename; tags = [ “github” ]; keyword = basekeyword; url = “https://github.com/” + repo; } { name = basename + “ Issues“; tags = [ “github” ]; keyword = basekeyword + “i”; url = “https://github.com/” + repo + “/issues”; } { name = basename + “ Issues Assigned to me“; tags = [ “github” ]; keyword = basekeyword + “im”; url = “https://github.com/” + repo + “/issues/assigned/@me”; } { name = basename + “ Pull Requests“; tags = [ “github” ]; keyword = basekeyword + “p”; url = “https://github.com/” + repo + “/pulls”; } { name = basename + “ Pull Requests Assigned to me“; tags = [ “github” ]; keyword = basekeyword + “pm”; url = “https://github.com/” + repo + “/pulls/assigned/@me”; } { name = basename + “ Pull Requests Review Requested to me“; tags = [ “github” ]; keyword = basekeyword + “pr”; url = “https://github.com/” + repo + “/pulls/review-requested/@me”; } { name = basename + “ Pull Requests Review Requested to me and not approved“; tags = [ “github” ]; keyword = basekeyword + “prr”; url = “https://github.com/” + repo + “/pulls?q=is%3Aopen+is%3Apr+review-requested%3A%40me+-review%3Aapproved”; } { name = basename + “ Actions“; tags = [ “github” ]; keyword = basekeyword + “a”; url = “https://github.com/” + repo + “/actions”; } { name = basename + “ Queue“; tags = [ “github” ]; keyword = basekeyword + “q”; url = “https://github.com/” + repo + “/queue/main”; } { name = basename + “ Queue“; tags = [ “github” ]; keyword = basekeyword + “qq”; url = “https://github.com/” + repo + “/queue/master”; } ] And then I use this to generate bookmarks like below(code in dotfiles (https://github.com/meain/dotfiles/blob/9e4b91bdfbdba794bb15af62f896ca59b64c4f22/home-manager/.config/home-manager/repo_bookmarks.nix#L1)):

utils.gh-bookmarks { repo = “NixOS/nixpkgs”; basename = “nixpkgs”; basekeyword = “nip”; } ++ utils.gh-bookmarks { repo = “meain/dotfiles”; basename = “dotfiles”; basekeyword = “dot”; } Now every time I start working on a new repo, I have to add 5 lines and get all the bookmarks for that repo with a home-manager switch.

Write a comment
No comments yet.