summaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
authorSzymon Szukalski <szymon@szymonszukalski.com>2026-04-11 10:57:04 +1000
committerSzymon Szukalski <szymon@szymonszukalski.com>2026-04-11 10:57:04 +1000
commit5aec212e07911081430e99fe03db975bb97c7a38 (patch)
treedd49dc3ec3632e706e114ea1481d1a15b893a1ee /init.el
parent9825da1ef3e61d45b0a50586ec619d5045fe3a2b (diff)
Refine Org workflow config
Diffstat (limited to 'init.el')
-rw-r--r--init.el129
1 files changed, 91 insertions, 38 deletions
diff --git a/init.el b/init.el
index 0b96d15..cdd77b5 100644
--- a/init.el
+++ b/init.el
@@ -8,6 +8,10 @@
(setq org-directory (expand-file-name "~/org"))
(setq org-default-notes-file (expand-file-name "obtf.org" org-directory))
+(setq custom-file
+ (expand-file-name "custom.el"
+ (file-name-directory
+ (or load-file-name user-init-file default-directory))))
;; --------------------------------------------------
;; Startup: agenda as modal view
@@ -15,9 +19,12 @@
(setq initial-buffer-choice
(lambda ()
- (org-agenda nil "a")
- (delete-other-windows)
- (current-buffer)))
+ (require 'org-agenda)
+ (if org-agenda-files
+ (progn
+ (org-agenda nil "h")
+ (current-buffer))
+ (get-buffer-create "*scratch*"))))
;; --------------------------------------------------
;; Package bootstrap
@@ -32,38 +39,77 @@
(package-initialize)
-(unless package-archive-contents
- (package-refresh-contents))
-
(dolist (pkg '(vertico marginalia orderless consult modus-themes olivetti))
(unless (package-installed-p pkg)
+ (unless package-archive-contents
+ (package-refresh-contents))
(package-install pkg)))
(require 'use-package)
(setq use-package-always-ensure t)
+(use-package git-auto-commit-mode
+ :pin melpa
+ :commands (git-auto-commit-mode)
+ :init
+ (setq gac-shell-and
+ (if (string-match-p "fish\\'" shell-file-name)
+ " ; and "
+ " && ")))
+
;; --------------------------------------------------
;; UI
;; --------------------------------------------------
(setq inhibit-startup-message t
inhibit-startup-screen t
- ring-bell-function #'ignore)
+ auto-save-default nil
+ backup-inhibited t
+ compilation-ask-about-save nil
+ echo-keystrokes 0.1
+ enable-recursive-minibuffers t
+ gc-cons-threshold (* 128 1024 1024)
+ mouse-wheel-follow-mouse t
+ mouse-wheel-progressive-speed nil
+ mouse-wheel-scroll-amount '(1 ((shift) . 1))
+ process-adaptive-read-buffering nil
+ read-process-output-max (* 4 1024 1024)
+ ring-bell-function #'ignore
+ scroll-conservatively 101
+ scroll-margin 2
+ scroll-preserve-screen-position t
+ scroll-step 1)
(column-number-mode 1)
(show-paren-mode 1)
+(global-auto-revert-mode 1)
+(delete-selection-mode 1)
+(defalias 'yes-or-no-p 'y-or-n-p)
+
+(setq-default abbrev-mode t
+ fill-column 80
+ indent-tabs-mode nil
+ indicate-empty-lines t
+ sentence-end-double-space nil
+ tab-width 2)
+
+(when (file-readable-p abbrev-file-name)
+ (quietly-read-abbrev-file))
(when (display-graphic-p)
(tool-bar-mode -1)
(scroll-bar-mode -1)
- (set-face-attribute 'default nil :font "JetBrains Mono" :height 120))
+ ;; Reapply the startup frame font to the selected GUI frame.
+ (let ((font (alist-get 'font default-frame-alist)))
+ (when font
+ (set-face-attribute 'default t :font font))))
(use-package modus-themes
:config
(load-theme 'modus-vivendi t))
(use-package olivetti
- :hook (org-mode . olivetti-mode)
+ :bind (("C-c z" . olivetti-mode))
:config
(setq olivetti-body-width 100))
@@ -94,15 +140,39 @@
: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"))
+ :init
+ (setq org-agenda-files
+ (delq nil (list (and (file-exists-p org-default-notes-file)
+ org-default-notes-file)))
+ org-agenda-custom-commands
+ '(("h" "Home"
+ ((agenda ""
+ ((org-agenda-overriding-header ":: THIS WEEK ::")))
+ (todo "TODO"
+ ((org-agenda-overriding-header ":: TASKS ::")))
+ (todo "CLARIFY"
+ ((org-agenda-overriding-header ":: OPEN QUESTIONS ::")))
+ (tags "CATEGORY=\"inbox\"+LEVEL>1"
+ ((org-agenda-overriding-header ":: REFILE ::"))))))
+ org-agenda-window-setup 'only-window
+ org-startup-folded 'overview
+ org-cycle-hide-drawer-startup t
+ org-todo-keywords
+ '((sequence "TODO" "CLARIFY" "|" "DONE"))
+ org-use-speed-commands t
+ org-refile-use-outline-path 'file
+ org-outline-path-complete-in-steps nil
+ org-refile-targets '((org-agenda-files :maxlevel . 2))
+ org-id-link-to-org-use-id nil
+ org-special-ctrl-a/e t
+ org-insert-heading-respect-content t
org-log-done 'time
org-log-into-drawer t)
- ;; modal capture
+ :config
+ ;; Keep capture modal in the current window.
(add-to-list 'display-buffer-alist
- '("\*Org Capture\*" (display-buffer-same-window)))
+ '("\\*Org Capture\\*" (display-buffer-reuse-window display-buffer-same-window)))
(add-hook 'org-capture-mode-hook
(lambda () (delete-other-windows))))
@@ -114,15 +184,15 @@
(setq org-capture-templates
`(("i" "Inbox" entry
(file+headline ,org-default-notes-file "Inbox")
- "* %?\n")
+ "* %?\n:PROPERTIES:\n:CAPTURED: %U\n:END:\n%a\n")
("t" "Task" entry
(file+headline ,org-default-notes-file "Tasks")
- "* TODO %?\n")
+ "* TODO %?\n:PROPERTIES:\n:CAPTURED: %U\n:END:\n%a\n")
("q" "Question" entry
(file+headline ,org-default-notes-file "Questions")
- "* CLARIFY %?\n")
+ "* CLARIFY %?\n:PROPERTIES:\n:CAPTURED: %U\n:END:\n%a\n")
("m" "Meeting" entry
(file+headline ,org-default-notes-file "Meetings")
@@ -130,26 +200,9 @@
("r" "Recurring" entry
(file+headline ,org-default-notes-file "Recurring")
- "* TODO %?\nSCHEDULED: %^t\n")))
+ "* TODO %?\n:PROPERTIES:\n:CAPTURED: %U\n:END:\nSCHEDULED: %^t\n")))
+
+;; Load Custom state last so Customize values can override defaults above.
+(load custom-file t)
(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.
- )