From 1678f7b2835ea84622e5bbce4a0e207e1ff060b7 Mon Sep 17 00:00:00 2001 From: kj Date: Tue, 3 May 2022 23:23:46 -0400 Subject: [PATCH] Add some prettify changes to org-mode. --- configs/org-config.el | 50 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/configs/org-config.el b/configs/org-config.el index dc78e1c..b24aa1a 100644 --- a/configs/org-config.el +++ b/configs/org-config.el @@ -8,13 +8,30 @@ ;;; Code: (defun kj/org-hook () "Configuración para el hook de 'org-mode'." + (display-line-numbers-mode 0) (variable-pitch-mode 1) (visual-line-mode 1) (visual-fill-column-mode 1) - ;; Configuración de font + ;; Configuración de fonts (set-face-attribute (car face) nil :font "Cantarell" :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-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) + + ;; Tachar los elementos "DONE" + (set-face-attribute 'org-done nil :strike-through t) + (set-face-attribute 'org-headline-done nil + :strike-through t + :foreground "light gray") + ) (use-package org @@ -32,6 +49,7 @@ (setq org-log-into-drawer t) (setq org-cycle-separator-lines -1) + ;; Identación (org-indent-mode) ;; Palabras claves del To Do de org-mode @@ -46,6 +64,26 @@ ("CANCELED" . "#aaa")) ) + + ;; Embellecer los checkbox + (add-hook 'org-mode-hook (lambda () + "Beautify Org Checkbox Symbol" + (push '("[ ]" . "☐") prettify-symbols-alist) + (push '("[X]" . "☑" ) prettify-symbols-alist) + (push '("[-]" . "❍" ) prettify-symbols-alist) + (prettify-symbols-mode))) + + ;; Tachar los checkbox marcados como terminados + (defface org-checkbox-done-text + '((t (:foreground "#71696A" :strike-through t))) + "Face for the text part of a checked org-mode checkbox.") + + (font-lock-add-keywords + 'org-mode + `(("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)" + 1 'org-checkbox-done-text prepend)) + 'append) + ;; Archivos a usarse en org-agenda (setq org-agenda-files '("~/Proyectos/ORGenda/Ideas.org" @@ -82,15 +120,9 @@ ) ) -(use-package org-superstar +(use-package org-bullets :hook - (org-mode . org-superstar-mode) - :config - (setq org-superstar-special-todo-items t) - ;; Eliminar los puntitos anteriores a un heading. - (setq org-hide-leading-stars nil) - (setq org-superstar-leading-bullet ?\s) - ) + (org-mode . org-bullets-mode)) (use-package visual-fill-column :config