I’m officially announcing SearchLink 2.2.0 today. It’s still free (for now), and I’m really excited about this update. The documentation has been updated and the changelog is immense.

If you’re new to SearchLink, it’s a way to search for links on the fly without switching to your web browser. It can search for apps on iTunes and the Mac App Store, run Google searches and spell checks, find music by albums and artists, and automatically add your affilliate tokens to Amazon and iTunes link results. And more…

I simplified the syntax and added new configuration options, including the ability to validate search results. You can even set options per-search with short flags. There are more search options, better defaults, and some new syntax that won’t get in your way if you never need it.

Whether you’re new to SearchLink or upgrading, be sure to take a look at the revised documentation. Almost all of the changes are backward-compatible, but it’s worth knowing about the new syntax and options.

Here’s the changelog in its raw form, and the download link is at the end.

2.2.0 Changelog

  • Bing search fallback due to deprecated (4 years ago) Google APIs potentially being shut down soon
    • Can be forced with !b

Simpler syntax and new syntax options

  • quotes no longer required around additional search terms
  • if search terms in parenthesis start with a “+”, they’re appended to the link text for the search, otherwise they replace it
  • A tilde (~) at the end of a single-string search with no bracket syntax checks the clipboard for a url and wraps the selected text with it if found
    • can be used with the : syntax at the end to create a reference with the selected text as the title
    • ignores and strips !! (link only) and ^ syntax

      # with "http://www.tuaw.com/tag/howto/" in the clipboard
      		
      TUAW how-to~
      => [TUAW how-to](http://www.tuaw.com/tag/howto/)
      		
      TUAW how-to:~ (or "TUAW how-to~:")
      => [TUAW how-to]: http://www.tuaw.com/tag/howto/
  • !example.com searches become site-specific web searches
  • for single-line searches, text in parenthesis is searched (as additional search terms) but not included in the link text
  • in single line searches without []() format, text surrounded in quotes becomes the link text
    • !g "Six Barrel Shotgun" black rebel is the same as !g Six Barrel Shotgun (black rebel)
  • !spell search replaces selection with most relative spelling correction
    • works on entire blocks of text
  • you can use a colon in a bracketed search, and if it’s alone on a line it will create a reference link definition
    • if an identical link results in future searches, it will re-use the id of the generated reference definition
    • if the resulting link already exists, any defined reference id will be replaced with the existing definition’s id
    • the reference definition will be moved to the end of the document
  • create footnotes with [id](^footnote text)
    • if id isn’t specified, one is generated
    • footnotes are collected at the end and added with line breaks surrounding
  • !h for searching your own web history
    • configure search types in ~/.searchlink

      history_types:
      - chrome_history
      - chrome_bookmarks
      - safari_bookmarks
      - safari_history
    • use !h[sc][hb] to configure on the fly

      • !hsb only searches (s)afari (b)ookmarks
      • !hsbh searches safari bookmarks and history
      • !chsb searches chrome history and safari bookmarks
      • !h searches all configured types from ~/.searchlink

        New configuration options

  • ~/.searchlink
    • config option to validate links (validate_links)
    • custom search definitions with a value starting with http or / and including $term in the string will simply have the value returned with the $term replaced with the input
      • $termd lowercases the text in the replacement string
      • More than one $term can be used by adding numbers after them
        • $term1, $term2
        • the search terms given are separated by a space
        • if there are more terms than tokens, the additional terms are appended to the last token
        • $term1d works for lowercasing
        • replacements are URL encoded
    • report option outputs verbose info on multi-line searches
  • set configuration options with MMD metadata (per document) or flags (per link)
    • The following headers can be set in MMD: debug, country_code, inline, prefix_random, include_titles, validate_links
      • headers set at the top of the document
      • key: value
      • e.g. debug: true
      • Headers set in MMD metadata are global (unless overridden by a flag) and not removed from the output
    • The following can be switched per link with --(no-)key: inline, include_titles, validate_links
      • flags are removed from the search and the output
      • values changed by flags are restored after processing each link
    • flags can be used in custom search engine definitions
      • flags in definitions are overridden by flags in the input
      • use this for applications such as never validating links of a certain type:

        # In ~/.searchlink:
        custom_site_searches
            # lowercases the query and never validates
            tag: http://brettterpstra.com/topic/$termd/ --no-validate_links
        			
        $ !btt markdown
        			
        => [markdown](http://brettterpstra.com/topic/markdown/)
    • Shortcuts are available for some flags.
      • debug = d, inline = i, include_titles = t , and validate_links = v
      • Enable options with ++[options], disable with --[options].
      • Multiple options can be grouped together
      • both ++ and -- can be used in the same link
      • only the first appearance of a flag is used, repeats are ignored
      • example:

        # do a google search for the link text
        # additional (+) search terms appended to query
        # no link validation (--v)
        # create an inline link with a title (++it)
        [Martha Stewart](!g --v ++it)
        
        => [Martha Stewart](http://www.marthastewart.com/ "Martha Stewart - Recipes, DIY, Home Decor & Crafts")

Output formatting improvements

  • link format only forces inline if a single line (no newlines) is selected
  • groups new reference definitions with any existing definitions at end of selection to keep full-document selections looking tidy
  • detects existing random prefix and continues pattern for easier search and replace
  • duplicate urls properly re-use existing reference titles
  • links in code blocks (indented or fenced) are ignored
  • reports and errors are removed and replaced when running on a full document
  • Jump to SearchLink Error service accepts a highlighted error line and jumps to its position in the document, highlighting the offending match

CLI improvements

  • can run on a file if path(s) are passed as an argument (SearchLink File service)
  • set SL_SILENT=false on the command line for verbose output
  • -debug flag to output html comment at end of selection showing any errors
    • at end of line for single line searches
    • block format for multi-line searches
  • -version
  • -help
  • -stdout outputs to STDOUT when using on files as CLI
    • default is to overwrite the file, -stdout cancels this out
  • -no-backup
    • default is to create a *.bak file when overwriting

Download

SearchLink v2.3.65

Generate Markdown links from web searches without leaving your editor.

Published 11/10/14.

Updated 01/16/24. Changelog

DonateMore info…