Hacker News new | ask | show | jobs
by shpx 1849 days ago
On Chrome, go to chrome://settings/

Search for "search engines"

Open "Manage search engines"

Under "Other search engines" click on "Add" (on the right)

Add this custom search engine:

- Search engine: Python docs (first result)

- Keyword: p

- URL with %s in place of query: {google:baseURL}search?q=site:docs.python.org%2F3%2F+%s&btnI=I%27m+Feeling+Lucky

Install the "Redirect Google Redirects" extension https://chrome.google.com/webstore/detail/redirect-google-re... (otherwise you'll see a "Redirect Notice" page)

You can also add this search engine:

- Python3 docs

- pp

- {google:baseURL}search?q=site%3Adocs.python.org%2F3%2F+%s

Now, when you need to search for the Python documentation, just type "p setattr" and it'll go straight to https://docs.python.org/3/library/functions.html or you can search "pp setattr" and it'll show you the search results, filtered only for docs.python.org/3/

2 comments

Thank you for your elaborate answer. Now please provide it for Firefox.

And Postgresql. And Flask. Now I am using aiohttp here. SQLAlchemy please. Pytest. Sorry, now in the Rust world. Get me some MDN for Javascript. w3.org for CSS3 spec, pleaaaseee!

You see where this is going? Python.org was an example to illustrate a point.

If you’re using a Mac, you might want to try Dash[1]. I’m sure similar tools exist on other platforms, but I’m not familiar enough to recommend them.

1: https://kapeli.com/dash

I have a few suggestions:

- Dash, the macOS app for language and library documentation is really nice. This is the first thing I go for.

- Chrome notices when you visit a page with a "Search" box. Next time you start typing python.org you can press tab to search the domain. I wish Firefox had this.

- AFAIK, Firefox's version of this is to RMB on a search box (for example on python.org's main page) and "Add a Keyword for this Search..." Set it to something like "py" and you can now type "py http" and it would search Python.org for "http"

- I honestly get better results from DuckDuckGo for stuff like this. Even better, they have bang! shortcuts. "subprocess !py2" will search Python.org's Python2 documentation for "subprocess" https://duckduckgo.com/bang

Those bangs look great. Really useful to know.
I'm not responding to your criticism of Google Search. I'm suggesting to anyone who shares your sentiment something that improved my dev experience.

I also use the uBlacklist extension to hide W3Schools et al. https://chrome.google.com/webstore/detail/ublacklist/pncfbmi...

I actually make these whenever I get frustrated by Google a few times. I have "m" for MDN... It's not hard you just need to pick a keyword. How to modify the URL in the search string should be pretty obvious. I think you'll find you don't need them for every library. It's mostly general tools with large user bases, like Python, where people are trying to make a living shitting up the search results.

If you use DuckDuckGo as your search engine you use the bangs that you add to your query, e.g.

  !w bang
searches for bang on Wikipedia. The list of bangs can be found here [0]

python: !python !python2 !python3

Postgresql: !postgres

Flask: !flask

SQLAlchemy: !sqlalchemy

Rust: !rust

Javascript: !javascript

CSS: !css

Currently there are 13,564 bangs and you can suggest new ones.

[0] https://duckduckgo.com/bang

Alternatively: set DuckDuckGo as your default search engine and type `!python setattr`.