Instead of going to a website and using its search bar, you can make searches inside the site directly from Firefox’s URL bar using smart keywords: How to search IMDB, Wikipedia and more from the address bar | Firefox Help.
- (Refer to the 2nd image while following this).
- To make a smart keyword, you create a bookmark and specify a a search URL containing
%s
, which represents your typed search query.
- Specify a keyword, which you type followed a space and then your query to trigger a search.
- I wrote
np
for Nixpkgs and no
for Nix options.
- So I can write
np grub
in the URL bar and press enter to see nixpkgs results for grub.
- And
no services.xserver
to see nix options containing services.xserver
.


4 Likes
Duckduckgo has a feature where it offers pre-set immediate access to various search engines like this: https://duckduckgo.com/bangs
Setting it up as my default search engine gives me !nixpkgs <package>
, but also e.g. !rust <function>
!docker <image>
and !pip <package>
.
Very much recommend if you like configuring your browser search features like this, saves a ton of manual effort.
3 Likes
hey guys, may i chime in with how i did it? so the “%s
” search query result thing didnt really work for me (it gives a 404?), so i had to use the ?query={searchTerms}
or search?q={searchTerms}
thusly so in my declarative librewolf config:
# snip (aka truncated)
programs.firefox.policies.SearchEngines.Add = [
{ # example numero uno
Name = "NixOS Search";
URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
Method = "GET"; # "POST"
IconURL = "https://search.nixos.org/favicon.png";
}
{ # another one that uses '?query='
Name = "Searchix";
URLTemplate = "https://searchix.ovh/?query={searchTerms}";
Method = "GET"; # "POST"
IconURL = "https://searchix.ovh/favicon.ico"; # broken =(
}
{ # this one uses 'search?q='
Name = "Startpage";
URLTemplate = "https://www.startpage.com/search?q={searchTerms}";
Method = "GET"; # "POST"
IconURL = "https://www.startpage.com/favicon.ico";
}
{ # same here
Name = "Ecosia";
URLTemplate = "https://www.ecosia.org/search?q={searchTerms}";
Method = "GET"; # "POST"
IconURL = "https://www.ecosia.org/favicon.ico";
}
{ # broken favicon =(
Name = "Searchfox"; # its a neat search engine for firefox prefs btw
URLTemplate = "https://searchfox.org/mozilla-central/search?q={searchTerms}";
Method = "GET"; # "POST"
IconURL = "https://searchfox.org/favicon.ico"; # i cri evrytiem
}
# blah blah you get idea!
];
# snip (aka truncated)
you can check these out and how they work here:
to determine whether its a ?query={searchTerms}
or a search?q={searchTerms}
you just gotta do a search once and you can see the link. though i think it doesnt care sometimes, just try it out yourself
right, so these are not bookmarks, per se, these are search engines that are in the url bar. some people like them, some people hate them, im the latter =) but if your bookmarks are a mess, its pretty useful i think. so the recent update for gecko’s changed their behaviour a bit, to select an engine just with a keyboard, you do this:
CTRL+K
+ SHIFT+TAB
+ DOWN_ARROW
+ ENTER
(separately)
mad, yeah? well, thats about it
1 Like