So called «bookmark keywords» (i.e. the abbreviated aliases used to make queries easier) are certainly useful. I’ve been using them for years and have come to depend on them, but all of the implementations I’ve used were missing one useful thing or another, and the data can be difficult to import/export between browsers.
Even if it did work as I wish in my preferred browser, separation is useful, and this tool provides that independence, in addition to the following features:
See the example plain text configuration file.
The url-query script accepts a key and substitution part(s).
url-query key p...
Example, search Wikipedia for the phrase ‘robert anton wilson’:
url-query w 'robert anton wilson'
Multi-part example, language translation (from, to, text):
url-query tr en fr 'keep it simple'
The current text selection can be used directly (i.e. no need to copy/paste). The option
-s, with one or more keys as arguments, uses the text selection as the (singular) substitution part for each URL.
url-query -s key...
-q toggles quoting. If the text selection contains spaces, it can be automatically quoted by setting the default value in the script, or by using the command option (which simply toggles the default).
url-query -q key...
-n can be used to add a new record (which is useful because it tests to avoid duplicates, and prompts for a new key if necessary).
url-query -n key name URL-or-key(s) url-query -n ted 'TED talks' 'http://www.ted.com/search?q=%s'
-t invokes test mode: the command for each URL is printed to standard output instead of being evaluated.
url-query -t key p...
url-query, the other calls