125 lines
3.6 KiB
EmacsLisp
125 lines
3.6 KiB
EmacsLisp
;;; earnemod-org.el --- org-mode -*- lexical-binding: t; -*-
|
|
|
|
;; Copyright (C) 2020-2021 earnest ma
|
|
;; SPDX-License-Identifier: MIT
|
|
;; Author: earnest ma <me@earne.link>
|
|
|
|
;;; Code:
|
|
(use-package org
|
|
;; Use built-in org
|
|
:straight nil
|
|
|
|
:general
|
|
(earnemacs-spc-def
|
|
"oA" 'org-agenda
|
|
"oC" 'org-capture)
|
|
:config
|
|
;; Default directory containing org-mode files
|
|
(setq org-directory "~/org/")
|
|
|
|
;; Enable modules
|
|
(add-to-list 'org-modules 'org-habit)
|
|
|
|
;; Hooks:
|
|
;; Indent correctly
|
|
(add-hook 'org-mode-hook 'org-indent-mode)
|
|
;; Visual wrapping
|
|
(add-hook 'org-mode-hook 'visual-line-mode)
|
|
;; Table of contents generation
|
|
(add-hook 'org-mode-hook 'toc-org-mode)
|
|
;; Use sans-serif font
|
|
(add-hook 'org-mode-hook 'variable-pitch-mode)
|
|
|
|
;; Set indenting as default
|
|
(setq-default org-indent-mode t)
|
|
|
|
;; use org-mode + doom-themes improvements
|
|
(doom-themes-org-config)
|
|
|
|
;; Variable pitch and heading
|
|
(custom-theme-set-faces
|
|
;; <3 https://zzamboni.org/post/beautifying-org-mode-in-emacs/
|
|
'user
|
|
'(org-block ((t (:inherit fixed-pitch))))
|
|
'(org-code ((t (:inherit fixed-pitch))))
|
|
'(org-document-info-keyword ((t (:inherit (shadow fixed-pitch)))))
|
|
'(org-indent ((t (:inherit (org-hide fixed-pitch)))))
|
|
'(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch)))))
|
|
'(org-property-value ((t (:inherit fixed-pitch))) t)
|
|
'(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch)))
|
|
t))
|
|
'(org-table ((t (:inherit fixed-pitch))))
|
|
'(org-tag ((t (:inherit (shadow fixed-pitch) :weight bold :height 0.8))))
|
|
'(org-verbatim ((t (:inherit (shadow fixed-pitch))))))
|
|
|
|
:custom
|
|
;; Set number of lines between headings to display empty lines to 1
|
|
(org-cycle-separator-lines 1)
|
|
|
|
;; Set default table formatting
|
|
(org-columns-set-default-format
|
|
"80ITM(Task) %10Effort(Effort){:} %10CLOCKSUM(Timed)")
|
|
|
|
;; Enforce todo dependencies
|
|
(org-enforce-todo-dependencies t)
|
|
|
|
(org-global-properties (quote (
|
|
;; Set default Effort properties
|
|
("Effort_ALL" . "0:05 0:10 0:15 0:20
|
|
0:30 0:45 1:00 1:30 2:00 4:00 6:00 8:00"))))
|
|
|
|
;; Drawer names
|
|
(org-log-into-drawer "LOGBOOK")
|
|
(org-clock-into-drawer "CLOCKING")
|
|
|
|
;; Do not set state triggers when using Shift to change states
|
|
(org-treat-S-cursor-todo-selection-as-state-change nil)
|
|
|
|
;; Log time when task marked as DONE
|
|
(org-log-done 'time)
|
|
|
|
;; Log note and time when rescheduling or redeadlining
|
|
(org-log-reschedule 'note)
|
|
(org-log-redeadline 'note)
|
|
|
|
;; Only show today's habits
|
|
(org-habit-show-habits-only-for-today t))
|
|
|
|
(use-package org-agenda
|
|
:after org
|
|
:straight nil
|
|
:bind (("C-c a" . org-agenda))
|
|
:custom
|
|
(org-agenda-window-setup 'other-window)
|
|
(org-agenda-restore-windows-after-quit 't)
|
|
(org-agenda-dim-blocked-tasks t)
|
|
(org-agenda-span 4)
|
|
(org-agenda-start-on-weekday nil)
|
|
(org-agenda-start-day "-1d")
|
|
(org-agenda-skip-deadline-prewarning-if-scheduled 'pre-scheduled)
|
|
(org-agenda-skip-deadline-if-done nil)
|
|
(org-agenda-skip-scheduled-if-done nil))
|
|
|
|
(use-package org-capture
|
|
:after org
|
|
:straight nil
|
|
:bind (("C-c c" . org-capture))
|
|
:custom
|
|
;; Base capture templates
|
|
(org-capture-templates
|
|
`(("t" "Task" entry (file, "~/org/refile.org")
|
|
"* TODO %^{Task}\n:PROPERTIES:\n- Added: %U\n:END:"
|
|
:empty-lines 1 :immediate-finish t :clock-resume :kill-buffer))))
|
|
|
|
(use-package ox-ssh)
|
|
|
|
(use-package toc-org)
|
|
|
|
(use-package zpresent
|
|
:config
|
|
;; Set default state to Emacs
|
|
(evil-set-initial-state 'zpresent-mode 'emacs))
|
|
|
|
(provide 'earnemod-org)
|
|
;;; earnemod-org.el ends here
|