Emacs Helm Interface for quick web searches.
Currently helm-google
supports Google and Searx
quelpa
is at https://github.com/quelpa/quelpa
(quelpa '(helm-google :fetcher git :url "https://framagit.org/steckerhalter/helm-google.git"))
helm-google
is on melpa (see there for more info).
Call it with:
M-x helm-google
This will use the default search engine (Google is set by default, for customization see below).
To bind it to a key:
(global-set-key (kbd "C-h C--") 'helm-google)
To use one of the search engines explicitly instead of the default, use the appropriate function:
M-x helm-google-searx M-x helm-google-google
If a region is selected it will take that as default input and search the web immediately. Otherwise it will start to search after you have entered a term. Pressing RET
on a result calls the browse-url
function which should open the URL in your web browser.
You can press TAB
to view and choose alternative actions or press the appropriate key directly:
F2 | use the internal Emacs Web Wowser (EWW, since Emacs 24.4) to open the url |
F3 | copy the link into the clipboard |
F4 | browse the url with the webkit xwidget (if your Emacs supports it) |
If you want use EWW by default you can set it as your default browser like so:
(setq browse-url-browser-function 'eww-browse-url)
If you want to keep the search open use C-z
or C-j
instead of RET
.
The following customizations can also be made via M-x customize-group RET helm-google RET
.
Google is the default engine. To make Searx your default use:
(setq helm-google-default-engine 'searx)
I’m using a default Searx instance that does not impose a rate limit. searx.me
or searx.info
are not usable because of the rate limitation.
I have limited the engines to google
because the quality of the other search engines is poor IMO. Sometimes Searx instances fail to get results from Google, so if you don’t get results, try another instance from http://stats.searx.oe5tpo.com/, or add more search engines to the url:
https://searx.dk/?engines=google,bing,yahoo&format=json&q=%s
For additional Searx options see: https://asciimoo.github.io/searx/dev/search_api.html
If you want to tweak a search url, you can modify the alist helm-google-engines
.
To do it in elisp use add-to-list
, for example to modify the searx url:
(add-to-list 'helm-google-engines '(searx . "https://searx.drakonix.net/?engines=google&format=json&q=%s"))
This will shadow the old value which is the correct way to “modify” an alist entry.
When you stop typing, a search is launched after an idle time of 0.5s
by default. You can customize this and set it to 1s
for example:
(setq helm-google-idle-delay 1)
helm-google
is added as an action to helm-google-suggest
(thanks to Dickby). Press TAB and choose Helm-Google
or use the shortcut listed there directly.