From c9ca7f1ddf0fe52c4621fd26a304e28e42725bbe Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 6 May 2024 17:35:40 -0500 Subject: add eww-copy-url to eww-config --- modules/eww-config.el | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/eww-config.el b/modules/eww-config.el index 3476d068..f418ad57 100644 --- a/modules/eww-config.el +++ b/modules/eww-config.el @@ -5,6 +5,22 @@ ;;; Code: +;; -------------------------------- Eww Copy Url ------------------------------- + +(defun cj/eww-copy-url () + "Copies the eww url to clipboard" + (interactive) + (when (string= major-mode "eww-mode") + (let ((current-url (plist-get eww-data :url))) + (when current-url + (kill-new current-url))))) + +;; (defun cj/eww-copy-url () +;; "Copies the eww url to clipboard" +;; (interactive) +;; (when (string= major-mode "eww-mode") ; Ensure we're in eww-mode +;; (kill-new eww-current-url))) ; Copy to clipboard + ;; ------------------------------------ EWW ------------------------------------ (use-package eww @@ -14,7 +30,8 @@ (:map eww-mode-map ("<" . eww-back-url) ;; in addition to 'l' (">" . eww-forward-url) ;; in addition to 'n' - ("i" . eww-toggle-images) + ("i" . eww-toggle-images) + ("u" . cj/eww-copy-url) ("o" . eww-open-in-new-buffer)) :config (setq shr-use-colors nil) ;; respect colors in the html -- cgit v1.2.3