Add caveat
fix autoload error if evil wasn't loaded before
Just pass the list of keys to completing-read
~Because everybody needs their own web-search Emacs function~
Search the word under point or region on the web.
If you use Doom Emacs, just use its builtin +lookup/online
.
straight.el
(straight-use-package '(yasearch :type git :repo "https://git.sr.ht/~kisaragi_hiu/yasearch"))
Put yasearch.el
under your load-path
, then (require 'yasearch)
in your init file.
yasearch engine query
: lookup query
with engine
.
Interactively, ask to select engine
from yasearch-engine-alist
;
query
is taken from
yasearch-evil
: an evil motion to search word objects with yasearch
.
This needs to be required seperately: (require 'yasearch-evil)
Bind this to your preferred keys in normal state, say gs. Now
gsiW asks you which search engine to use, then searches the WORD at
point (iW
) with it.
yasearch-engine-alist
: An alist mapping search engines with their query URLs.
Each item is a cons cell mapping the engine's name as a symbol and the query URL. Example:
'((google . "https://google.com/search?q=%s")
(duckduckgo . "https://duckduckgo.com/?q=%s"))
web-search-engine-name
definerxah-lookup-google
etc. functions, C-h 1 ~ C-h 6 bindings, word02051
webjump
: [simple-query "google.com" "google.com/search?q=" ""]
, search providers can be custom functions; builtin since Emacs 20