Configure webjump
This commit is contained in:
parent
906560dae0
commit
a37891f4fc
@ -70,14 +70,4 @@
|
||||
:general
|
||||
([remap dabbrev-expand] #'hippie-expand))
|
||||
|
||||
(use-package browse-url
|
||||
:straight (:type built-in)
|
||||
:config
|
||||
(defun browse-url-or-search (url-or-symbol)
|
||||
"If URL-OR-SYMBOL is a URL, browse it. Otherwise, search for it."
|
||||
(interactive (list (thing-at-point 'symbol)))
|
||||
(if (ffap-url-p url-or-symbol)
|
||||
(browse-url url-or-symbol)
|
||||
(browse-url (format "https://www.google.com/search?q=%s" url-or-symbol)))))
|
||||
|
||||
(provide 'init-built-ins)
|
||||
|
@ -103,4 +103,32 @@ new EWW buffer."
|
||||
(add-to-list 'shr-external-rendering-functions
|
||||
'(pre . shr-tag-pre-highlight)))
|
||||
|
||||
(use-package browse-url
|
||||
:straight (:type built-in)
|
||||
:config
|
||||
(defun browse-url-or-search (url-or-symbol)
|
||||
"If URL-OR-SYMBOL is a URL, browse it. Otherwise, search for it."
|
||||
(interactive (list (thing-at-point 'symbol)))
|
||||
(if (ffap-url-p url-or-symbol)
|
||||
(browse-url url-or-symbol)
|
||||
(browse-url (format "https://www.google.com/search?q=%s" url-or-symbol))))
|
||||
:custom
|
||||
(browse-url-browser-function 'eww-browse-url)
|
||||
(browse-url-handlers '(("\\`https?://docs.aws.amazon.com" . browse-url-default-browser)
|
||||
("\\`https?://github.com" . browse-url-default-browser))))
|
||||
|
||||
(use-package webjump
|
||||
:straight (:type built-in)
|
||||
:init
|
||||
(defalias 'web-search #'webjump)
|
||||
:general
|
||||
(leader-map "S" #'web-search)
|
||||
:custom
|
||||
(webjump-sites '(("Emacs Wiki" . [simple-query "www.emacswiki.org" "www.emacswiki.org/cgi-bin/wiki/" ""])
|
||||
("DuckDuckGo" . [simple-query "duckduckgo.com" "duckduckgo.com/?q=" ""])
|
||||
("Wikipedia" . [simple-query "wikipedia.org" "https://www.wikipedia.org/search-redirect.php?language=en&go=Go&search=%s" ""])
|
||||
("Google" . [simple-query "google.com" "https://www.google.com/search?ie=utf-8&oe=utf-8&q=" ""])
|
||||
("StackOverflow" . [simple-query "stackoverflow.com" "https://stackoverflow.com/search?q=" ""])
|
||||
("AWS Docs" . [simple-query "docs.aws.amazon.com" "https://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=" ""]))))
|
||||
|
||||
(provide 'init-eww)
|
||||
|
Loading…
Reference in New Issue
Block a user