I've been blogging for quite a while now. And, as much as I try to, I simply can't keep all of it in my head. In fact, that's one of the major benefits of blogging - being able to create a sort-of "scratch disk" for my tiny caveman brain. So, I often find myself searching my own blog archive for examples and code-snippets that I want to use in my work. Normally, I do this by adding
site:bennadel.com before my Google search; however, I recently learned that I could make this even easier by adding my own Blog as a custom search engine in Google Chrome's OmniBox.
Ultimately, what this allows me to do is type
ben in the Google Chrome OmniBox (ie, Location / URL bar) before my search query, and narrow Google's search down to my site:
To do this, I went into the my Chrome Settings -
CMD+, - and went to the "Search Engines" section and clicked on "Manage Search Engines":
This brings up a list of all the configured search engines, which are nothing more than a combination of keyword-triggers and resulting search strings. To add my own blog to this list, I clicked on Add and entered
ben as the trigger:
Then, as the Search Engine URL, I entered:
This is, essentially, the search that I used to run with
site:bennadel.com as the first part of the query term. In this URL, the
%s will be replaced with the query that I enter in Google Chrome's OmniBox / Location Bar.
So now, if I want to search my own blog in Google Chrome, I simply do:
CMD+L- focuses the OmniBox / Location bar.
Tab- triggers the custom search engine context.
- Type the rest of my query.
Enter- executes the Google Search on
I know this is a silly thing; but, honestly, it's a really nice micro-optimization. I do search my own site a lot looking for old posts and this will make it a seamless gesture. And, of course, you could set up any site as the context for a constrained search. For example, I just added the Mozilla Developer Network to trigger with
mdn and run a query for:
Now, if I search for something like
mdn ClipboardEvent, it will constrain my resulting search to the Mozilla Developer site. Which, let's face it, is like 50% of all my queries.
This. Is. Insane. I slapped my forehad... I did know this feature existed. I did have this problem of searching the docs for a handful of libraries all the time. It did physically hurt to see Google results page every time. And yet I was mindlessly suffering until you brought light into my life.
Ha ha, glad to have shed some light. I am loving this
feature. I've already used
mdn xxxx like 15-times since I
posted this :D