dotfiles/emacs/+org.el

101 lines
3.0 KiB
EmacsLisp

;;; +org.el -*- lexical-binding: t; -*-
(require 'org)
(custom-set-variables '(org-directory "~/org/"))
(setq
deft-directory org-directory
org-download-image-dir (concat org-directory "resources")
org-roam-directory org-directory)
(setq org-agenda-files (list
(concat org-directory "work/todo.org")
(concat org-directory "todo.org")
)
)
;(org-agenda-files (file-expand-wildcards (concat org-directory "*". )"~/ref/*.org")
;; Automatically Scan normal locations code for projectes.
;; - `src` is used on my linux machine
;; - `Code` is used on my mac machine
;; - `opt` is used on my where I checkout, and compile, and complain about it
;; not running right, but refuse to the the documentation.
(require 'seq)
(setq projectile-project-search-path
(seq-filter 'file-directory-p '("~/src" "~/Code" "~/opt")))
;; Make sort reasonable.
(setq projectile-sort-order 'access-time)
;; recursive search for deft
(setq deft-recursive t)
; Enable word wrap
(add-hook 'org-mode-hook #'visual-line-mode)
;Custom bullets
(setq org-superstar-headline-bullets-list '("" "" "" "" "" "" "" "" ""))
;; allow md export
(eval-after-load "org" '(require 'ox-md nil t))
;; org-journal-file-format
(customize-set-variable 'org-journal-date-format "%A, %d %B %Y")
;;; Making OrgMode it better looking
; User Mix Pitch Mode for orgmode
(add-hook! 'org-mode-hook #'+org-pretty-mode #'mixed-pitch-mode)
; Add Padding
(add-hook 'org-mode-hook (lambda ()
"Add padding left and right margins to orgmode"
(display-line-numbers-mode -1)
;(text-scale-set 2)
(setq left-margin-width 2)
(setq right-margin-width 2)
(set-window-buffer nil (current-buffer))))
(custom-set-faces!
'(default :height 1)
'(org-document-title :height 2.2))
(setq org-agenda-deadline-faces
'((1.001 . error)
(1.0 . org-warning)
(0.5 . org-upcoming-deadline)
(0.0 . org-upcoming-distant-deadline)))
;; Use appear to make org syntax easier to not fuck up.
;(use-package! org-appear
; :hook (org-mode . org-appear-mode)
; :config
; (setq org-appear-autoemphasis t
; org-appear-autosubmarkers t
; org-appear-autolinks nil)
; ;; for proper first-time setup, `org-appear--set-elements'
; ;; needs to be run after other hooks have acted.
; (run-at-time nil nil #'org-appear--set-elements))
;; Added Org-mode
(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)))
;;; Org-Agenda Options
(use-package! org-super-agenda
:commands (org-super-agenda-mode))
(after! org-agenda
(org-super-agenda-mode))
(setq org-agenda-skip-scheduled-if-done t
org-agenda-skip-deadline-if-done t
org-agenda-include-deadlines t
org-agenda-block-separator nil
org-agenda-tags-column 100 ;; from testing this seems to be a good value
org-agenda-compact-blocks t)