diff --git a/.config/doom/config.el b/.config/doom/config.el index cbf20ff..35b88dc 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -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") diff --git a/.config/doom/custom.el b/.config/doom/custom.el index 9fca6f8..f2f2b19 100644 --- a/.config/doom/custom.el +++ b/.config/doom/custom.el @@ -50,4 +50,16 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - ) + '(org-agenda-date ((t (:inherit fixed-pitch)))) + '(org-agenda-date-today ((t (:inherit fixed-pitch :weight bold)))) + '(org-agenda-date-weekend ((t (:inherit fixed-pitch :weight bold)))) + '(org-agenda-dimmed-todo-face ((t (:inherit fixed-pitch)))) + '(org-agenda-done ((t (:inherit fixed-pitch :strike-through t)))) + '(org-agenda-structure ((t (:inherit fixed-pitch)))) + '(org-deadline-announce ((t (:inherit fixed-pitch)))) + '(org-scheduled ((t (:inherit fixed-pitch)))) + '(org-scheduled-previously ((t (:inherit fixed-pitch)))) + '(org-scheduled-today ((t (:inherit fixed-pitch)))) + '(org-time-grid ((t (:inherit fixed-pitch)))) + '(org-upcoming-deadline ((t (:inherit fixed-pitch)))) + '(variable-pitch ((t (:slant normal :weight regular :height 200 :width normal :foundry "PfEd" :family "ETBembo"))))) diff --git a/.config/doom/init.el b/.config/doom/init.el index d96e358..220db7a 100644 --- a/.config/doom/init.el +++ b/.config/doom/init.el @@ -83,7 +83,7 @@ ;;ein ; tame Jupyter notebooks with emacs (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists - lookup ; navigate your code and its documentation + (lookup +dictionary) ; navigate your code and its documentation lsp ; M-x vscode magit ; a git porcelain for Emacs ;;make ; run make tasks from Emacs diff --git a/.config/doom/packages.el b/.config/doom/packages.el index c3a1f03..6ad9efd 100644 --- a/.config/doom/packages.el +++ b/.config/doom/packages.el @@ -8,6 +8,8 @@ (package! mixed-pitch) (package! guess-language) (package! sicp) +(package! nov) +(package! osm) ;; Remove (package! dirvish :disable t)