;;; init.el --- minimal single-file Org workflow -*- lexical-binding: t; -*- ;;; Code: ;; -------------------------------------------------- ;; Core paths ;; -------------------------------------------------- (setq org-directory (expand-file-name "~/org")) (setq org-default-notes-file (expand-file-name "obtf.org" org-directory)) ;; -------------------------------------------------- ;; Startup: agenda as modal view ;; -------------------------------------------------- (setq initial-buffer-choice (lambda () (org-agenda nil "a") (delete-other-windows) (current-buffer))) ;; -------------------------------------------------- ;; Package bootstrap ;; -------------------------------------------------- (require 'package) (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") ("nongnu" . "https://elpa.nongnu.org/nongnu/") ("melpa" . "https://melpa.org/packages/"))) (package-initialize) (unless package-archive-contents (package-refresh-contents)) (dolist (pkg '(vertico marginalia orderless consult modus-themes olivetti)) (unless (package-installed-p pkg) (package-install pkg))) (require 'use-package) (setq use-package-always-ensure t) ;; -------------------------------------------------- ;; UI ;; -------------------------------------------------- (setq inhibit-startup-message t inhibit-startup-screen t ring-bell-function #'ignore) (column-number-mode 1) (show-paren-mode 1) (when (display-graphic-p) (tool-bar-mode -1) (scroll-bar-mode -1) (set-face-attribute 'default nil :font "JetBrains Mono" :height 120)) (use-package modus-themes :config (load-theme 'modus-vivendi t)) (use-package olivetti :hook (org-mode . olivetti-mode) :config (setq olivetti-body-width 100)) ;; -------------------------------------------------- ;; Completion ;; -------------------------------------------------- (use-package vertico :init (vertico-mode 1)) (use-package marginalia :init (marginalia-mode 1)) (use-package orderless :init (setq completion-styles '(orderless basic))) (use-package consult :bind (("C-s" . consult-line) ("C-c o" . consult-outline))) ;; -------------------------------------------------- ;; Org ;; -------------------------------------------------- (use-package org :ensure nil :bind (("C-c c" . org-capture) ("C-c a" . org-agenda) ("C-c r" . org-refile)) :config (setq org-agenda-files (list org-default-notes-file) org-todo-keywords '((sequence "TODO" "CLARIFY" "|" "DONE")) org-log-done 'time org-log-into-drawer t) ;; modal capture (add-to-list 'display-buffer-alist '("\*Org Capture\*" (display-buffer-same-window))) (add-hook 'org-capture-mode-hook (lambda () (delete-other-windows)))) ;; -------------------------------------------------- ;; Capture templates ;; -------------------------------------------------- (setq org-capture-templates `(("i" "Inbox" entry (file+headline ,org-default-notes-file "Inbox") "* %?\n") ("t" "Task" entry (file+headline ,org-default-notes-file "Tasks") "* TODO %?\n") ("q" "Question" entry (file+headline ,org-default-notes-file "Questions") "* CLARIFY %?\n") ("m" "Meeting" entry (file+headline ,org-default-notes-file "Meetings") "* %<%H:%M> %?\n<%<%Y-%m-%d %a %H:%M>>\n") ("r" "Recurring" entry (file+headline ,org-default-notes-file "Recurring") "* TODO %?\nSCHEDULED: %^t\n"))) (provide 'init) (custom-set-variables ;; custom-set-variables was added by Custom. ;; 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. '(safe-local-variable-values '((eval progn (setq-local gac-automatically-add-new-files-p t gac-automatically-push-p t gac-debounce-interval 2 gac-default-message (lambda (_filename) (format-time-string "Auto-commit: %Y-%m-%d %H:%M:%S"))) (git-auto-commit-mode 1))))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; 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. )