Add command to browse a URL or google the symbol at point
This commit is contained in:
parent
232f8053f0
commit
da98498fd4
@ -70,4 +70,14 @@
|
||||
: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)
|
||||
|
@ -145,6 +145,7 @@ targets."
|
||||
((emacs normal motion insert visual) "M-." #'embark-dwim)
|
||||
("C-." #'embark-act)
|
||||
("M-." #'embark-dwim)
|
||||
(embark-general-map "C-k" #'browse-url-or-search)
|
||||
(embark-file-map "s" #'sudo-edit-find-file
|
||||
"l" #'vlf
|
||||
"g" #'magit-file-dispatch)
|
||||
|
Loading…
Reference in New Issue
Block a user