dot/.config/doom/config.el

306 lines
12 KiB
EmacsLisp

;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets. It is optional.
(setq user-full-name "Phil Bajsicki"
user-mail-address "phil@bajsicki.com")
;; Doom exposes five (optional) variables for controlling fonts in Doom:
;;
;; - `doom-font' -- the primary font to use
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;; - `doom-unicode-font' -- for unicode glyphs
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
;;
;; See 'C-h v doom-font' for documentation and more examples of what they
;; accept. For example:
;;
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
;;
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
;; refresh your font settings. If Emacs still can't find your font, it likely
;; wasn't installed correctly. Font issues are rarely Doom issues!
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-one)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type 'relative)
(setq next-screen-context-lines 4)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cne" 'elgantt-open)
(global-set-key "\C-ch" 'counsel-org-link)
(define-prefix-command 'org-roam-map)
(global-set-key "\C-r" 'org-roam-map)
(define-key org-roam-map "o" 'org-roam-buffer-toggle)
(define-key org-roam-map "f" 'org-roam-node-find)
(define-key org-roam-map "i" 'org-roam-node-insert)
(define-key org-roam-map "n" 'org-roam-capture)
(define-prefix-command 'org-agenda-map)
(global-set-key "\C-a" 'org-agenda-map)
(define-key org-agenda-map "n" 'org-agenda-capture)
(define-key org-agenda-map "a" 'org-agenda)
(setq org-directory "~/enc/org/")
;; (setq org-tag-alist '2(("TBD")))
(setq org-agenda-start-day nil ;; start today
org-agenda-span '14 ;; and show only two weeks
org-agenda-dim-blocked-tasks 'invisible ;; Don't show me any blocked todos. Next actions only - doesn't work for tags searches
;; org-agenda-todo-ignore-scheduled 'future
;; org-agenda-todo-ignore-deadlines 'near
org-agenda-sorting-strategy '((agenda habit-down time-up priority-down category-keep)
(todo priority-down category-keep)
(search category-keep))
org-deadline-warning-days 3
org-agenda-include-diary "~/enc/org/phil-diary.org"
org-agenda-insert-diary-extract-time t
org-log-into-drawer t
org-clock-into-drawer t
org-agenda-log-mode-items '(closed clock state))
(setq org-agenda-files '("~/enc/org/org-agenda-files.org"))
;; from /home/phil/.emacs.d/modules/lang/org/config.el, edited
(setq org-todo-keywords
'((sequence
"INBOX(i)"
"TASK(t)" ; A task that needs doing & is ready to do
"PROJ(p)" ; A project, which usually contains other tasks
"LOOP(r)" ; A recurring task
"WAIT(w)" ; Something external is holding up this task
"HOLD(h)" ; This task is paused/on hold because of me
"|"
"DONE(d)" ; Task successfully completed
"KILL(k)") ; Task was cancelled, aborted or is no longer applicable
(sequence
"DECIDE()" ; for making decisions
"|"
"OKAY(o)" ; okay as-is
"YES(y)" ; take action
"NO(n)")) ; don't take action
org-todo-keyword-faces
'(("[-]" . +org-todo-active)
("STRT" . +org-todo-active)
("[?]" . +org-todo-onhold)
("WAIT" . +org-todo-onhold)
("HOLD" . +org-todo-onhold)
("PROJ" . +org-todo-project)
("NO" . +org-todo-cancel)
("KILL" . +org-todo-cancel)))
(setq hl-todo-keyword-faces
'(("HOLD" . "#d0bf8f")
("TODO" . "#cc9393")
("NEXT" . "#dca3a3")
("THEM" . "#dc8cc3")
("PROG" . "#7cb8bb")
("OKAY" . "#7cb8bb")
("DONT" . "#5f7f5f")
("FAIL" . "#8c5353")
("DONE" . "#afd8af")
("NOTE" . "#d0bf8f")
("KLUDGE" . "#d0bf8f")
("HACK" . "#d0bf8f")
("TEMP" . "#d0bf8f")
("FIXME" . "#cc9393")
("XXXX*" . "#cc9393")))
(add-to-list 'load-path "~/.emacs.d/.local/straight/repos/elgantt/")
(setq elgantt-header-type 'outline
elgantt-draw-overarching-headers t
elgantt-insert-header-even-if-no-timestamp nil
elgantt-scroll-to-current-month-at-startup t)
;; elgantt-even-numbered-line-change 0.1
;; elgantt-timestamps-to-display '(deadline timestamp scheduled timestamp-range)
;; elgantt-exclusions '(":noexport:" ":ARCHIVE:")
(setq elgantt-user-set-color-priority-counter 0)
(setq elgantt-custom-header-line '((:left ((:prop date-at-point
;; you could also use, for example, 'elgantt-get-date-at-point
;; or (lambda () (elgantt-get-date-at-point))
:padding 25)
(:prop todo
:padding 30)))
(:center ((:prop headline)))
(:right ((:prop hashtag
:padding 40
:text-props (face (:background "red")))))))
(setq org-superstar-special-todo-items t)
(setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/inbox.org" "Inbox") "* TODO %i%?")
("c" "work curve10" entry (file+headline "~/enc/org/inbox.org" "Curve10 Inbox") "* TODO %i%?")
("e" "work the-engine-room" entry (file+headline "~/enc/org/inbox.org" "The Engine Room Inbox") "* TODO %i%?")
("b" "biz inbox" entry (file+headline "~/enc/org/inbox.org" "Business Inbox") "* TODO %i%?")
("i" "idea" entry (file+headline "~/enc/org/inbox.org" "Ideas") "* %?")
("d" "reminder" entry (file+headline "~/enc/org/inbox.org" "Reminders") "* %i%? \n %U")
("p" "person" entry (file+headline "~/enc/org/people.org" "People")
"* %(org-contacts-template-name)
:PROPERTIES:
:EMAIL: %(org-contacts-template-email)
:PHONE: %(org-contacts-template-phone)
:ALIAS:
:NICKNAME:
:IGNORE:
:ICON:
:NOTE:
:ADDRESS:
:BIRTHDAY:
:END:")))
(org-wild-notifier-mode)
(setq org-wild-notifier-alert-time '(10))
(setq org-wild-notifier-notification-title "Emacs org-mode agenda")
(setq org-wild-notifier-keyword-whitelist nil)
;; (setq org-refile-targets '(("~/enc/org/" :maxlevel . 2)))
(setq org-refile-targets '((nil :maxlevel . 9)
(org-agenda-files :maxlevel . 9)))
(setq org-outline-path-complete-in-steps nil) ; Refile in a single go
(setq org-refile-use-outline-path t) ; Show full paths for refiling
(setq find-file-visit-truename t)
(setq org-roam-v2-ack t)
(setq org-roam-completion-everywhere t)
(setq org-roam-directory
(file-truename "~/enc/org/roam"))
(org-roam-db-autosync-mode)
(setq org-roam-capture-templates
'(("r" "default" plain
"%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)))
(org-roam-db-autosync-enable)
(setq org-contacts-files
(file-expand-wildcards "~/enc/org/*.org"))
(setq org-fontify-todo-headline t)
(setq org-footnote-section nil)
(setq org-table-duration-hour-zero-padding nil)
(setq-default org-enforce-todo-dependencies t)
(after! persp-mode
(setq persp-emacsclient-init-frame-behaviour-override "main"))
(setq doom-modeline-persp-name t)
(setq global-auto-revert-mode t)
(setq auth-sources '("~/.authinfo"))
(add-hook 'org-mode-hook
(lambda () (add-hook 'after-save-hook 'org-babel-tangle :append :local)))
(add-hook 'before-save-hook 'time-stamp)
(after! counsel
(setq counsel-outline-display-style 'title))
;; (after! org-id
;; ;; Do not create ID if a CUSTOM_ID exists
;; (setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id))
;; (defun zz/make-id-for-title (title)
;; "Return an ID based on TITLE."
;; (let* ((new-id (replace-regexp-in-string "[^[:alnum:]]" "-" (downcase title))))
;; new-id))
;; (defun zz/org-custom-id-create ()
;; "Create and store CUSTOM_ID for current heading."
;; (let* ((title (or (nth 4 (org-heading-components)) ""))
;; (new-id (zz/make-id-for-title title)))
;; (org-entry-put nil "CUSTOM_ID" new-id)
;; (org-id-add-location new-id (buffer-file-name (buffer-base-buffer)))
;; new-id))
;; (defun zz/org-custom-id-get-create (&optional where force)
;; "Get or create CUSTOM_ID for heading at WHERE.
;; If FORCE is t, always recreate the property."
;; (org-with-point-at where
;; (let ((old-id (org-entry-get nil "CUSTOM_ID")))
;; ;; If CUSTOM_ID exists and FORCE is false, return it
;; (if (and (not force) old-id (stringp old-id))
;; old-id
;; ;; otherwise, create it
;; (zz/org-custom-id-create)))))
;; ;; Now override counsel-org-link-action
;; (after! counsel
;; (defun counsel-org-link-action (x)
;; "Insert a link to X.
;; X is expected to be a cons of the form (title . point), as passed
;; by `counsel-org-link'.
;; If X does not have a CUSTOM_ID, create it based on the headline
;; title."
;; (let* ((id (zz/org-custom-id-get-create (cdr x))))
;; (org-insert-link nil (concat "#" id) (car x)))))
;; Whenever You Reconfigure A package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
;;
;; (after! PACKAGE
;; (setq x y))
;;
;; The exceptions to this rule:
;;
;; - Setting file/directory variables (like `org-directory')
;; - Setting variables which explicitly tell you to set them before their
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
;; - Setting doom variables (which start with 'doom-' or '+').
;;
;; Here are some additional functions/macros that will help you configure Doom.
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To getinformation about an y of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
;; etc).
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.