diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | config/evil.el | 20 | ||||
| -rw-r--r-- | config/org.el | 86 | ||||
| -rw-r--r-- | init.el | 6 |
4 files changed, 111 insertions, 4 deletions
@@ -49,6 +49,9 @@ eshell # TAGS TAGS +# CalDAV secrets +caldav.el + # Other .cache/ .local/ diff --git a/config/evil.el b/config/evil.el index 8d745f1..0e40002 100644 --- a/config/evil.el +++ b/config/evil.el @@ -8,10 +8,22 @@ (setq evil-want-integration t) ;; Required for evil-collection (setq evil-undo-system 'undo-redo) ;; Use Emacs 28+ built-in undo-redo :config - (evil-mode 1)) -;; Restore Emacs-style C-n/C-p in insert mode for line movement -;; (define-key evil-insert-state-map (kbd "C-n") 'next-line) -;; (define-key evil-insert-state-map (kbd "C-p") 'previous-line)) + (evil-mode 1) + + ;; Cursor shapes per evil state + (setq evil-normal-state-cursor 'box + evil-motion-state-cursor 'box + evil-visual-state-cursor 'box + evil-insert-state-cursor 'bar + evil-replace-state-cursor 'hbar + evil-emacs-state-cursor 'hbar)) + +;; Terminal cursor shape support (GUI handles it natively) +(use-package evil-terminal-cursor-changer + :if (not (display-graphic-p)) + :after evil + :config + (etcc-on)) (use-package evil-collection :after evil diff --git a/config/org.el b/config/org.el new file mode 100644 index 0000000..88be8e8 --- /dev/null +++ b/config/org.el @@ -0,0 +1,86 @@ +;; Org Mode Configuration + +;; ===================================== +;; Core Org Settings +;; ===================================== + +(global-set-key (kbd "C-c a") 'org-agenda) +(global-set-key (kbd "C-c c") 'org-capture) + +(setq org-directory "~/Notes") + +;; Recursively find all .org files under ~/Notes +(setq org-agenda-files + (directory-files-recursively "~/Notes" "\\.org$")) + +;; Open agenda in column view (table) by default +(setq org-agenda-view-columns-initially t) + +;; TODO workflow states +(setq org-todo-keywords + '((sequence "TODO" "DOING" "|" "DONE"))) + +;; Log timestamp when task is marked DONE +(setq org-log-done 'time) + +;; ===================================== +;; Deadline Tracker (auto-computed) +;; ===================================== + +(defun org-update-deadline-properties () + "Update DAYS and URGENCY properties for all TODO entries with deadlines." + (interactive) + (org-map-entries + (lambda () + (let ((deadline (org-get-deadline-time (point)))) + (when deadline + (let* ((days (- (time-to-days deadline) (time-to-days (current-time)))) + (urgency (cond + ((< days 0) "OVERDUE") + ((<= days 7) "CLOSE") + (t "OK")))) + (org-set-property "DAYS" (number-to-string days)) + (org-set-property "URGENCY" urgency))))) + "/!TODO|DOING" 'file)) + +;; Auto-update when opening org files +(add-hook 'org-mode-hook + (lambda () + (when (and buffer-file-name + (string-match-p "tasks\\.org$" buffer-file-name)) + (org-update-deadline-properties)))) + +;; ===================================== +;; Org Super Agenda +;; ===================================== + +(use-package org-super-agenda + :after org + :config + (org-super-agenda-mode 1)) + +;; ===================================== +;; CalDAV Sync +;; ===================================== + +;; Load CalDAV credentials from gitignored file +(let ((caldav-secrets (expand-file-name "caldav.el" user-emacs-directory))) + (when (file-exists-p caldav-secrets) + (load caldav-secrets))) + +(use-package org-caldav + :after org + :config + (setq org-caldav-inbox "~/Notes/caldav-inbox.org" + org-caldav-files '("~/Notes/tasks.org"))) + +;; ===================================== +;; Calendar Framework (calfw) +;; ===================================== + +(use-package calfw + :commands cfw:open-calendar-buffer) + +(use-package calfw-org + :after calfw + :commands cfw:open-org-calendar) @@ -270,3 +270,9 @@ ;; ===================================== (load (expand-file-name "config/modeline.el" user-emacs-directory)) + +;; ===================================== +;; 📋 Org Mode +;; ===================================== + +(load (expand-file-name "config/org.el" user-emacs-directory)) |
