This commit is contained in:
2024-09-23 11:17:57 -07:00
parent 897490b10b
commit c7fe0235bf
4 changed files with 47 additions and 16 deletions
+31 -14
View File
@@ -197,6 +197,14 @@
(browse-url-firefox link)
(message "No link to open."))))
(defun opal/elfeed-open-in-eww()
"Open the current Elfeed entry link in eww."
(interactive)
(let ((link (elfeed-entry-link (elfeed-search-selected :single))))
(if link
(eww-browse-url link)
(message "No link to open."))))
(defun opal/elfeed-mark-all-read ()
"Marks all feeds in *elfeed-search* as read."
(interactive)
@@ -226,7 +234,8 @@
;; Evil keybindings for Elfeed
(evil-define-key 'normal elfeed-search-mode-map
"o" 'opal/elfeed-open-in-firefox ;; Open link in Firefox
"f" 'opal/elfeed-open-in-firefox ;; Open link in Firefox
"e" 'opal/elfeed-open-in-eww ;; Open link in Firefox
"r" 'opal/elfeed-mark-all-read ;; Marks all feeds as read
"gr" 'elfeed-update ;; Refresh feeds
"q" 'quit-window)) ;; Quit Elfeed
@@ -239,12 +248,15 @@
(after! eww
(set-popup-rule! "^\\*eww\\*" :ignore t))
(after! osm
(set-popup-rule! "^\\*osm\\*" :ignore t))
;; Set eww webpage title in the modeline bar instead of just *eww*
(setq eww-auto-rename-buffer 'title)
(defun opal/eww-reddit-redirect(url)
"Redirect reddit.com to custom URL automatically since Reddit blocks eww."
(replace-regexp-in-string "https://www.reddit.com" "https://safereddit.com" url))
"Redirect reddit.com to custom URL."
(replace-regexp-in-string "https://www.reddit.com" "https://eddrit.com" url))
;; Redirect reddit links to privacy respecting frontends so Reddit doesn't reject the traffic from eww.
(setq eww-url-transformers '(eww-remove-tracking opal/eww-reddit-redirect))
@@ -261,15 +273,20 @@
guess-language-min-paragraph-length 45)
:diminish guess-language-mode)
;; Temporary functions
(defun opal/remove-extra-asterisks-in-org ()
"Remove the second asterisk in **bold** text, converting it to *bold* in an Org file, without affecting spaces or headings."
(interactive)
(save-excursion
;; Start from the beginning of the buffer
(goto-char (point-min))
;; Loop through the buffer and replace **word** with *word* only if not in headings
(while (re-search-forward "\\([^*]\\)\\*\\*\\([^*\n]+\\)\\*\\*" nil t)
(replace-match "\\1*\\2*"))))
(setq geiser-guile-binary "/usr/bin/guile3.0")
(defun opal/nov-mode-setup ()
"Configure fonts for nov.el."
(variable-pitch-mode 1) ; Enable variable-pitch-mode
(visual-line-mode 1) ; Enable line wrapping at word boundaries
(setq visual-fill-column-width 150
visual-fill-column-center-text t
line-spacing 0.2)
(visual-fill-column-mode 1))
(add-hook 'nov-mode-hook 'opal/nov-mode-setup)
(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))
(setq +lookup-dictionary-prefer-offline t)
(setq dictionary-server "dict.org")