Nerd Business

28
Mar
2011

A Hack to Make Searching Faster (AutoHotKey + DuckDuckGo)

Do you ever notice when you need to search the web for something - it's a two step process? Step1: load internet browser. Step 2: type query in a search box.

Opening the internet browser is actually a cumbersome step. Particularly for nerds, who do this a million times a day.

Here's an easy hack on how to eliminate an entire step to more intuitively search, instantly.

In this example, I want to find out about dogs and want the results asap. Type this:

;s dogs

Here's what happens on my system… regardless of what programs are running or what I may be doing - anytime I type this command a prompt automatically loads with my query.

And after pressing {Enter} the query is immediately searched.

This hack speeds up the 'brain-to-search' process. With it - your flow of thinking is not interrupted by having to find and load the internet browser. You need to simply type ;s to begin searching immediately.

How to set it up

First, you need AutoHotKey for Windows (IronAHK for Linux or Mac). This is the lightweight, powerful app that will run our search - and do a lot more.

Once installed, "Edit This Script" and add the following code:


:*:;s::
InputBox, SearchTerm, Search
if SearchTerm <> ""
  Run https://duckduckgo.com/?q=%SearchTerm%
return

Now reload the script and give it a test. Anytime you type ;s the input box will appear. After pressing {Enter} the query will be sent to the search engine.

Why DuckDuckGo > Google

You'll notice in the example, I use DuckDuckGo (not Google). That's because DuckDuckGo is superior to Google for one simple reason: DuckDuckGo can search Google. Just add !g to the beginning of any query.

This way there's no need to edit the script if you prefer a Google search. Simply use DuckDuckGo's !bang syntax and add !g to the beginning of your search phrase.

The icing on the cake is that with the !bang syntax you can directly search just about any other engine too.

Movies? !imdb Images? !flickr YouTube? !yt Recipe? !recipe Definition? !define

More fun with AutoHotKey

AutoHotKey is a powerful tool. You can use it to automate nearly anything with the keyboard. I particularly like it for assigning commonly used programs to keyboard shortcuts.

#w::Run, firefox.exe
#n::Run, notepad.exe

With the above code, the # represents the Windows Key. So anytime you press the Windows Key + W the web browser will run. And likewise for Notepad.

Live text replacement is another huge boost of efficiency.

:*:;whn::news.ycombinator.com
:*:;wts::twitter.com/SteveMartinToGo

This code is handy while your situated in the address bar of the web browser. It's a quick way to type a common URL without having to type it (or browse for the bookmark). So anytime you type ;wts that text will automatically be replaced with twitter.com/SteveMartinToGo (you can set this to anything, but my logic in using ;wts is ; = initiate hotscript, w= website, t = twitter, x= the feed)

There's a ton of other useful AutoHotkey scripts on this superuser StackExchange discussion.