summaryrefslogtreecommitdiff
path: root/eww-conf.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-03-06 14:56:30 +0800
committerJSDurand <mmemmew@gmail.com>2021-03-06 14:56:30 +0800
commitf9f272c614f75878d012f5d655393cc73e319321 (patch)
treed43d0bd63a4e3a1536d61d7d7601b0afb5c4a83c /eww-conf.el
parent8bb6e3e47b86568309e0607428de06708ba2ced7 (diff)
Use searx as the default search engine.
This seems to be both faster and to produce more results.
Diffstat (limited to 'eww-conf.el')
-rw-r--r--eww-conf.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/eww-conf.el b/eww-conf.el
index 8b8a379..d10b3a5 100644
--- a/eww-conf.el
+++ b/eww-conf.el
@@ -13,7 +13,22 @@
(setq eww-bookmarks-directory load-file-directory)
-(setq eww-search-prefix "https://duckduckgo.com/lite/?q=")
+(setq eww-search-prefix "https://searx.lukesmith.xyz/search?q=")
+
+(define-key eww-mode-map (vector 'C-tab)
+ #'durand-eww-goto-search-result)
+
+;;;###autoload
+(defun durand-eww-goto-search-result ()
+ "Go to the search results on a search page.
+Otherwise, just go to the beginning of the page."
+ (interactive)
+ (save-match-data
+ (cond
+ ((string-match-p "searx\\." (plist-get eww-data :url))
+ (re-search-forward "search results"))
+ ((goto-char (point-min)))))
+ (recenter 0))
(provide 'eww-conf)