Tagged DuckDuckGo

Here's a cool hack I use to optimize my docs searching.

Let's start off with DuckDuckGo search engine. By itself it's a pretty powerful tool thanks to its numerous features like the !bang syntax. For example searching for:

!cpp std::string::clear

...takes me exactly where I want.

Let's use it to our advantage, shall we?

StumpWM is a tailing window manager that allows you to define system-wide key bindings that work and feel pretty much like Emacs ones. Combining that with DuckDuckGo'es !bang syntax makes you just a few clicks away from anything out there:

(defcommand duckduckgo (phrase) ((:string "Search: "))
  "Searches for something on DuckDuckGo."
    (concatenate 'string
                 " http://duckduckgo.com/?q="
                 (substitute #\+ #\Space phrase))))
(define-key *root-map* (kbd "d") "duckduckgo")

Now, if you want to find out if I used substitute correctly all you have to do is:

C-t d !lisp substitute

...what will take you directly there. Turns out I did.

But wait, there's more!

Continue reading