diff options
| -rw-r--r-- | custom.el | 22 | ||||
| -rw-r--r-- | early-init.el | 6 | ||||
| -rw-r--r-- | init.el | 129 |
3 files changed, 117 insertions, 40 deletions
diff --git a/custom.el b/custom.el new file mode 100644 index 0000000..5d09e6c --- /dev/null +++ b/custom.el @@ -0,0 +1,22 @@ +;;; -*- lexical-binding: t -*- +(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. + '(package-selected-packages nil) + '(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. + ) diff --git a/early-init.el b/early-init.el index af7274d..02212b2 100644 --- a/early-init.el +++ b/early-init.el @@ -1,6 +1,6 @@ ;;; early-init.el --- minimal early startup config -*- lexical-binding: t; -*- -;; Keep startup work cheap, then restore saner values from init.el. +;; Keep GC permissive during startup; init.el restores a steady-state threshold. (setq gc-cons-threshold most-positive-fixnum gc-cons-percentage 0.6) @@ -12,6 +12,8 @@ (tool-bar-mode -1) (scroll-bar-mode -1) -;; Conservative initial frame size. +;; Configure the first GUI frame before init.el runs. +(add-to-list 'default-frame-alist '(font . "JetBrains Mono-16")) +(add-to-list 'initial-frame-alist '(font . "JetBrains Mono-16")) (add-to-list 'default-frame-alist '(width . 140)) (add-to-list 'default-frame-alist '(height . 42)) @@ -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. - ) |
