lots of stuff

This commit is contained in:
2024-09-02 14:23:16 -07:00
parent e9c0ca90a6
commit 23d686908d
5 changed files with 76 additions and 25 deletions

View File

@@ -22,7 +22,7 @@
(set-face-attribute 'default nil :font "Terminus" :height 200 :weight 'regular)
(set-face-attribute 'fixed-pitch nil :font "Terminus" :height 1.0 :weight 'regular)
(set-face-attribute 'variable-pitch nil :font "Terminus" :height 1.0 :weight 'bold)
(set-face-attribute 'variable-pitch nil :font "ETBookOT" :height 200 :weight 'regular)
(defun opal/org-font-setup ()
;; Replace list hyphen with dot
@@ -40,26 +40,25 @@
(org-level-6 . 1.1)
(org-level-7 . 1.1)
(org-level-8 . 1.1)))
(set-face-attribute (car face) nil :font "Terminus" :weight 'regular :height (cdr face)))
;; Ensure that anything that should be fixed-pitch in Org files appears that way
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
(set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
(set-face-attribute 'line-number nil :inherit 'fixed-pitch)
(set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch))
(set-face-attribute (car face) nil :font "ETBookOT" :weight 'regular :height (cdr face)))
;; Set properties and scheduling faces to inherit variable-pitch and be smaller
;; Comment out these lines because mixed-pitch-mode will handle these.
(set-face-attribute 'org-property-value nil :inherit 'variable-pitch :height 150)
(set-face-attribute 'org-special-keyword nil :inherit 'variable-pitch :height 150)
(set-face-attribute 'org-scheduled-today nil :inherit 'variable-pitch :height 150)
(set-face-attribute 'org-drawer nil :inherit 'variable-pitch :height 150)
(set-face-attribute 'org-date nil :inherit 'variable-pitch :height 150)
)
(defun opal/org-mode-setup ()
;; Keep org-indent-mode and visual-line-mode enabled
(org-indent-mode)
(variable-pitch-mode 1)
(visual-line-mode 1))
(visual-line-mode 1)
;; Enable mixed-pitch-mode for better font handling
(mixed-pitch-mode 1))
(use-package org
:commands (org-capture org-agenda)
@@ -70,6 +69,8 @@
(setq org-log-done 'time)
(setq org-log-into-drawer t)
(setq org-startup-folded t)
(setq org-indent-indentation-per-level 2)
(setq org-hide-emphasis-markers t)
(setq org-agenda-files
'("~/work/work.org"))
@@ -121,8 +122,7 @@
(setq org-edit-src-content-indentation 0)
;; Set org agenda dir
(setq org-directory "~/org/")
(setq org-directory "~/documents/org/agenda")
;; Init org font setup
(opal/org-font-setup))
@@ -170,8 +170,12 @@
(browse-url-firefox link)
(message "No link to open."))))
(defun opal/my-elfeed-mark-all-read ()
(interactive)
(elfeed-untag elfeed-search-entries 'unread)
(elfeed-search-update :force)) ; redraw
(use-package elfeed
:ensure t
:bind
(("C-c e" . elfeed)
("C-c f" . opal/elfeed-open-in-firefox))
@@ -190,7 +194,7 @@
;; News
("https://thegrayzone.com/rss" news politics)
("https://multipolarista.com/rss" news politics)
("https://www.telesurenglish.net/feed/" news politics)
;;("https://www.telesurenglish.net/feed/" news politics)
("https://theintercept.com/feed/" news politics)
("https://www.dropsitenews.com/feed" news politics)
@@ -212,7 +216,7 @@
))
;; Set default search filter
(setq elfeed-search-filter "@1-month-ago +unread")
(setq elfeed-search-filter "@2-weeks-ago +unread")
;; Update feeds automatically when entering Elfeed search mode
(add-hook 'elfeed-search-mode-hook 'elfeed-update)
@@ -223,7 +227,6 @@
"gr" 'elfeed-update ;; Refresh feeds
"q" 'quit-window)) ;; Quit Elfeed
(setq create-lockfiles nil)
;; Make sure eww opens in it's own buffer
@@ -238,3 +241,13 @@
erc-kill-buffer-on-part t
erc-auto-query 'bury
erc-hide-list '("JOIN" "PART" "QUIT"))
(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*"))))