** Description Search the web with dynamic suggestions and browse the results -- all from the comfort of Emacs and ivy.
The main idea in counsel-web is to not have to browse search results in a browser--instead go directly to the page you were searching for. It accomplishes that in two steps:
** Demo
[[file:counsel-web-demo.gif]]
** Usage
*** Suggestions =counsel-web-suggest= shows search suggestions as you type. Press =RET= to accept the suggestion and send it to =counsel-web-search=.
*** Search =counsel-web-search= searches and presents the results in the ivy minibuffer.
*** Settings
**** Change the default browser To open the selected result in the operating system browser instead of Emacs:
(setq counsel-web-search-action #'browse-url)
**** Change the alternate browser
(setq counsel-web-search-alternate-action #'w3m)
**** Change Search Engines DuckDuckGo and Google are built in. DuckDuckGo is the default. Change to Google like this:
#+begin_src emacs-lisp
(setq counsel-web-engine 'google)
#+end_src
See =counsel-web-engine-alist= to learn how to add more search engines.
*** Update search results with each keystroke Experimental!* To update the search (not suggestions--the actual search results) with each key press:
(setq counsel-web-search-dynamic-update t)
Note that dynamic updates can sometimes lead the search engine to temporarily block requests if it decides Emacs is a running a search robot. This seems to be a bigger problem with DuckDuckGo than with Google. Suggestions regarding how to fix this are welcome.
** Installation
(add-to-list 'load-path "/path/to/counsel-web") (require 'counsel-web)
;; Define "C-c w" as a prefix key. (defvar counsel-web-map (let ((map (make-sparse-keymap "counsel-web"))) (define-key map (kbd "w") #'counsel-web-suggest) (define-key map (kbd "s") #'counsel-web-search) (define-key map (kbd ".") #'counsel-web-thing-at-point) map)) (global-set-key (kbd "C-c w") counsel-web-map)
** Similar Projects
*** =counsel-search= in counsel itself =counsel-search= is very similar to =counsel-web-suggest=. However, =counsel= currently does not provide an equivalent to =counsel-web-search=.
*** Google this https://github.com/Malabarba/emacs-google-this Google this searches Google for things under point, somewhat similar to =counsel-web-thing-at-point=. However, it does not have equivalent functions to =counsel-web-suggest= or =counsel-web-search=.
*** Engine-mode https://github.com/hrs/engine-mode Engine-mode sends a search to the browser, it doesn't parse the search and results in Emacs.
*** Helm-google https://framagit.org/steckerhalter/helm-google The most similar, it displays search results in the helm buffer like =counse-web= does in the ivy minibuffer.
** License =counsel-web= is released under the [[https://www.gnu.org/licenses/gpl-3.0.en.html][GNU General Public License 3.0]].