From b2933f2b4a362dd17f435c5f9dbd1528fdd32da1 Mon Sep 17 00:00:00 2001 From: Phil Bajsicki Date: Thu, 19 Sep 2024 11:26:26 +0200 Subject: [PATCH] Big cleanup --- .config/doom/README.org | 1990 +++++++++++++------------------------ .config/doom/config.el | 767 ++++++-------- .config/doom/init.el | 32 +- .config/doom/packages.el | 32 +- .config/xmonad/README.org | 2 +- .config/xmonad/xmonad.hs | 2 +- 6 files changed, 969 insertions(+), 1856 deletions(-) diff --git a/.config/doom/README.org b/.config/doom/README.org index 8bb2235..f574b4f 100644 --- a/.config/doom/README.org +++ b/.config/doom/README.org @@ -1,7 +1,11 @@ #+Title: Phil's Doom Emacs Config #+STARTUP: indent +#+auto_tangle: t * Intro +:PROPERTIES: +:ID: de888450-40a6-4255-81dc-e6e65a9cf07c +:END: This is my personal [[https://github.com/doomemacs/doomemacs][Doom Emacs]] config. The important bit is that I have some additional keybinds. This file is a catch-all for all the files in $DOOMDIR - you can use ~org-babel-tangle~ to tangle them into their respective files. @@ -16,29 +20,35 @@ A lot of these are swiped from [[https://gitlab.com/dwt1/configuring-emacs/][DT' *** Author/ personal info #+begin_src emacs-lisp :tangle config.el (setq user-full-name "Phil Bajsicki") - #+end_src *** Global settings +- ~backup-inhibited~ is true because I use git for the vast majority of my work. +- ~global-auto-revert-mode~ is true because I sometimes use external tools on my + org-files, and don't want to have to manually ~revert-buffer~ when these changes + happen. Mild inconvenience but it's nice to have. +- ~indent-tabs-mode~ because that's what tabs are for. #+begin_src emacs-lisp :tangle config.el -;; must be set before `org` is loaded -(setq org-directory "~/enc/org/") -(setq org-agenda-files (directory-files-recursively "~/enc/org/" ".org$"))1 - -(setq global-auto-revert-mode t) -(setq auth-sources '("~/.authinfo")) (setq-default backup-inhibited t) +(setq global-auto-revert-mode t) +(setq-default indent-tabs-mode t) +#+end_src +Ensure visited files are called by their true names. Kinda insignificant but nice. +#+begin_src emacs-lisp :tangle config.el +(setq find-file-visit-truename t) +#+end_src +**** Auth +#+begin_src emacs-lisp :tangle config.el +(setq auth-sources '("~/.authinfo")) +#+end_src +**** Locale +#+begin_src elisp :tangle config.el (setq locale-coding-system 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (set-clipboard-coding-system 'utf-8) (prefer-coding-system 'utf-8) -(setq-default indent-tabs-mode t) -#+END_SRC - -#+RESULTS: -: t - +#+end_src *** Langtool Note that for this functionality you do need some resources, namely: @@ -50,21 +60,48 @@ This command only sets up the path to your java runtime binary. (setq langtool-java-bin "/usr/bin/java") #+end_src -#+RESULTS: -: /usr/bin/java - *** Theming and prettifying #+begin_src emacs-lisp :tangle config.el (after! counsel (setq counsel-outline-display-style 'title)) #+end_src **** Doom Theme +¯\_(ツ)_/¯ #+begin_src emacs-lisp :tangle config.el (load-theme 'doom-one t) (doom-themes-neotree-config) (doom-themes-org-config) #+end_src +**** org-modern +Just some bits here that affect the entirety of Emacs; the parts relevant to +org-mode specifically are in [[*Appearance and style][org's appearance section.]] + +This part removes all the unnecessary bits that take up screen space and add clutter. +#+begin_src elisp :tangle config.el +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) +#+end_src +Then fixing up some borders and dividers. It's a very clean look, imo. +#+begin_src elisp :tangle config.el +(modify-all-frames-parameters + '((right-divider-width . 0) + (internal-border-width . 0))) +(dolist (face '(window-divider + window-divider-first-pixel + window-divider-last-pixel)) + (face-spec-reset-face face) + (set-face-foreground face (face-attribute 'default :background))) +(set-face-background 'fringe (face-attribute 'default :background)) +#+end_src +**** Transparency +¯\_(ツ)_/¯ +#+begin_src emacs-lisp :tangle config.el +(set-frame-parameter nil 'alpha-background 85) +(add-to-list 'default-frame-alist '(alpha-background . 85)) +#+end_src **** Fonts +To be entirely fair, I pretty much exclusively use Iosevka. Such a good font. #+begin_src emacs-lisp :tangle config.el (setq doom-themes-enable-bold t doom-themes-enable-italic t @@ -79,17 +116,15 @@ This command only sets up the path to your java runtime binary. ;; (set-face-attribute 'org-modern-symbol nil :family "Iosevka") #+end_src -#+RESULTS: -: # - - -**** Font Family List +***** Font Family List This is a simple command that outputs the fonts you have available in Emacs. +Not really a config thing, but it's useful when trying to find out why that one +specific thing isn't showing correctly. #+begin_src emacs-lisp :results value format: pp :tangle no (print (font-family-list)) #+end_src -**** Ligature.el +***** Ligature.el #+begin_src emacs-lisp :tangle config.el (ligature-set-ligatures 't '("www")) ;; Enable traditional ligature support in eww-mode, if the @@ -115,27 +150,16 @@ This is a simple command that outputs the fonts you have available in Emacs. #+end_src -**** Transparency -#+begin_src emacs-lisp :tangle config.el -(set-frame-parameter nil 'alpha-background 85) -(add-to-list 'default-frame-alist '(alpha-background . 85)) -#+end_src **** Helpers for text editing #+begin_src emacs-lisp :tangle config.el -(setq display-line-numbers-type 'relative) -(setq next-screen-context-lines 4) +(setq display-line-numbers-type 'relative) ;; best honestly (setq-default global-visual-line-mode t) -(setq x-stretch-cursor t) (setq column-number-mode t) +(setq next-screen-context-lines 4) +(setq x-stretch-cursor t) #+end_src -*** set start of week to Monday (not sunday) http://sunsite.univie.ac.at/textbooks/emacs/emacs_33.html -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq-default calendar-week-start-day 1) -#+END_SRC - ** Global Keybinds Setting this here because I experiment with these occasionally and want them reset properly eaach time. - #+begin_src emacs-lisp :tangle config.el (global-set-key "\C-g" 'keyboard-quit) (global-set-key "\C-cu" 'browse-url-chrome) @@ -143,246 +167,305 @@ Setting this here because I experiment with these occasionally and want them res ** Package settings *** Straight +Living on the edge. Honestly I probably should not... but then I do find joy in +fixing up my config... #+begin_src emacs-lisp :tangle config.el (setq straight-repository-branch "develop") #+end_src -*** [disabled] copilot.el -#+begin_src emacs-lisp :tangle no -;; accept completion from copilot and fallback to company -(use-package! copilot - :hook (prog-mode . copilot-mode) - :bind (:map copilot-completion-map - ("" . 'copilot-accept-completion) - ("TAB" . 'copilot-accept-completion) - ("C-TAB" . 'copilot-accept-completion-by-word) - ("C-" . 'copilot-accept-completion-by-word))) -#+end_src -*** pdf-tools -#+begin_src emacs-lisp :tangle config.el -(use-package! pdf-tools - :defer t - :commands (pdf-loader-install) - :mode "\\.pdf\\'" - :bind (:map pdf-view-mode-map - ("n" . pdf-view-next-line-or-next-page) - ("p" . pdf-view-previous-line-or-previous-page) - ("C-=" . pdf-view-enlarge) - ("C--" . pdf-view-shrink)) - :init (pdf-loader-install) - :config (add-to-list 'revert-without-query ".pdf")) - -(add-hook 'pdf-view-mode-hook #'(lambda () (interactive (display-line-numbers-mode)))) - -#+end_src - -#+RESULTS: -| doom--setq-evil-normal-state-cursor-for-pdf-view-mode-h | (lambda nil (interactive (display-line-numbers-mode))) | pdf-tools-enable-minor-modes | - -*** emojify-mode -#+begin_src emacs-lisp :tangle no -(global-emojify-mode) -(global-emojify-mode-line-mode) -#+end_src - *** org-mode -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! -Make .org file automatically open in org-mode. -**** org - -***** Basic settings +I am including pretty much everything here, *mostly* sorted by package, but I'm +keeping org-mode and org-agenda together since they're virtually inseparable in +my mind. +**** Basic settings #+begin_src emacs-lisp :tangle config.el +;; must be set before `org` is loaded + (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) -(setq org-image-actual-width nil) -(setq org-enforce-todo-dependencies t) -(setq org-reverse-note-order nil) -(setq org-deadline-warning-days 7) -(setq org-blank-before-new-entry (quote ((heading . t) - (plain-list-item . nil)))) -(setq org-num-mode t) -(setq org-todo-repeat-to-state "LOOP") -(setq org-remove-highlights-with-change nil) +(setq-default calendar-week-start-day 1) +#+end_src +****** Directories and structure +Basic directory set-up for org-mode +#+begin_src elisp :tangle config.el +(setq org-contacts-files '("~/enc/org/people.org")) +(setq org-directory "~/enc/org/") +#+end_src +Agenda files +#+begin_src elisp :tangle config.el +(setq org-agenda-files (directory-files-recursively "~/enc/org/" ".org$"))1 +#+end_src +=org-refile= targets. I just want to see nearly everything. If something is more +than 9 levels deep then I should start questioning my sanity. I do want to go +step by step on these (~org-outline-path-complete-in-steps~ controls this), since +I have /a lot/ of information collected. +#+begin_src emacs-lisp :tangle config.el +(setq org-refile-targets '((nil :maxlevel . 9) + (org-agenda-files :maxlevel . 9))) +(setq org-outline-path-complete-in-steps nil) +(setq org-refile-use-outline-path 'file) +#+end_src +****** Appearance and style +Keeps images contained on the screen. +#+begin_src elisp :tangle config.el +(setq org-image-actual-width '(0.8)) +#+end_src + +Pretty! +#+begin_src emacs-lisp config.el +(setq org-superstar-headline-bullets-list + '("⁖" "◉" "○" "✸" "✿") + org-hide-emphasis-markers t + org-pretty-entities t + org-fontify-todo-headline t + org-hide-leading-stars t) +#+end_src +Code highlighting in code blocks! +#+begin_src emacs-lisp +(setq org-src-fontify-natively t) +#+end_src +Naturally, I prefer to have a consistent look in my numbers. +#+begin_src emacs-lisp config.el +(setq org-table-duration-hour-zero-padding t) +#+end_src +Tags flush right to the 80th column, and realign them when the length/ +indentation of the heading changes. +#+begin_src emacs-lisp config.el +(setq org-tags-column -80 + org-auto-align-tags t) +#+end_src +And, enable org-modern-mode by default, since it's nice. +#+begin_src emacs-lisp :tangle config.el +(global-org-modern-mode) +#+end_src + +****** Editing and comfort +It's preferable to have org guess dates in the future when scheduling. +#+begin_src elisp :tangle config.el (setq org-read-date-prefer-future t) +#+end_src +This makes the notes I take read like a book. I can /imagine/ there's folks who +enjoy reversing their notes and having the most recent at the top but... no. +Just no. +#+begin_src elisp :tangle config.el +(setq org-reverse-note-order nil) +#+end_src +This one really annoyed me for a long time, until I just gave up. There is no +better way to have more vertical space in my files than by just... not wasting +more space between headings and list items. +#+begin_src elisp :tangle config.el +(setq org-blank-before-new-entry (quote ((heading . nil) + (plain-list-item . nil)))) +#+end_src +This is something I struggled with, particularly when dealing with lots of +nested headings; ultimately I have settled on 'smart' as 'good enough'. May move +to 'nil' at some point? +#+begin_src elisp :tangle config.el +(setq org-catch-invisible-edits "smart") +#+end_src +Special functions for headings. +#+begin_src elisp :tangle config.el (setq org-special-ctrl-a/e t) (setq org-special-ctrl-k t) +#+end_src +This fits the yanked subtree into the appropriate level in the structure it's +yanked into. +#+begin_src elisp :tangle config.el (setq org-yank-adjusted-subtrees t) -(setq org-M-RET-may-split-line (quote (default . t))) -(setq org-log-done (quote time)) -(setq org-log-into-drawer t) -(setq org-catch-invisible-edits "smart") -(setq org-use-property-inheritance nil) -(setq org-duration-format 'h:mm) -(setq org-hierarchical-todo-statistics t) #+end_src - -#+RESULTS: -: t -***** my-org-tree-to-indirect-buffer -#+begin_quote -This beautiful piece of code was done by [[https://www.reddit.com/user/github-alphapapa][alphapapa]] and published on -[[https://www.reddit.com/r/orgmode/comments/dbsngi/finally_solving_the_lack_of_a_treeview_navigation/f26qpzr/][reddit]]. Its purpose is to provide more than one indirect buffer when -using =org-tree-to-indirect-buffer()= (via ~C-c C-x b~). Further more, -it has a different way of naming these buffers. - -Using an advice, the original function gets overwritten. -#+end_quote ---Karl Voit - -#+BEGIN_SRC emacs-lisp :tangle config.el -(defun my-org-tree-to-indirect-buffer (&optional arg) - "Create indirect buffer and narrow it to current subtree. -The buffer is named after the subtree heading, with the filename -appended. If a buffer by that name already exists, it is -selected instead of creating a new buffer." - (interactive "P") - (let* ((new-buffer-p) - (pos (point)) - (buffer-name (let* ((heading (org-get-heading t t)) - (level (org-outline-level)) - (face (intern (concat "outline-" (number-to-string level)))) - (heading-string (propertize (org-link-display-format heading) - 'face face))) - (concat heading-string "::" (buffer-name)))) - (new-buffer (or (get-buffer buffer-name) - (prog1 (condition-case nil - (make-indirect-buffer (current-buffer) buffer-name 'clone) - (error (make-indirect-buffer (current-buffer) buffer-name))) - (setq new-buffer-p t))))) - (switch-to-buffer new-buffer) - (when new-buffer-p - ;; I don't understand why setting the point again is necessary, but it is. - (goto-char pos) - (rename-buffer buffer-name) - (org-narrow-to-subtree)))) - -(advice-add 'org-tree-to-indirect-buffer :override 'my-org-tree-to-indirect-buffer) -#+END_SRC - - -***** my-org-retrieve-url-from-point → C-c o -#+begin_quote -I wanted a function that does not open an web URL within Org mode (via -=C-c C-o=) but rather copies its URL to the system clipboard for -non-Emacs apps to paste. - -Lucky me, I found the ready-to-use solution [[https://emacs.stackexchange.com/a/3990][on this page]] which I bind to previously unused =C-c o=: -#+end_quote ---Karl Voit - -#+BEGIN_SRC emacs-lisp :tangle no -(defun my-org-retrieve-url-from-point () - (interactive) - (let* ((link-info (assoc :link (org-context))) - (text (when link-info - ;; org-context seems to return nil if the current element - ;; starts at buffer-start or ends at buffer-end - (buffer-substring-no-properties (or (cadr link-info) (point-min)) - (or (caddr link-info) (point-max)))))) - (if (not text) - (error "Not in org link") - (add-text-properties 0 (length text) '(yank-handler (my-yank-org-link)) text) - (kill-new text)))) -#+END_SRC - -#+BEGIN_SRC emacs-lisp :tangle no -(global-set-key (kbd "C-c o") 'my-org-retrieve-url-from-point) -#+END_SRC -***** org-element cache verification -2022-01-16: This has a positive impact on the performance as long as -you would not need it for consistency warnings. Re-enable it if -something is fishy and you want the self-check functionality again. - -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-element--cache-self-verify nil) -#+END_SRC - -#+RESULTS: - -***** Theming -:PROPERTIES: -:ID: b663a9ef-f08e-436f-913d-98e4234cf2cd -:END: -#+begin_src emacs-lisp config.el -(setq org-fontify-todo-headline t) +I like being able to split lines sometimes, especially when cleaning up large +pieces of text. +#+begin_src elisp :tangle config.el +(setq org-M-RET-may-split-line '((headline . t) + (item . t) + (default . nil))) +#+end_src +This ensures that I can insert my headings anywhere without having to consider +structure; particularly useful when I'm breaking large pieces of text into +headings, and don't want to jiggle things around much. +#+begin_src elisp :tangle config.el +(setq org-insert-heading-respect-content nil) +#+end_src +Keep the footnotes per heading, instead of per file; when =t=, it'll create a +footnote heading at the end of the file and that's a pain when dealing with +large files. +#+begin_src elisp :tangle config.el (setq org-footnote-section nil) -(setq org-table-duration-hour-zero-padding nil) -(setq org-superstar-headline-bullets-list - '("⁖" "◉" "○" "✸" "✿")) -(setq org-use-property-inheritance '(category columns archive logging)) #+end_src -https://www.emacswiki.org/emacs/TruncateLines =M-x toggle-truncate-lines= -#+BEGIN_SRC emacs-lisp -;; (setq-default truncate-lines t) -(setq org-src-fontify-natively t) -(setq org-hide-leading-stars t) - - -#+END_SRC - -****** Set the width of inline images: -#+BEGIN_SRC emacs-lisp :tangle config.el - (setq org-image-actual-width '(600)) -#+END_SRC - -****** org-modern +****** Logging and Properties +Logging into a drawer. +#+begin_src elisp :tangle config.el +(setq org-log-done (quote time) + org-log-into-drawer t + org-clock-into-drawer t) +#+end_src +Do not log inserting the TODO heading for the first time; only when further +changes are made to the heading. +#+begin_src elisp :tangle config.el +(setq org-treat-insert-todo-heading-as-state-change nil) +#+end_src +Property inheritance is... difficult. I don't believe it has a place in my +world, but I can see specific scenarios where it would. Haven't found one myself +yet, despite experimenting. +#+begin_src elisp :tangle config.el +(setq org-use-property-inheritance nil) +;;(setq org-use-property-inheritance '(category columns archive logging)) +#+end_src +****** Tasking and Dependencies +Forcing myself to acknowledge and address dependencies has been of great help +for me, especially on more involved projects; I am occasionally prone to +being lazy and leaving tasks I set for myself unaddressed, but these little +settings have really helped me maintain my files over time. #+begin_src emacs-lisp :tangle config.el -(package-initialize) -(menu-bar-mode -1) -(tool-bar-mode -1) -(scroll-bar-mode -1) -;; (modus-themes-load-operandi) +(setq-default org-enforce-todo-dependencies t) +(setq org-enforce-todo-checkbox-dependencies t) +#+end_src +I want to know when my deadlines are approaching. +#+begin_src emacs-lisp :tangle config.el +(setq org-deadline-warning-days 7) +#+end_src +I like my statistics. +#+begin_src emacs-lisp :tangle config.el +(setq org-provide-todo-statistics t + org-hierarchical-todo-statistics t) +#+end_src -;; Choose some fonts -;; (set-face-attribute 'default nil :family "Iosevka") -;; (set-face-attribute 'variable-pitch nil :family "Iosevka Aile") -;; (set-face-attribute 'org-modern-symbol nil :family "Iosevka") +#+begin_src emacs-lisp :tangle config.el +(setq org-todo-repeat-to-state "LOOP") +#+end_src +****** Todo keywords +I got these from... I frankly don't even know where. They're not bad, imo. -;; Add frame borders and window dividers -(modify-all-frames-parameters - '((right-divider-width . 0) - (internal-border-width . 0))) -(dolist (face '(window-divider - window-divider-first-pixel - window-divider-last-pixel)) - (face-spec-reset-face face) - (set-face-foreground face (face-attribute 'default :background))) -(set-face-background 'fringe (face-attribute 'default :background)) +#+begin_src emacs-lisp :tangle config.el +(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 + '( + ("INBOX" :foreground "cyan" :weight bold) + ("TASK" :foreground "purple" :weight bold) + ("PROJ" :foreground "violet" :weight bold) + ("LOOP" :foreground "magenta" :weight bold) + ("WAIT" :foreground "yellow" :weight bold) + ("HOLD" :foreground "orange" :weight bold) + ("DONE" :foreground "green" :weight bold) + ("KILL" :foreground "grey" :weight bold))) +#+end_src +Change font for DONE tasks +- https://lists.gnu.org/archive/html/emacs-orgmode/2007-03/msg00179.html +#+BEGIN_SRC emacs-lisp :tangle config.el +(setq org-fontify-done-headline t) +(custom-set-faces + '(org-done ((t (:foreground "PaleGreen" + :weight normal + :strike-through t)))) + '(org-headline-done + ((((class color) (min-colors 16) (background dark)) + (:foreground "LightSalmon" :strike-through t))))) +#+END_SRC +**** Keybinds +Pretty self-explanatory. +#+begin_src emacs-lisp :tangle config.el +(global-set-key "\C-cl" 'org-store-link) +(global-set-key "\C-cnn" 'org-capture) +#+end_src +***** Timestamp keybinds +Inserts timestamps in the proper format. ~'(16)~ stands for two universal arguments, keeping the command from prompting for the time. Two keybinds here, which insert an active or inactive timestamp. +#+begin_src emacs-lisp :tangle config.el +(global-set-key "\C-cia" '(lambda ()(interactive) + (org-time-stamp '(16)))) +(global-set-key "\C-cii" '(lambda () (interactive) + (org-time-stamp-inactive '(16)))) +#+end_src -(setq - ;; Edit settings - org-auto-align-tags nil - org-tags-column 0 - org-catch-invisible-edits 'show-and-error - org-special-ctrl-a/e t - org-insert-heading-respect-content t - - ;; Org styling, hide markup etc. - org-hide-emphasis-markers t - org-pretty-entities t - - ;; Agenda styling - org-agenda-tags-column 0 - org-agenda-block-separator ?─ - org-agenda-time-grid - '((daily today require-timed) - (800 1000 1200 1400 1600 1800 2000) - " ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄") - org-agenda-current-time-string - "◀── now ─────────────────────────────────────────────────") - -;; Ellipsis styling -;; (setq org-ellipsis "…") -;; (set-face-attribute 'org-ellipsis nil :inherit 'default :box nil) - -(global-org-modern-mode) +**** Capture templates +#+begin_src emacs-lisp :tangle config.el +(setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/agenda.org" "Inbox") "* %i%?") + ("i" "idea" entry (file+headline "~/enc/org/agenda.org" "Ideas") "* %?") + ("d" "reminder" entry (file+headline "~/enc/org/agenda.org" "Reminders") "* %i%? \n %U") + ("p" "person" entry (file+headline "~/enc/org/people.org" "Sort") + "* %(org-contacts-template-name) +:PROPERTIES: +:EMAIL: %(org-contacts-template-email) +:PHONE: +:ALIAS: +:NICKNAME: +:IGNORE: +:ICON: +:NOTE: +:ADDRESS: +:BIRTHDAY: +:END:"))) #+end_src #+RESULTS: -: t -****** Directory to org +| t | inbox | entry | (file+headline ~/enc/org/agenda.org Inbox) | * %i%? | +| i | idea | entry | (file+headline ~/enc/org/agenda.org Ideas) | * %? | +| d | reminder | entry | (file+headline ~/enc/org/agenda.org Reminders) | * %i%? | +**** Functions +***** my-id-get-or-generate +Straight from Karl Voit's config. +#+BEGIN_SRC emacs-lisp :tangle no +(defun my-id-get-or-generate() +"Returns the ID property if set or generates and returns a new one if not set. + The generated ID is stripped off potential progress indicator cookies and + sanitized to get a slug. Furthermore, it is prepended with an ISO date-stamp + if none was found before." + (interactive) + (when (not (org-id-get)) + (progn + (let* ( + (my-heading-text (nth 4 (org-heading-components)));; retrieve heading string + (my-heading-text (replace-regexp-in-string "\\(\\[[0-9]+%\\]\\)" "" my-heading-text));; remove progress indicators like "[25%]" + (my-heading-text (replace-regexp-in-string "\\(\\[[0-9]+/[0-9]+\\]\\)" "" my-heading-text));; remove progress indicators like "[2/7]" + (my-heading-text (replace-regexp-in-string "\\(\\[#[ABC]\\]\\)" "" my-heading-text));; remove priority indicators like "[#A]" + (my-heading-text (replace-regexp-in-string "\\[\\[\\(.+?\\)\\]\\[" "" my-heading-text t));; removes links, keeps their description and ending brackets +;; (my-heading-text (replace-regexp-in-string "[<\\[][12][0-9]\\{3\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\( .*?\\)[>\\]]" "" my-heading-text t));; removes day of week and time from date- and time-stamps (doesn't work somehow) + (my-heading-text (replace-regexp-in-string "<[12][0-9]\\{3\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\( .*?\\)>" "" my-heading-text t));; removes day of week and time from active date- and time-stamps + (my-heading-text (replace-regexp-in-string "\\[[12][0-9]\\{3\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\( .*?\\)\\]" "" my-heading-text t));; removes day of week and time from inactive date- and time-stamps + (new-id (my-generate-sanitized-alnum-dash-string my-heading-text));; get slug from heading text + (my-created-property (assoc "CREATED" (org-entry-properties))) ;; nil or content of CREATED time-stamp + ) + (when (not (string-match "[12][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]-.+" new-id)) + ;; only if no ISO date-stamp is found at the beginning of the new id: + (if my-created-property (progn + ;; prefer date-stamp of CREATED property (if found): + (setq my-created-datestamp (substring (org-entry-get nil "CREATED" nil) 1 11)) ;; returns "2021-12-16" or nil (if no CREATED property) + (setq new-id (concat my-created-datestamp "-" new-id)) + ) + ;; use today's date-stamp if no CREATED property is found: + (setq new-id (concat (format-time-string "%Y-%m-%d-") new-id)))) + (org-set-property "ID" new-id) + ) + ) + ) + (kill-new (concat "id:" (org-id-get)));; put ID in kill-ring + (org-id-get);; retrieve the current ID in any case as return value +) + + +#+END_SRC + +***** Directory to org +Frankly I don't know where I got this from, it's been a long time, and I don't +recall ever using it but... it's so nice that I don't dare remove this just in +case I need it at some point in the future. #+begin_src elisp :tangle config.el (defun my-dir-to-org (dir org-file) "Create a file ORG-FILE which has all txt files in DIR as linked headlines @@ -429,195 +512,51 @@ and the contents of the files below the headlines." #+end_src -#+RESULTS: -: my-mass-conversion +***** my-org-tree-to-indirect-buffer +#+begin_quote +This beautiful piece of code was done by [[https://www.reddit.com/user/github-alphapapa][alphapapa]] and published on +[[https://www.reddit.com/r/orgmode/comments/dbsngi/finally_solving_the_lack_of_a_treeview_navigation/f26qpzr/][reddit]]. Its purpose is to provide more than one indirect buffer when +using =org-tree-to-indirect-buffer()= (via ~C-c C-x b~). Further more, +it has a different way of naming these buffers. -***** Dependencies -#+begin_src emacs-lisp :tangle config.el -(setq-default org-enforce-todo-dependencies t) -(setq org-enforce-todo-checkbox-dependencies t) -#+END_SRC -***** org-auto-tangle -#+begin_src emacs-lisp :tangle config.el -(require 'org-auto-tangle) -(add-hook 'org-mode-hook 'org-auto-tangle-mode) -#+end_src -***** auto-tangle-mode -#+begin_src emacs-lisp :tangle yes +Using an advice, the original function gets overwritten. +#+end_quote +--Karl Voit -#+end_src -**** Hooks -***** append and update time-stamps for =Time-stamp: <>= in headers: -#+begin_src emacs-lisp :tangle config.el -(add-hook 'write-file-hooks 'time-stamp) -(add-hook 'org-mode-hook - (lambda () - ;; yasnippet - ;;disabled; (make-variable-buffer-local 'yas/trigger-key) - ;;disabled; (org-set-local 'yas/trigger-key [tab]) - ;;disabled; (define-key yas/keymap [tab] 'yas/next-field-group) - ;; flyspell mode for spell checking everywhere - ;;disabled; (flyspell-mode 1) - ;; auto-fill mode on - (auto-fill-mode 1))) - #+end_src -***** expand macros inline +#+BEGIN_SRC emacs-lisp :tangle config.el +(defun my-org-tree-to-indirect-buffer (&optional arg) + "Create indirect buffer and narrow it to current subtree. +The buffer is named after the subtree heading, with the filename +appended. If a buffer by that name already exists, it is +selected instead of creating a new buffer." + (interactive "P") + (let* ((new-buffer-p) + (pos (point)) +w (buffer-name (let* ((heading (org-get-heading t t)) + (level (org-outline-level)) + (face (intern (concat "outline-" (number-to-string level)))) + (heading-string (propertize (org-link-display-format heading) + 'face face))) + (concat heading-string "::" (buffer-name)))) + (new-buffer (or (get-buffer buffer-name) + (prog1 (condition-case nil + (make-indirect-buffer (current-buffer) buffer-name 'clone) + (error (make-indirect-buffer (current-buffer) buffer-name))) + (setq new-buffer-p t))))) + (switch-to-buffer new-buffer) + (when new-buffer-p + ;; I don't understand why setting the point again is necessary, but it is. + (goto-char pos) + (rename-buffer buffer-name) + (org-narrow-to-subtree)))) -#+begin_src emacs-lisp :tangle config.el - - (add-to-list 'font-lock-extra-managed-props 'display) - -(font-lock-add-keywords - 'org-mode - '(("\\({{{[a-zA-Z#%)(_-+0-9]+}}}\\)" 0 - `(face nil display - ,(format "%s" - (let* ((input-str (match-string 0)) - (el (with-temp-buffer - (insert input-str) - (goto-char (point-min)) - (org-element-context))) - (text (org-macro-expand el org-macro-templates))) - (if text - text - input-str))))))) - - #+end_src - - #+RESULTS: - -**** Keybinds - -#+begin_src emacs-lisp :tangle config.el -(global-set-key "\C-cl" 'org-store-link) -(global-set-key "\C-ch" 'counsel-org-link) -(global-set-key "\C-cne" 'elgantt-open) -(global-set-key "\C-cnn" 'org-capture) -#+end_src -***** Timestamp keybinds -Inserts timestamps in the proper format. ~'(16)~ stands for two universal arguments, keeping the command from prompting for the time. Two keybinds here, which insert an active or inactive timestamp. -#+begin_src emacs-lisp :tangle config.el -(global-set-key "\C-cia" '(lambda ()(interactive) - (org-time-stamp '(16)))) -(global-set-key "\C-cii" '(lambda () (interactive) - (org-time-stamp-inactive '(16)))) -#+end_src - -***** Automated timestamps in headings -I need this because hitting the above is tedious. - -For the files whose paths match the strings in the function, it will advise the org-insert-heading function to insert an inactive timestamp into the new heading. - -This turns making new entries from ~C- C-i i~ into just ~C-~. Much easier, and I don't have to think about this any more. - -#+begin_src emacs-lisp :tangle config.el -(after! org-mode - (add-hook! 'org-insert-heading-hook - (if - (or - (string-match-p "journal.org" buffer-file-name) - (string-match-p "money" buffer-file-name) - (string-match-p "therapy.org" buffer-file-name)) - ((lambda () - (interactive) - (org-time-stamp-inactive '(16)) - (newline))) - (setq org-insert-heading-hook nil) - ))) - -#+end_src - -#+RESULTS: - - -**** Todo keywords -#+begin_src emacs-lisp :tangle config.el -(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 - '( - ("INBOX" :foreground "cyan" :weight bold) - ("TASK" :foreground "purple" :weight bold) - ("PROJ" :foreground "violet" :weight bold) - ("LOOP" :foreground "magenta" :weight bold) - ("WAIT" :foreground "yellow" :weight bold) - ("HOLD" :foreground "orange" :weight bold) - ("DONE" :foreground "green" :weight bold) - ("KILL" :foreground "grey" :weight bold))) -#+end_src - -#+RESULTS: -| INBOX | :foreground | cyan | :weight | bold | -| TASK | :foreground | purple | :weight | bold | -| PROJ | :foreground | violet | :weight | bold | -| LOOP | :foreground | magenta | :weight | bold | -| WAIT | :foreground | yellow | :weight | bold | -| HOLD | :foreground | orange | :weight | bold | -| DONE | :foreground | green | :weight | bold | -| KILL | :foreground | grey | :weight | bold | - -Change font for DONE tasks -- https://lists.gnu.org/archive/html/emacs-orgmode/2007-03/msg00179.html -#+BEGIN_SRC emacs-lisp :tangle no -(setq org-fontify-done-headline t) -(custom-set-faces - '(org-done ((t (:foreground "PaleGreen" - :weight normal - :strike-through t)))) - '(org-headline-done - ((((class color) (min-colors 16) (background dark)) - (:foreground "LightSalmon" :strike-through t))))) +(advice-add 'org-tree-to-indirect-buffer :override 'my-org-tree-to-indirect-buffer) #+END_SRC - - -**** Capture templates - -#+begin_src emacs-lisp :tangle config.el -(setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/agenda.org" "Inbox") "* %i%?") - ("i" "idea" entry (file+headline "~/enc/org/agenda.org" "Ideas") "* %?") - ("d" "reminder" entry (file+headline "~/enc/org/agenda.org" "Reminders") "* %i%? \n %U") - ("p" "person" entry (file+headline "~/enc/org/people.org" "Sort") - "* %(org-contacts-template-name) -:PROPERTIES: -:EMAIL: %(org-contacts-template-email) -:PHONE: -:ALIAS: -:NICKNAME: -:IGNORE: -:ICON: -:NOTE: -:ADDRESS: -:BIRTHDAY: -:END:"))) -#+end_src - -#+RESULTS: -| t | inbox | entry | (file+headline ~/enc/org/agenda.org Inbox) | * %i%? | -| i | idea | entry | (file+headline ~/enc/org/agenda.org Ideas) | * %? | -| d | reminder | entry | (file+headline ~/enc/org/agenda.org Reminders) | * %i%? | - -**** preserving all heading levels when archiving - -Karl Voit: - +***** preserving all heading levels when archiving #+begin_quote Preserve the hierarchy when archiving: [[https://fuco1.github.io/2017-04-20-Archive-subtrees-under-the-same-hierarchy-as-original-in-the-archive-files.html][blog article]], [[https://gist.github.com/Fuco1/e86fb5e0a5bb71ceafccedb5ca22fcfb][source code (GitHub gist)]] +--Karl Voit #+end_quote #+BEGIN_SRC emacs-lisp :tangle config.el @@ -664,7 +603,7 @@ Preserve the hierarchy when archiving: [[https://fuco1.github.io/2017-04-20-Arch (org-end-of-subtree t t) (org-paste-subtree level tree-text)))))))) #+END_SRC -**** my-dired-insert-lfile-link-list-to-other-org-window() +***** my-dired-insert-lfile-link-list-to-other-org-window() #+begin_quote | 2022-06-20 | I had this idea and implemented it | @@ -714,132 +653,204 @@ This results in a list that gets added to the Org-mode buffer similar to: (select-window dired-win))) #+end_src +**** org-roam +#+begin_src emacs-lisp :tangle config.el +(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) +(org-roam-db-autosync-enable) -**** link colors -#+begin_quote -| 2021-01-11 | moved commands to =my-set-linkcolors= and defined 3 categories of colors | +(setq org-roam-capture-templates + '(("n" "default" plain + "%?" + :if-new (file+head "${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: \n") + :empty-lines 1 + :unnarrowed t) + ("t" "Therapy" plain + "#+title: ${title}\n" + :if-new (file+head "therapy/therapy-${slug}.org" "#+title: ${title}\n#+category: 📗 ${title}\n#+filetags: 📗\n") + :empty-lines 1 + :unnarrowed))) +#+end_src -- I got the idea from: https://www.reddit.com/r/emacs/comments/hywxef/visually_differentiate_between_links_to_files_and/ -- possible values for faces: https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/ - - and =add-face-text-property=: https://www.gnu.org/software/emacs/manual/html_node/elisp/Faces.html#Faces -- Emacs colors: http://www.raebear.net/computers/emacs-colors/ -- If you are interested in taking this any further: https://github.com/stardiviner/org-link-beautify -#+end_quote +***** Keybinds +#+begin_src emacs-lisp :tangle config.el +(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) +#+end_src +#+RESULTS: +: org-roam-capture +**** org-agenda +These are settings specifically for org-agenda, that don't overlap with any +other settings. +#+begin_src emacs-lisp :tangle config.el +(setq org-agenda-start-day nil) +(setq org-agenda-start-on-weekday nil) +(setq org-agenda-span 'day) +#+end_src +Dim blocked tasks to clearly see that their prerequisites are not met. +Make the agenda blocks more compact by skipping certain elements. +#+begin_src emacs-lisp :tangle config.el +(setq org-agenda-dim-blocked-tasks t) +(setq org-agenda-compact-blocks t) +#+end_src + +Non-nil means skip timestamp line if same entry shows because of deadline. #+BEGIN_SRC emacs-lisp :tangle config.el -(setq my-linkcolor-org "wheat3") -(setq my-linkcolor-file "MediumSeaGreen") -(setq my-linkcolor-web "DeepSkyBlue") - -(defun my-set-linkcolors () - "Defines the colors of various link colors" - (interactive) - - ;; Org links -------------------------------------------------------------------------- - - (org-link-set-parameters "id" :face `(:foreground ,my-linkcolor-org :underline t)) - (org-link-set-parameters "contact" :face `(:foreground ,my-linkcolor-org :underline t)) - - ;; File links -------------------------------------------------------------------------- - - (org-link-set-parameters "file" :face `(:foreground ,my-linkcolor-file :underline t)) - ;; defined elsewhere;; (org-link-set-parameters "tsfile" :face '`(:foreground "DarkSeaGreen" :underline t)) - (org-link-set-parameters "pdf" :face `(:foreground ,my-linkcolor-file :underline t)) - - (org-link-set-parameters "EPA" :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "EPAAFO" :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "JAFO" :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "DAKEPA" :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "BMTSK" :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "ISO" :face `(:foreground ,my-linkcolor-file :underline t)) - - (org-link-set-parameters "gemSpec_DS_Anbieter" - :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "gemSpec_Net" - :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "gemSpec_PKI" - :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "gemSpec_IDP_Dienst" - :face `(:foreground ,my-linkcolor-file :underline t)) - - (org-link-set-parameters "messageid" - :face `(:foreground ,my-linkcolor-file :underline t)) - - ;; Web links -------------------------------------------------------------------------- - - (org-link-set-parameters "http" :face `(:foreground ,my-linkcolor-web :underline t)) - (org-link-set-parameters "https" :face `(:foreground ,my-linkcolor-web :underline t)) - -) - -(defun my-set-linkcolors () - "Defines the colors of various link colors" - (interactive) - - ;; Org links -------------------------------------------------------------------------- - - (org-link-set-parameters "id" :face '(:foreground "wheat3" :underline t)) - (org-link-set-parameters "contact" :face '(:foreground "wheat3" :underline t)) - - ;; File links -------------------------------------------------------------------------- - - (org-link-set-parameters "file" :face '(:foreground "MediumSeaGreen" :underline t)) - ;; defined elsewhere;; (org-link-set-parameters "tsfile" :face ''(:foreground "DarkSeaGreen" :underline t)) - (org-link-set-parameters "pdf" :face '(:foreground "MediumSeaGreen" :underline t)) - - (org-link-set-parameters "EPA" :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "EPAAFO" :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "JAFO" :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "DAKEPA" :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "BMTSK" :face '(:foreground "MediumSeaGreen" :underline t)) - - (org-link-set-parameters "gemSpec_DS_Anbieter" - :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "gemSpec_Net" - :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "gemSpec_PKI" - :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "gemSpec_IDP_Dienst" - :face '(:foreground "MediumSeaGreen" :underline t)) - - (org-link-set-parameters "messageid" - :face '(:foreground "MediumSeaGreen" :underline t)) - - ;; Web links -------------------------------------------------------------------------- - - (org-link-set-parameters "http" :face '(:foreground "DeepSkyBlue" :underline t)) - (org-link-set-parameters "https" :face '(:foreground "DeepSkyBlue" :underline t)) - -) - -(my-set-linkcolors) ;; set colors when loading +(setq org-agenda-skip-timestamp-if-deadline-is-shown t) #+END_SRC -- test links - - file: [[file:foo/bar.txt]] [[file:foo/bar.txt][description]] - - tsfile: [[tsfile:foo/bar.txt]] [[tsfile:foo/bar.txt][description]] - - lfile: [[lfile:foo/bar.txt]] [[tsfile:foo/bar.txt][description]] - - pdf: pdf:foo.pdf [[pdf:foo.pdf][description]] +Remove completed deadline and scheduled tasks from the agenda view +#+BEGIN_SRC emacs-lisp :tangle config.el +(setq org-agenda-skip-deadline-if-done t) +(setq org-agenda-skip-scheduled-if-done t) +#+END_SRC - - http: http://Karl-Voit.at [[http://Karl-Voit.at][description]] - - https: https://Karl-Voit.at [[https://Karl-Voit.at][description]] +Remove completed items from search results +#+BEGIN_SRC emacs-lisp :tangle no +(setq org-agenda-skip-timestamp-if-done t) +#+END_SRC - - id: id:foo-bar [[id:foo-bar][description]] - - contact: [[contact:example]] [[contact:example][description]] - - message-id: [[messageid:foobar@example.com][Email link]] +Include agenda archive files when searching for things +#+BEGIN_SRC emacs-lisp :tangle config.el +(setq org-agenda-text-search-extra-files (quote (agenda-archives))) +#+END_SRC +Do not search for time in heading when displaying a date-stamp +#+BEGIN_SRC emacs-lisp :tangle config.el +(setq org-agenda-search-headline-for-time nil) +#+END_SRC +Show all agenda dates - even if they are empty +#+BEGIN_SRC emacs-lisp :tangle config.el +(setq org-agenda-show-all-dates t) +#+END_SRC - - EPA: [[EPA:1234]] [[EPA:1234][description]] - - EPAAFO: [[EPAAFO:1234]] [[EPAAFO:1234][description]] - - JAFO: [[JAFO:1234]] [[JAFO:1234][description]] - - DAKEPA: [[DAKEPA:1234]] [[DAKEPA:1234][description]] - - BMTSK: [[BMTSK:1234]] [[BMTSK:1234][description]] -- as of [2021-01-11 Mon] (before unifying color concept): - - Org links had: snow3 - - File links: DarkSeaGreen, wheat2 - - Web links: DeepSkyBlue -*** org-crypt +Show the following items in log mode. +#+begin_src emacs-lisp :tangle config.el +(setq org-agenda-log-mode-items '(closed clock state)) +#+end_src + +#+begin_src emacs-lisp :tangle config.el +(setq org-agenda-sorting-strategy + (quote ((agenda time-up user-defined-up priority-down category-keep) + (todo priority-down category-keep) + (tags priority-down category-keep) + (search category-keep)))) +#+end_src + +Ensuring that tag inheritance is applied in the agenda view. +#+begin_src emacs-lisp :tangle config.el +(setq org-agenda-use-tag-inheritance (quote (agenda))) +#+end_src + +Agenda prefixes and org-modern agenda styling. +#+begin_src emacs-lisp :tangle config.el +(setq org-agenda-prefix-format '((agenda . " %l %i %c %s %t") + (todo . " %i %-12:c") + (tags . " %i $-12:c") + (search . " %i %-12:c"))) + +(setq org-agenda-tags-column -80 + org-agenda-block-separator ?─ + org-agenda-current-time-string "◀── now ─────────────────────────────────────────────────") +#+end_src +Two to choose from, I'm not sure which one is better here. I don't know where I +got this one from. +#+begin_src emacs-lisp :tangle config.el +(setq org-agenda-time-grid + '((daily today remove-match) + (800 1000 1200 1400 1600 1800 2000) + " ┄┄┄┄┄ " + "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄")) +#+end_src +Add hook into the agenda mode for highlighting. +#+begin_src emacs-lisp :tangle config.el +(add-hook 'org-agenda-mode-hook '(lambda () (hl-line-mode 1))) +#+end_src + +**** org-habits +I try to run a reasonable routine, and it doesn't always work. This helps me +review if I'm sticking to it well (or, reasonably well) over time. +#+begin_src emacs-lisp :tangle config.el +(add-to-list 'org-modules 'habit) +(setq org-habit-following-days 2 + org-habit-preceding-days 7 + org-habit-show-all-today nil + org-habit-show-habits-only-for-today t + org-habit-show-habits t) +#+end_src +Some keybinds and a hook. +#+begin_src emacs-lisp :tangle config.el +(define-key org-mode-map (kbd "C-c h") 'org-habit-stats-view-habit-at-point) +(add-hook 'org-after-todo-state-change-hook 'org-habit-stats-update-properties) +#+end_src +**** multiple-cursors +I /rarely/ use these, since I don't edit much structured data, and when I do it's +less like this and more like massive articles or books or whatnot. Still, it +does come in handy occasionally. +#+begin_src emacs-lisp :tangle config.el +(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) +(global-set-key (kbd "C->") 'mc/mark-next-like-this) +(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) +(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) +#+end_src + +**** [disabled] copilot.el +#+begin_src emacs-lisp :tangle no +;; accept completion from copilot and fallback to company +(use-package! copilot + :hook (prog-mode . copilot-mode) + :bind (:map copilot-completion-map + ("" . 'copilot-accept-completion) + ("TAB" . 'copilot-accept-completion) + ("C-TAB" . 'copilot-accept-completion-by-word) + ("C-" . 'copilot-accept-completion-by-word))) +#+end_src +**** Hooks +***** org-auto-tangle +By adding ~#+auto_tangle: t~ to the frontmatter of an org-mode file, this enables +automatic tangling upon the file being saved. +#+begin_src emacs-lisp :tangle config.el +(require 'org-auto-tangle) +(add-hook 'org-mode-hook 'org-auto-tangle-mode) +#+end_src +***** Automated timestamps in headings +I need this because hitting the [[*Timestamp keybinds][timestamp keybinds]] is tedious. + +For the files whose paths match the strings in the function, it will advise the org-insert-heading function to insert an inactive timestamp into the new heading. + +This turns making new entries from ~C- C-i i~ into just ~C-~. Much easier, and I don't have to think about this any more. + +#+begin_src emacs-lisp :tangle config.el +(after! org + (add-hook! 'org-insert-heading-hook + (if (or + (string-match-p "journal.org" buffer-file-name) + (string-match-p "money.org" buffer-file-name) + (string-match-p "therapy.org" buffer-file-name)) + (progn + (org-time-stamp-inactive '(16)) + (newline))))) +#+end_src + +*** org-mode expansions +**** org-babel +This is really important for me since I tend to use PlantUML to generate charts, +graphs and diagrams. +#+begin_src emacs-lisp :tangle config.el +(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) +#+end_src +**** org-crypt +This is nice, since it lets me easily encrypt parts of my notes using my GPG +key, which I have set up with my NitroKey. It's some really really cool tech. #+begin_src emacs-lisp :tangle config.el (require 'org-crypt) (require 'epa-file) @@ -849,98 +860,20 @@ This results in a list that gets added to the Org-mode buffer similar to: (setq org-crypt-key "phil@bajsicki.com") (setenv "GPG_AGENT_INFO" nil) #+end_src - -#+RESULTS: - -*** org-edna -https://www.nongnu.org/org-edna-el/ -#+begin_src emacs-lisp :tangle config.el - - +**** org-expiry +:PROPERTIES: +:CREATED: <2024-09-18 Wed 23:03> +:END: +I want my entries to have a real expiry date sometimes, so this is here. It's +quite neat! I am then hooking it into +#+begin_src emacs-lisp :tangle config.el +(use-package! org-expiry) #+end_src -*** mu4e -#+begin_src elisp :tangle config.el -(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e/") - -(setq mu4e-change-filenames-when-moving t) -(setq mu4e-update-interval (* 10 60)) -(setq mu4e-get-mail-command "mbsync -a") -(setq mu4e-maildir "~/enc/.mail") - -(setq mu4e-drafts-folder "/Drafts") -(setq mu4e-sent-folder "/Sent") -(setq mu4e-refile-folder "/Refile") -(setq mu4e-trash-folder "/Trash") - -(mu4e t) - -#+end_src - -#+RESULTS: - - -*** sly - -#+begin_src emacs-lisp :tangle config.el -;; (load (expand-file-name "~/.roswell/helper.el")) - -(setq inferior-lisp-program "sbcl --dynamic-space-size 8192 -Q -l ~/.sbclrc") -#+end_src - -#+RESULTS: -: sbcl --dynamic-space-size 8192 -Q -l ~/.sbclrc - -*** multiple-cursors -#+begin_src emacs-lisp :tangle config.el -(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) -(global-set-key (kbd "C->") 'mc/mark-next-like-this) -(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) -(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) -#+end_src - -#+RESULTS: -: mc/mark-all-like-this - -*** org-transclusion -#+begin_src emacs-lisp :tangle config.el -(use-package! org-transclusion - :after org - :init - (map! - :map global-map "" #'org-transclusion-add - :leader - :prefix "n" - :desc "Org Transclusion Mode" "t" #'org-transclusion-mode)) -#+end_src - -#+RESULTS: -: org-transclusion - -*** org-babel -#+begin_src emacs-lisp :tangle config.el -(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) -#+end_src - -When some code generates an image file, display it in the results: - -2022-01-16: this has some performance impact because it affects all babel blocks of the current file - -#+BEGIN_SRC emacs-lisp :tangle no -(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) -#+END_SRC - -#+BEGIN_SRC emacs-lisp :tangle no -(add-hook 'org-babel-after-execute-hook - (lambda () - (unless (eq this-command 'org-babel-tangle) - (org-display-inline-images nil nil - ;; 2023-02-08: org-back...-or-point-min doesn't exist any more: (save-excursion (org-back-to-heading-or-point-min t)) - (save-excursion (org-back-to-heading t)) - (save-excursion (or (outline-next-heading) (point-max))))))) -#+END_SRC - - -*** org-export*** LaTeX +**** org-export +Just a catch-all category for this... I honestly should split things up better +instead of this, but it is what it is. +****** LaTeX +Adding the tufte-handout and the memoir classes. #+begin_src emacs-lisp :tangle config.el (with-eval-after-load 'ox-latex (add-to-list 'org-latex-classes @@ -963,567 +896,106 @@ When some code generates an image file, display it in the results: ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) #+end_src - +Testing function, not tangled. #+begin_src emacs-lisp :tangle no - (print org-latex-classes) - #+end_src - -#+RESULTS: -| memoir | \documentclass{memoir} | (\chapter{%s} . \chapter*{%s}) | (\section{%s} . \section*{%s}) | (\subsection{%s} . \subsection*{%s}) | (\subsubsection{%s} . \subsubsection*{%s}) | | -| article | \documentclass[11pt]{article} | (\section{%s} . \section*{%s}) | (\subsection{%s} . \subsection*{%s}) | (\subsubsection{%s} . \subsubsection*{%s}) | (\paragraph{%s} . \paragraph*{%s}) | (\subparagraph{%s} . \subparagraph*{%s}) | -| report | \documentclass[11pt]{report} | (\part{%s} . \part*{%s}) | (\chapter{%s} . \chapter*{%s}) | (\section{%s} . \section*{%s}) | (\subsection{%s} . \subsection*{%s}) | (\subsubsection{%s} . \subsubsection*{%s}) | -| book | \documentclass[11pt]{book} | (\part{%s} . \part*{%s}) | (\chapter{%s} . \chapter*{%s}) | (\section{%s} . \section*{%s}) | (\subsection{%s} . \subsection*{%s}) | (\subsubsection{%s} . \subsubsection*{%s}) | -| tufte-handout | \documentclass[nobib]{tufte-handout} | | | | | | - -#+begin_src - - +I have not settled on this. Meh. +#+begin_src elisp :tangle no (setq org-latex-default-class "tufte-handout" org-latex-pdf-process '("latexmk -pdf -bibtex-cond -f -outdir=%o %f")) #+end_src - -#+RESULTS: -| latexmk -pdf -bibtex-cond -f -outdir=%o %f | - -*** org-super-links - -***** Quick related link function +**** org-transclusion +I don't use this enough, and hopefully I'll find happiness with this if I do end +up working on larger projects. #+begin_src emacs-lisp :tangle config.el -(defun org-super-links-quick-related () - (interactive) - (let ((org-super-links-link-prefix "\nrelated: ")) - (org-super-links-link))) - -(setq org-super-links-related-into-drawer t) -(setq org-super-links-related-drawer-default-name "RELATED" - org-super-links-link-prefix 'org-super-links-link-prefix-timestamp) - -(setq org-export-with-broken-links t) ;; avoiding error on export - +(use-package! org-transclusion + :after org + :init + (map! + :map global-map "" #'org-transclusion-add + :leader + :prefix "n" + :desc "Org Transclusion Mode" "t" #'org-transclusion-mode)) #+end_src - -***** Keybinds -:PROPERTIES: -:ID: 86ac73be-4cf1-4262-8aa8-e03c519b5b6e -:END: -Replace org-store-link and org-insert-link with org-super-links alternatives. -#+begin_src emacs-lisp :tangle config.el -(global-unset-key (kbd "C-c l")) -(global-set-key (kbd "C-c l l") 'org-super-links-link) -(global-set-key (kbd "C-c l s") 'org-super-links-store-link) -(global-set-key (kbd "C-c l i") 'org-super-links-insert-drawer-link) -(global-set-key (kbd "C-c l r") 'org-super-links-quick-related) -(global-set-key (kbd "C-c l d") 'org-super-links-delete-link) -#+end_src - -#+RESULTS: -: org-super-links-delete-link - -*** org-super-agenda -#+begin_src emacs-lisp :tangle no -(org-super-agenda-mode) -(setq super-agenda-groups - '(;; Each group has an implicit boolean OR operator between its selectors. - (:name "Today" ; Optionally specify section name - :time-grid t ; Items that appear on the time grid - ) - (:name "DEADLINES" :deadline t :order 1) - (:name "Focus | [A]" :tag "Focus" :priority "A" :order 2 :face (:append t :weight bold)) - ;; (:name "Important" :priority "A" :order 4) - ;; (:name "Habits" :habit t :order 3) - ;; (:name "Shopping" :tag "Besorgung" :order 8) - ;; Boolean AND group matches items that match all subgroups - ;; :and (:tag "shopping" :tag "@town") - ;; Multiple args given in list with implicit OR - ;; :tag ("food" "dinner")) - ;; :habit t - ;; :tag "personal") - (:name "Started" :and (:todo "TASK" :not (:tag "someday") :not (:priority "C") :not (:priority "B") ) :order 10) - ;;(:name "Space-related (non-moon-or-planet-related)" - ;; ;; Regexps match case-insensitively on the entire entry - ;; :and (:regexp ("space" "NASA") - ;; ;; Boolean NOT also has implicit OR between selectors - ;; :not (:regexp "moon" :tag "planet"))) - ;;(:name "BWG" :tag "@BWG" :order 16) - ;; (:name "read" :tag "2read" :order 22) - ;; Groups supply their own section names when none are given - (:name "Someday" :and ( :todo ("WAIT" "HOLD" "INBOX") :tag "someday" :not (:priority "C") :not (:priority "B")) - ;; Show this group at the end of the agenda (since it has the - ;; highest number). If you specified this group last, items - ;; with these todo keywords that e.g. have priority A would be - ;; displayed in that group instead, because items are grouped - ;; out in the order the groups are listed. - :order 25) - - ;; "other items": an auto-group with order 99 ---------------------------- - - (:name "Prio ≤ B" :priority<= "B" - ;; Show this section after "Today" and "Important", because - ;; their order is unspecified, defaulting to 0. Sections - ;; are displayed lowest-number-first. - :order 105) - (:name "reward" - :tag ("reward" "lp") - :order 110 - ) - (:name "Waiting…" :todo "WAIT" :order 118) ; Set order of this section - ) - - (defun my-super-agenda() - "generates my super-agenda" - (interactive) - (org-super-agenda-mode) - (let - ((org-super-agenda-groups super-agenda-groups)) - (org-agenda nil "a") - )) - #+end_src - - - -*** Org-wild-notifier +**** Org-wild-notifier This lets me get desktop notifications for TODO items. - #+begin_src emacs-lisp :tangle config.el - (org-wild-notifier-mode) (setq alert-default-style 'libnotify org-wild-notifier-alert-time '(0 5 15 60) org-wild-notifier-keyword-whitelist nil ;; good for testing org-wild-notifier--alert-severity 'high - alert-fade-time 50 - ) + alert-fade-time 50) +#+end_src +*** mu4e +Email in Emacs... what more can a man want? +#+begin_src elisp :tangle config.el +(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e/") + +(setq mu4e-change-filenames-when-moving t) +(setq mu4e-update-interval (* 10 60)) +(setq mu4e-get-mail-command "mbsync -a") +(setq mu4e-maildir "~/enc/.mail") + +(setq mu4e-drafts-folder "/Drafts") +(setq mu4e-sent-folder "/Sent") +(setq mu4e-refile-folder "/Refile") +(setq mu4e-trash-folder "/Trash") + +(mu4e t) + #+end_src #+RESULTS: -: 50 - -*** org-id -**** my-id-get-or-generate -Straight from Karl Voit's config. - -#+BEGIN_SRC emacs-lisp :tangle no -(defun my-id-get-or-generate() -"Returns the ID property if set or generates and returns a new one if not set. - The generated ID is stripped off potential progress indicator cookies and - sanitized to get a slug. Furthermore, it is prepended with an ISO date-stamp - if none was found before." - (interactive) - (when (not (org-id-get)) - (progn - (let* ( - (my-heading-text (nth 4 (org-heading-components)));; retrieve heading string - (my-heading-text (replace-regexp-in-string "\\(\\[[0-9]+%\\]\\)" "" my-heading-text));; remove progress indicators like "[25%]" - (my-heading-text (replace-regexp-in-string "\\(\\[[0-9]+/[0-9]+\\]\\)" "" my-heading-text));; remove progress indicators like "[2/7]" - (my-heading-text (replace-regexp-in-string "\\(\\[#[ABC]\\]\\)" "" my-heading-text));; remove priority indicators like "[#A]" - (my-heading-text (replace-regexp-in-string "\\[\\[\\(.+?\\)\\]\\[" "" my-heading-text t));; removes links, keeps their description and ending brackets -;; (my-heading-text (replace-regexp-in-string "[<\\[][12][0-9]\\{3\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\( .*?\\)[>\\]]" "" my-heading-text t));; removes day of week and time from date- and time-stamps (doesn't work somehow) - (my-heading-text (replace-regexp-in-string "<[12][0-9]\\{3\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\( .*?\\)>" "" my-heading-text t));; removes day of week and time from active date- and time-stamps - (my-heading-text (replace-regexp-in-string "\\[[12][0-9]\\{3\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\( .*?\\)\\]" "" my-heading-text t));; removes day of week and time from inactive date- and time-stamps - (new-id (my-generate-sanitized-alnum-dash-string my-heading-text));; get slug from heading text - (my-created-property (assoc "CREATED" (org-entry-properties))) ;; nil or content of CREATED time-stamp - ) - (when (not (string-match "[12][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]-.+" new-id)) - ;; only if no ISO date-stamp is found at the beginning of the new id: - (if my-created-property (progn - ;; prefer date-stamp of CREATED property (if found): - (setq my-created-datestamp (substring (org-entry-get nil "CREATED" nil) 1 11)) ;; returns "2021-12-16" or nil (if no CREATED property) - (setq new-id (concat my-created-datestamp "-" new-id)) - ) - ;; use today's date-stamp if no CREATED property is found: - (setq new-id (concat (format-time-string "%Y-%m-%d-") new-id)))) - (org-set-property "ID" new-id) - ) - ) - ) - (kill-new (concat "id:" (org-id-get)));; put ID in kill-ring - (org-id-get);; retrieve the current ID in any case as return value -) - - -#+END_SRC - -*** Org-refile +*** pdf-tools +Gotta read in Emacs, sometimes. Usually in the browser, but when I have to take +notes there's nothing more convenient. #+begin_src emacs-lisp :tangle config.el -(setq org-refile-targets '((nil :maxlevel . 9) - (org-agenda-files :maxlevel . 9))) -(setq org-outline-path-complete-in-steps nil) -(setq org-refile-use-outline-path t) -#+end_src +(use-package! pdf-tools + :defer t + :commands (pdf-loader-install) + :mode "\\.pdf\\'" + :bind (:map pdf-view-mode-map + ("n" . pdf-view-next-line-or-next-page) + ("p" . pdf-view-previous-line-or-previous-page) + ("C-=" . pdf-view-enlarge) + ("C--" . pdf-view-shrink)) + :init (pdf-loader-install) + :config (add-to-list 'revert-without-query ".pdf")) -(setq find-file-visit-truename t) -*** org-contacts -#+begin_src emacs-lisp :tangle config.el -(setq org-contacts-files '("~/enc/org/people.org")) -#+end_src -*** org-roam - -**** org-roam -#+begin_src emacs-lisp :tangle config.el -(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) -(org-roam-db-autosync-enable) - -(setq org-roam-capture-templates - '(("n" "default" plain - "%?" - :if-new (file+head "${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: \n") - :empty-lines 1 - :unnarrowed t) - ("j" "journal" plain - "%?" - :if-new (file+head "journal/journal-${slug}.org" "#+title: ${title}\n#+category: 📔${title}\n#+filetags: 📔\n") - :empty-lines 1 - :unnarrowed t) - ("t" "Therapy" plain - "#+title: ${title}\n" - :if-new (file+head "therapy/therapy-${slug}.org" "#+title: ${title}\n#+category: 📗 ${title}\n#+filetags: 📗\n") - :empty-lines 1 - :unnarrowed))) -#+end_src - -**** Keybinds -#+begin_src emacs-lisp :tangle config.el -(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) -#+end_src - -*** org-agenda -**** Keybinds -#+begin_src emacs-lisp :tangle config.el -(global-set-key "\C-ca" 'org-agenda) -(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) -#+end_src - -**** Settings -#+begin_src emacs-lisp :tangle config.el -(setq org-agenda-start-day nil - org-agenda-span 'day - org-agenda-dim-blocked-tasks t - org-agenda-sorting-strategy - '(time-up priority-up category-keep) - org-deadline-warning-days 4 - org-log-into-drawer t - org-treat-insert-todo-heading-as-state-change t - org-clock-into-drawer t - org-agenda-log-mode-items '(closed clock state) - org-agenda-prefix-format '((agenda . " %l %i %c %s %t") - (todo . " %i %-12:c") - (tags . " %i $-12:c") - (search . " %i %-12:c")) - org-agenda-compact-blocks nil - org-agenda-use-tag-inheritance (quote (agenda));; agenda performance - org-agenda-block-separator "---------") - -(add-hook 'org-agenda-mode-hook '(lambda () (hl-line-mode 1))) -#+end_src - -#+RESULTS: -| (lambda nil (hl-line-mode 1)) | +org-habit-resize-graph-h | org-fancy-priorities-mode | - -***** From Karl Voit -Remove completed deadline tasks from the agenda view -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-skip-deadline-if-done t) -#+END_SRC - -Remove completed scheduled tasks from the agenda view -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-skip-scheduled-if-done t) -#+END_SRC - -Remove completed items from search results -#+BEGIN_SRC emacs-lisp :tangle no -(setq org-agenda-skip-timestamp-if-done t) -#+END_SRC - -Include agenda archive files when searching for things -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-text-search-extra-files (quote (agenda-archives))) -#+END_SRC - -show state changes in log-mode of agenda -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-log-mode-items (quote (state))) -#+END_SRC - -do not search for time in heading when displaying a date-stamp -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-search-headline-for-time nil) -#+END_SRC - -add diary entries in agenda view -http://orgmode.org/org.html#Weekly_002fdaily-agenda -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-include-diary t) -#+END_SRC - -Show all future entries for repeating tasks -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-repeating-timestamp-show-all t) -#+END_SRC - -Show all agenda dates - even if they are empty -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-show-all-dates t) -#+END_SRC - -Sorting order for tasks on the agenda -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-sorting-strategy - (quote ((agenda time-up user-defined-up priority-down category-keep) - (todo priority-down category-keep) - (tags priority-down category-keep) - (search category-keep)))) -#+END_SRC - -#+RESULTS: -| agenda | time-up | user-defined-up | priority-down | category-keep | -| todo | priority-down | category-keep | | | -| tags | priority-down | category-keep | | | -| search | category-keep | | | | - -Start the weekly agenda today -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-start-on-weekday nil) -#+END_SRC - -Non-nil means skip timestamp line if same entry shows because of deadline. -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-skip-timestamp-if-deadline-is-shown t) -#+END_SRC - -Enable display of the time grid so we can see the marker for the current time -#+BEGIN_SRC emacs-lisp :tangle no -(setq org-agenda-time-grid - ((daily today remove-match) - #("----------------" 0 16 - (org-heading t)) - (800 1000 1200 1400 1600 1800 2000))) -#+END_SRC - -Sticky agendas remain opened in the background so that you don't -need to regenerate them each time you hit the corresponding -keystroke. This is a big time saver. -#+BEGIN_SRC emacs-lisp :tangle no -(setq org-agenda-sticky t) -#+END_SRC - -Scrolling through agenda using C-p and C-n instead of PageUp/PageDown -also in agenda. Default setting is C-p/C-n for scrolling one line at a -time. - -#+BEGIN_SRC emacs-lisp :tangle config.el -(define-key org-agenda-mode-map (kbd "C-p") 'my-scroll-down-half) -(define-key org-agenda-mode-map (kbd "C-n") 'my-scroll-up-half) -#+END_SRC - -From [[https://www.reddit.com/r/orgmode/comments/e4stk2/adding_a_separator_line_between_days_in_emacs/][reddit]]: Adding a separator line between days. -Disabled 2020-01-03 because I usually see one single day only. -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-agenda-format-date (lambda (date) (concat "\n" - (make-string (window-width) 9472) - "\n" - (org-agenda-format-date-aligned date)))) -#+END_SRC - - -**** Exports -Export subtree (by default) instead of whole buffer: -http://orgmode.org/manual/The-Export-Dispatcher.html - -#+BEGIN_SRC emacs-lisp :tangle no -(setq org-export-initial-scope 'subtree) -#+END_SRC - -With a densly interconnected Org knowledge-base (e.g., see -=org-super-links=) and a "few but large Org mode files" in combination -with "I'm using export methods on sub-heading levels mostly", you end -up with errors that are caused by links that link stuff which is -outside of the sub-heading hierarchy which should be currently -exported. - -Therefore, you'll need this setting for preventing those errors. -Please be aware that you won't get notified when links that should be -part of the export result get broken because of a typo or similar. - -#+BEGIN_SRC emacs-lisp :tangle config.el -(setq org-export-with-broken-links t) -#+END_SRC -***** Org-Reveal - generate nice presentations out of Org-mode -https://github.com/yjwen/org-reveal -#+BEGIN_QUOTE -- =Reveal.js= is a tool for creating good-looking HTML presentations, authored by Hakim El Hattab. -- For an example of a reveal.js presentation, see [[http://lab.hakim.se/reveal-js/#/][here]]. -- =Org-Reveal= exports your Org documents to reveal.js presentations. -- With Org-reveal, you can create beautiful presentations with 3D effects from simple but powerful Org contents. -#+END_QUOTE - -#+BEGIN_SRC emacs-lisp :tangle no -(use-package ox-reveal - :ensure t - ;;:if (my-system-type-is-windows) - :defer 110 - :config) -#+END_SRC - -***** my-org-copy-region-as-markdown -| 2022-05-03 | initial setup and disabled because of error | - -I've found this nugget on http://mbork.pl/2021-05-02_Org-mode_to_Markdown_via_the_clipboard. - -I often work with tools that accept Markdown as input syntax. When I -prefer Org-mode for authoring, I just have to mark the result in a -region, invoke this snippet and paste in the other tool. - -Please enable Markdown export as stated on https://lists.gnu.org/archive/html/emacs-orgmode/2022-05/msg00062.html - -: (require 'ox-md) - -#+BEGIN_SRC emacs-lisp :tangle config.el -(defun my-org-copy-region-as-markdown () - "Copy the region (in Org) to the system clipboard as Markdown." - (interactive) - (if (use-region-p) - (let* ((region - (buffer-substring-no-properties - (region-beginning) - (region-end))) - (markdown - (org-export-string-as region 'md t '(:with-toc nil)))) - (gui-set-selection 'CLIPBOARD markdown)))) -#+END_SRC - -Debugging: - -#+BEGIN_SRC emacs-lisp :tangle no -(setq region "/foo/ *bar* https://example.com baz") -(org-export-string-as region 'md t '(:with-toc nil)) -#+END_SRC - -**** org-habits -#+begin_src emacs-lisp :tangle config.el -(add-to-list 'org-modules 'habit) -(setq org-habit-following-days 2 - org-habit-preceding-days 7 - org-habit-show-all-today nil - org-habit-show-habits-only-for-today t - org-habit-show-habits t) -#+end_src - -#+RESULTS: -: t - -**** org-habit-stats -#+begin_src emacs-lisp :tangle config.el -(define-key org-mode-map (kbd "C-c h") 'org-habit-stats-view-habit-at-point) -(define-key org-agenda-mode-map (kbd "H") 'org-habit-stats-view-habit-at-point-agenda) -(add-hook 'org-after-todo-state-change-hook 'org-habit-stats-update-properties) -#+end_src - -#+RESULTS: -| org-habit-stats-update-properties | - -**** org-download -this is here as a reminder of the config options, so no tangling -#+begin_src emacs-lisp :tangle no -(setq-default org-download-image-dir "~/enc/org/.attach") -;; can also set for the individual buffer -;; -*- mode: Org; org-download-image-dir: "~/Pictures/foo"; -*- +(add-hook 'pdf-view-mode-hook #'(lambda () (interactive (display-line-numbers-mode)))) #+end_src - *** yasnippets #+begin_src emacs-lisp :tangle config.el (setq doom-snippets-enable-short-helpers t) - -#+end_src -*** dired-open -#+begin_src emacs-lisp :tangle config.el -(setq dired-open-extensions '(("gif" . "sxiv") - ("jpg" . "sxiv") - ("png" . "sxiv") - ("mkv" . "mpv") - ("mp4" . "mpv"))) - -#+end_src -*** mode-icons -#+begin_src emacs-lisp :tangle config.el -(mode-icons-mode) -(add-hook 'dired-mode-hook #'mode-icons--mode-disable) ;; with mode-icons, visiting a dir with dired takes up *lots* of CPU for =mode-icons-reset= (performance-issue) #+end_src *** csv-mode +Just making sure it loads when I load up csv files. #+begin_src emacs-lisp :tangle config.el (add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode)) (autoload 'csv-mode "csv-mode" "Major mode for editing comma-separated value files." t) #+end_src -*** whisper.el (S2T; speech to text) - -- https://github.com/natrys/whisper.el - -#+BEGIN_QUOTE -You will use these functions: - -- =whisper-run= : Toggle between recording from your microphone and transcribing -- =whisper-file= : Same as before but transcribes a local file on disk - -Invoking =whisper-run= with a prefix argument (C-u) has the same effect as =whisper-file= . - -Both of these functions will automatically compile whisper.cpp -dependency and download language model the first time they are run. -When recording is in progress, invoking them stops it and starts -transcribing. Otherwise if compilation, download (of model file) or -transcription job is in progress, calling them again cancels that. -#+END_QUOTE - -Use =whisper-run= once to start recording and a second time for start -the translation process which puts the text into the buffer. This -works *offline* (without cloud or network) and amazingly well for English. - -#+BEGIN_SRC emacs-lisp :results none :tangle no -(use-package whisper - :load-path (lambda () (expand-file-name (concat my-user-emacs-directory "contrib/whisper.el/"))) -;; :bind ("C-H-r" . whisper-run) - :config - (setq whisper-install-directory (concat my-user-emacs-directory "bin/") - whisper-model "base" - whisper-language "de" - whisper-translate nil) - :defer 110 -) -#+END_SRC - -*** hledger-mode +*** sly +Basic settings for Common Lisp development. #+begin_src emacs-lisp :tangle config.el -;; To open files with .journal extension in hledger-mode -(add-to-list 'auto-mode-alist '("\\.journal\\'" . hledger-mode)) +;; (load (expand-file-name "~/.roswell/helper.el")) -;; Provide the path to you journal file. -;; The default location is too opinionated. -(setq hledger-jfile "~/enc/org/hledger/2023.journal") - -;;; Auto-completion for account names -;; For company-mode users, -(add-to-list 'company-backends 'hledger-company) +(setq inferior-lisp-program "sbcl --dynamic-space-size 8192 -Q -l ~/.sbclrc") #+end_src - *** gptel +This is exclusively local, as I am not entirely comfortable letting third +parties into my journals and personal notes. I usually run LLMs as they come, +using them largely for brainstorming when I'm trying to plan out projects or +consider my habits. + +With their context size only increasing as time goes by, this is turning into a +very easy way to get feedback on the ideas I have. #+begin_src emacs-lisp :tangle config.el (use-package! gptel :config @@ -1548,33 +1020,13 @@ works *offline* (without cloud or network) and amazingly well for English. #+RESULTS: : t -*** erc -**** config -#+begin_src emacs-lisp :tangle config.el -;; Set our nickname & real-name as constant variables -(setq - erc-nick "phil_bb" ; Our IRC nick - erc-user-full-name "Phil B.") ; Our /whois name - -;; Define a function to connect to a server -(defun erc/libera () - (interactive) - (erc :server "irc.libera.chat" - :port "6667")) -#+end_src - -#+RESULTS: -: erc/libera *** elfeed +RSS is not dead. RSS is not dead. RSS is not dead. #+begin_src emacs-lisp :tangle config.el (setq-default elfeed-search-filter "@1-week-ago +unread ") #+end_src - -#+RESULTS: -: @1-week-ago +unread - * custom.el -Custom variables. Note that this file is generally set up automatically by Emacs" so I'm not exporting this block. I'm keeping the default warning commants in just for completion here. +Custom variables. Note that this file is generally set up automatically by Emacs" so I'm not exporting this block. I'm keeping the default warning comments in just for completion here. #+begin_src emacs-lisp :tangle no (custom-set-variables) ;; custom-set-variables was added by Custom. @@ -1589,8 +1041,6 @@ Custom variables. Note that this file is generally set up automatically by Emacs ) #+end_src * init.el -This is the state as of <2023-08-12 Sat>. I'm sure Doom Emacs will expand/ change/ add/ remove things over time" but this is what I use right now. - #+begin_src emacs-lisp :tangle init.el ;;; init.el -*- lexical-binding: t; -*- @@ -1675,13 +1125,12 @@ This is the state as of <2023-08-12 Sat>. I'm sure Doom Emacs will expand/ chang :checkers syntax ; tasing you for every semicolon you forget - ;;(spell +flyspell) ; tasing you for misspelling mispelling - grammar ; tasing grammar mistake every you make + (spell +flyspell) ; tasing you for misspelling mispelling + ;;grammar ; tasing grammar mistake every you make :tools ansible ;;biblio ; Writes a PhD for you (citation needed) - ;;collab ; buffers with friends debugger ; FIXME stepping through code" to help you add bugs ;;direnv docker @@ -1698,9 +1147,8 @@ This is the state as of <2023-08-12 Sat>. I'm sure Doom Emacs will expand/ chang ;;prodigy ; FIXME managing external services & code builders rgb ; creating color strings ;;taskrunner ; taskrunner for all your projects - ;;terraform ; infrastructure as code + terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux - ;;tree-sitter ; syntax and parsing" sitting in a tree... ;;upload ; map local to remote projects via ssh/ftp :os @@ -1711,13 +1159,13 @@ This is the state as of <2023-08-12 Sat>. I'm sure Doom Emacs will expand/ chang ;;agda ; types of types of types of types... ;;beancount ; mind the GAAP (cc +lsp) ; C > C++ == 1 - (clojure +lsp) ; java with a lisp + ;;(clojure +lsp) ; java with a lisp common-lisp ; if you've seen one lisp" you've seen them all ;;coq ; proofs-as-programs ;;crystal ; ruby at the speed of c ;;csharp ; unity" .NET" and mono shenanigans data ; config/data formats - (dart +flutter) ; paint ui and not much else + ;;(dart +flutter) ; paint ui and not much else ;;dhall ;;elixir ; erlang done right ;;elm ; care for a cup of TEA? @@ -1729,33 +1177,33 @@ This is the state as of <2023-08-12 Sat>. I'm sure Doom Emacs will expand/ chang ;;fortran ; in FORTRAN" GOD is REAL (unless declared INTEGER) ;;fsharp ; ML stands for Microsoft's Language ;;fstar ; (dependent) types and (monadic) effects and Z3 - gdscript ; the language you waited for - ;;(go +lsp) ; the hipster dialect + ;;gdscript ; the language you waited for + (go +lsp) ; the hipster dialect ;;(graphql +lsp) ; Give queries a REST (haskell +lsp) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on json ; At least it ain't XML - (java +lsp) ; the poster child for carpal tunnel syndrome + ;;(java +lsp) ; the poster child for carpal tunnel syndrome (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) - (julia +lsp) ; a better" faster MATLAB + ;;(julia +lsp) ; a better" faster MATLAB ;;kotlin ; a better" slicker Java(Script) latex ; writing papers in Emacs has never been so fun ;;lean ; for folks with too much to prove ;;ledger ; be audit you can be - lua ; one-based indices? one-based indices + ;;lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c - nix ; I hereby declare "nix geht mehr!" + ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel (org +dragndrop +pandoc +pretty +gnuplot +roam2) ; organize your plain life in plain text - php ; perl's insecure younger brother + ;;php ; perl's insecure younger brother plantuml ; diagrams for confusing people more ;;purescript ; javascript" but functional (python +lsp) ; beautiful is better than ugly ;;qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs - raku ; the artist formerly known as perl6 + ;;raku ; the artist formerly known as perl6 ;;rest ; Emacs as a REST client ;;rst ; ReST in peace ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} @@ -1769,7 +1217,7 @@ This is the state as of <2023-08-12 Sat>. I'm sure Doom Emacs will expand/ chang ;;terra ; Earth and Moon in alignment for performance. (web +lsp) ; the tubes yaml ; JSON" but readable - (zig +lsp) ; C" but simpler + ;;(zig +lsp) ; C" but simpler :email (mu4e +org +gmail) @@ -1780,7 +1228,7 @@ This is the state as of <2023-08-12 Sat>. I'm sure Doom Emacs will expand/ chang calendar ;;emms everywhere ; *leave* Emacs!? You must be joking - ;;irc ; how neckbeards socialize + irc ; how neckbeards socialize (rss +org) ; emacs as an RSS reader ;;twitter ; twitter client https://twitter.com/vnought @@ -1793,61 +1241,6 @@ This is the state as of <2023-08-12 Sat>. I'm sure Doom Emacs will expand/ chang #+RESULTS: * packages.el -** Info from the included (default) comments: -To install a package with Doom you must declare them here and run 'doom sync' on the command line" then restart Emacs for the changes to take effect -- or use 'M-x doom/reload'. - -*** Install from MELPA" ELPA or emacsmirror: -#+begin_src emacs-lisp :tangle no -(package! some-package) -#+end_src - - -*** Install a package directly from git repo: -Specify a ~:recipe~. [[https://github.com/raxod502/straight.el#the-recipe-format][Documentation.]] -#+begin_src emacs-lisp :tangle no -(package! another-package :recipe (:host github - :repo "username/repo")) -#+end_src -If there is no PACKAGENAME.el file" or it's in a subdirectory" specify ~:files~ in the ~:recipe~: -#+begin_src emacs-lisp :tangle no -(package! this-package - :recipe (:host github :repo "username/repo" - :files ("some-file.el" "src/lisp/*.el"))) -#+end_src - -*** Disable packages included with Doom Emacs: -#+begin_src emacs-lisp :tangle no -~(package! builtin-package :disable t)~ -#+end_src -*** Override package recipe: -If a property in a ~:recipe~ isn't specified" it will use defaults from Doom/MELPA/ELPA/Emacsmirror. -#+begin_src emacs-lisp :tangle no -(package! builtin-package :recipe (:nonrecursive t)) -(package! builtin-package-2 :recipe (:repo "myfork/package")) -#+end_src -You can override the recipe of a built in package without having to -specify all the properties for `:recipe'. These will inherit the rest -of its recipe from Doom or MELPA/ELPA/Emacsmirror: - -*** Install package from specific branch: -You can set the ~:branch~ property. This is required for some packages. -#+begin_src emacs-lisp :tangle no -(package! builtin-package :recipe (:branch "develop")) -#+end_src -*** Install a specific commit: -You can set ~:pin~. -#+begin_src emacs-lisp :tangle no -(package! builtin-package :pin "1a2b3c4d5e") -#+end_src -*** Unpin a commit: -Doom's packages are pinned to a specific commit and updated from release to -release. You can ~unpin!~ them. Note ~(unpin! t)~ unpins all the packages and can break your Emacs. -#+begin_src emacs-lisp :tangle no -(unpin! pinned-package) -(unpin! pinned-package another-pinned-package) -(unpin! t) -#+end_src -** Packages: *** Core #+begin_src emacs-lisp :tangle packages.el ;; -*- no-byte-compile: t; -*- @@ -1862,7 +1255,6 @@ release. You can ~unpin!~ them. Note ~(unpin! t)~ unpins all the packages and ca #+begin_src emacs-lisp :tangle packages.el (package! all-the-icons) (package! all-the-icons-dired) - (package! doom-themes) #+end_src *** Modes: @@ -1879,10 +1271,6 @@ release. You can ~unpin!~ them. Note ~(unpin! t)~ unpins all the packages and ca #+begin_src emacs-lisp :tangle packages.el (package! dired-open) #+end_src -*** various? -#+begin_src emacs-lisp :tangle packages.el -;; (package! helm-xref) -#+end_src *** pdf-tools #+begin_src emacs-lisp :tangle packages.el (package! pdf-tools) @@ -1916,73 +1304,33 @@ release. You can ~unpin!~ them. Note ~(unpin! t)~ unpins all the packages and ca (package! org-wild-notifier) (package! org-habit-stats) #+end_src -*** Yasnippet +**** org-expiry #+begin_src emacs-lisp :tangle packages.el +(package! org-contrib + :recipe (:host sourcehut :type git + :repo "~bzg/org-contrib" + :files ("lisp/*.el"))) #+end_src - -*** Org-depend -Ensure task dependencies are met. -#+begin_src emacs-lisp :tangle no -(package! org-depend - :recipe ( - :host github - :repo "fgeller/org-mode" - :files ("contrib/lisp/org-depend.el"))) -#+end_src -*** org-edna -:PROPERTIES: -:ID: a6c4440f-10b5-4353-acc9-bfcab0a089a3 -:END: -#+begin_src emacs-lisp :tangle packages.el -(package! org-edna) -(package! org-super-links - :recipe ( - :type git - :host github - :repo "toshism/org-super-links" - :branch "develop" - )) -#+end_src -*** Elgantt -:PROPERTIES: -:ID: 2d5897d1-6e8c-4163-a131-42daef5856cb -:END: -Pretty Gantt chart for your agenda. -#+begin_src emacs-lisp :tangle packages.el -(package! elgantt - :recipe (:host github :repo "legalnonsense/elgantt")) -#+end_src -*** mode-icons -#+begin_src emacs-lisp :tangle packages.el -(package! mode-icons) -#+end_src -*** qrencode -#+begin_src emacs-lisp :tangle packages.el -(package! qrencode) -#+end_src -*** hledger -#+begin_src emacs-lisp :tangle packages.el -(package! hledger-mode) -#+end_src -*** copilot.el +*** LLM +Some packages for dealing with LLM integrations. +**** copilot.el #+begin_src emacs-lisp :tangle no (package! copilot :recipe (:host github :repo "zerolfx/copilot.el" :files ("*.el" "dist"))) #+end_src -*** elpher -#+begin_src emacs-lisp :tangle packages.el -(package! elpher) -#+end_src -*** multiple-cursors -#+begin_src emacs-lisp :tangle packages.el -(package! multiple-cursors) - -#+end_src -*** gptel +**** gptel +I mostly use this for my locally hosted LLM solutions. It's pretty neat since +large-context models are coming out at an increasing pace. #+begin_src emacs-lisp :tangle packages.el (package! gptel :recipe (:host github :repo "karthink/gptel" :files ("*.el"))) #+end_src +*** Better Internet +**** elpher +Gopher and Gemini browser in Emacs! +#+begin_src emacs-lisp :tangle packages.el +(package! elpher) +#+end_src diff --git a/.config/doom/config.el b/.config/doom/config.el index 7942a7a..834d6e8 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -1,19 +1,18 @@ (setq user-full-name "Phil Bajsicki") -;; must be set before `org` is loaded -(setq org-directory "~/enc/org/") -(setq org-agenda-files (directory-files-recursively "~/enc/org/" ".org$"))1 - -(setq global-auto-revert-mode t) -(setq auth-sources '("~/.authinfo")) (setq-default backup-inhibited t) +(setq global-auto-revert-mode t) +(setq-default indent-tabs-mode t) + +(setq find-file-visit-truename t) + +(setq auth-sources '("~/.authinfo")) (setq locale-coding-system 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (set-clipboard-coding-system 'utf-8) (prefer-coding-system 'utf-8) -(setq-default indent-tabs-mode t) (setq langtool-java-bin "/usr/bin/java") @@ -24,6 +23,23 @@ (doom-themes-neotree-config) (doom-themes-org-config) +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) + +(modify-all-frames-parameters + '((right-divider-width . 0) + (internal-border-width . 0))) +(dolist (face '(window-divider + window-divider-first-pixel + window-divider-last-pixel)) + (face-spec-reset-face face) + (set-face-foreground face (face-attribute 'default :background))) +(set-face-background 'fringe (face-attribute 'default :background)) + +(set-frame-parameter nil 'alpha-background 85) +(add-to-list 'default-frame-alist '(alpha-background . 85)) + (setq doom-themes-enable-bold t doom-themes-enable-italic t doom-font (font-spec :family "Iosevka" :size 14) @@ -58,142 +74,141 @@ ;; per mode with `ligature-mode'. (global-ligature-mode t) -(set-frame-parameter nil 'alpha-background 85) -(add-to-list 'default-frame-alist '(alpha-background . 85)) - -(setq display-line-numbers-type 'relative) -(setq next-screen-context-lines 4) +(setq display-line-numbers-type 'relative) ;; best honestly (setq-default global-visual-line-mode t) -(setq x-stretch-cursor t) (setq column-number-mode t) - -(setq-default calendar-week-start-day 1) +(setq next-screen-context-lines 4) +(setq x-stretch-cursor t) (global-set-key "\C-g" 'keyboard-quit) (global-set-key "\C-cu" 'browse-url-chrome) (setq straight-repository-branch "develop") -(use-package! pdf-tools - :defer t - :commands (pdf-loader-install) - :mode "\\.pdf\\'" - :bind (:map pdf-view-mode-map - ("n" . pdf-view-next-line-or-next-page) - ("p" . pdf-view-previous-line-or-previous-page) - ("C-=" . pdf-view-enlarge) - ("C--" . pdf-view-shrink)) - :init (pdf-loader-install) - :config (add-to-list 'revert-without-query ".pdf")) - -(add-hook 'pdf-view-mode-hook #'(lambda () (interactive (display-line-numbers-mode)))) +;; must be set before `org` is loaded (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) -(setq org-image-actual-width nil) -(setq org-enforce-todo-dependencies t) -(setq org-reverse-note-order nil) -(setq org-deadline-warning-days 7) -(setq org-blank-before-new-entry (quote ((heading . t) - (plain-list-item . nil)))) -(setq org-num-mode t) -(setq org-todo-repeat-to-state "LOOP") -(setq org-remove-highlights-with-change nil) -(setq org-read-date-prefer-future t) -(setq org-special-ctrl-a/e t) -(setq org-special-ctrl-k t) -(setq org-yank-adjusted-subtrees t) -(setq org-M-RET-may-split-line (quote (default . t))) -(setq org-log-done (quote time)) -(setq org-log-into-drawer t) -(setq org-catch-invisible-edits "smart") -(setq org-use-property-inheritance nil) -(setq org-duration-format 'h:mm) -(setq org-hierarchical-todo-statistics t) +(setq-default calendar-week-start-day 1) -(defun my-org-tree-to-indirect-buffer (&optional arg) - "Create indirect buffer and narrow it to current subtree. -The buffer is named after the subtree heading, with the filename -appended. If a buffer by that name already exists, it is -selected instead of creating a new buffer." - (interactive "P") - (let* ((new-buffer-p) - (pos (point)) - (buffer-name (let* ((heading (org-get-heading t t)) - (level (org-outline-level)) - (face (intern (concat "outline-" (number-to-string level)))) - (heading-string (propertize (org-link-display-format heading) - 'face face))) - (concat heading-string "::" (buffer-name)))) - (new-buffer (or (get-buffer buffer-name) - (prog1 (condition-case nil - (make-indirect-buffer (current-buffer) buffer-name 'clone) - (error (make-indirect-buffer (current-buffer) buffer-name))) - (setq new-buffer-p t))))) - (switch-to-buffer new-buffer) - (when new-buffer-p - ;; I don't understand why setting the point again is necessary, but it is. - (goto-char pos) - (rename-buffer buffer-name) - (org-narrow-to-subtree)))) +(setq org-contacts-files '("~/enc/org/people.org")) +(setq org-directory "~/enc/org/") -(advice-add 'org-tree-to-indirect-buffer :override 'my-org-tree-to-indirect-buffer) +(setq org-agenda-files (directory-files-recursively "~/enc/org/" ".org$"))1 -(setq org-element--cache-self-verify nil) +(setq org-refile-targets '((nil :maxlevel . 9) + (org-agenda-files :maxlevel . 9))) +(setq org-outline-path-complete-in-steps nil) +(setq org-refile-use-outline-path 'file) - (setq org-image-actual-width '(600)) - -(package-initialize) -(menu-bar-mode -1) -(tool-bar-mode -1) -(scroll-bar-mode -1) -;; (modus-themes-load-operandi) - -;; Choose some fonts -;; (set-face-attribute 'default nil :family "Iosevka") -;; (set-face-attribute 'variable-pitch nil :family "Iosevka Aile") -;; (set-face-attribute 'org-modern-symbol nil :family "Iosevka") - -;; Add frame borders and window dividers -(modify-all-frames-parameters - '((right-divider-width . 0) - (internal-border-width . 0))) -(dolist (face '(window-divider - window-divider-first-pixel - window-divider-last-pixel)) - (face-spec-reset-face face) - (set-face-foreground face (face-attribute 'default :background))) -(set-face-background 'fringe (face-attribute 'default :background)) - -(setq - ;; Edit settings - org-auto-align-tags nil - org-tags-column 0 - org-catch-invisible-edits 'show-and-error - org-special-ctrl-a/e t - org-insert-heading-respect-content t - - ;; Org styling, hide markup etc. - org-hide-emphasis-markers t - org-pretty-entities t - - ;; Agenda styling - org-agenda-tags-column 0 - org-agenda-block-separator ?─ - org-agenda-time-grid - '((daily today require-timed) - (800 1000 1200 1400 1600 1800 2000) - " ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄") - org-agenda-current-time-string - "◀── now ─────────────────────────────────────────────────") - -;; Ellipsis styling -;; (setq org-ellipsis "…") -;; (set-face-attribute 'org-ellipsis nil :inherit 'default :box nil) +(setq org-image-actual-width '(0.8)) (global-org-modern-mode) +(setq org-read-date-prefer-future t) + +(setq org-reverse-note-order nil) + +(setq org-blank-before-new-entry (quote ((heading . nil) + (plain-list-item . nil)))) + +(setq org-catch-invisible-edits "smart") + +(setq org-special-ctrl-a/e t) +(setq org-special-ctrl-k t) + +(setq org-yank-adjusted-subtrees t) + +(setq org-M-RET-may-split-line '((headline . t) + (item . t) + (default . nil))) + +(setq org-insert-heading-respect-content nil) + +(setq org-footnote-section nil) + +(setq org-log-done (quote time) + org-log-into-drawer t + org-clock-into-drawer t) + +(setq org-treat-insert-todo-heading-as-state-change nil) + +(setq org-use-property-inheritance nil) +;;(setq org-use-property-inheritance '(category columns archive logging)) + +(setq-default org-enforce-todo-dependencies t) +(setq org-enforce-todo-checkbox-dependencies t) + +(setq org-deadline-warning-days 7) + +(setq org-provide-todo-statistics t + org-hierarchical-todo-statistics t) + +(setq org-todo-repeat-to-state "LOOP") + +(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 + '( + ("INBOX" :foreground "cyan" :weight bold) + ("TASK" :foreground "purple" :weight bold) + ("PROJ" :foreground "violet" :weight bold) + ("LOOP" :foreground "magenta" :weight bold) + ("WAIT" :foreground "yellow" :weight bold) + ("HOLD" :foreground "orange" :weight bold) + ("DONE" :foreground "green" :weight bold) + ("KILL" :foreground "grey" :weight bold))) + +(setq org-fontify-done-headline t) +(custom-set-faces + '(org-done ((t (:foreground "PaleGreen" + :weight normal + :strike-through t)))) + '(org-headline-done + ((((class color) (min-colors 16) (background dark)) + (:foreground "LightSalmon" :strike-through t))))) + +(global-set-key "\C-cl" 'org-store-link) +(global-set-key "\C-cnn" 'org-capture) + +(global-set-key "\C-cia" '(lambda ()(interactive) + (org-time-stamp '(16)))) +(global-set-key "\C-cii" '(lambda () (interactive) + (org-time-stamp-inactive '(16)))) + +(setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/agenda.org" "Inbox") "* %i%?") + ("i" "idea" entry (file+headline "~/enc/org/agenda.org" "Ideas") "* %?") + ("d" "reminder" entry (file+headline "~/enc/org/agenda.org" "Reminders") "* %i%? \n %U") + ("p" "person" entry (file+headline "~/enc/org/people.org" "Sort") + "* %(org-contacts-template-name) +:PROPERTIES: +:EMAIL: %(org-contacts-template-email) +:PHONE: +:ALIAS: +:NICKNAME: +:IGNORE: +:ICON: +:NOTE: +:ADDRESS: +:BIRTHDAY: +:END:"))) + (defun my-dir-to-org (dir org-file) "Create a file ORG-FILE which has all txt files in DIR as linked headlines and the contents of the files below the headlines." @@ -236,109 +251,33 @@ and the contents of the files below the headlines." (file-name-base dir) ".org"))) dirs-full))) -(setq-default org-enforce-todo-dependencies t) -(setq org-enforce-todo-checkbox-dependencies t) +(defun my-org-tree-to-indirect-buffer (&optional arg) + "Create indirect buffer and narrow it to current subtree. +The buffer is named after the subtree heading, with the filename +appended. If a buffer by that name already exists, it is +selected instead of creating a new buffer." + (interactive "P") + (let* ((new-buffer-p) + (pos (point)) +w (buffer-name (let* ((heading (org-get-heading t t)) + (level (org-outline-level)) + (face (intern (concat "outline-" (number-to-string level)))) + (heading-string (propertize (org-link-display-format heading) + 'face face))) + (concat heading-string "::" (buffer-name)))) + (new-buffer (or (get-buffer buffer-name) + (prog1 (condition-case nil + (make-indirect-buffer (current-buffer) buffer-name 'clone) + (error (make-indirect-buffer (current-buffer) buffer-name))) + (setq new-buffer-p t))))) + (switch-to-buffer new-buffer) + (when new-buffer-p + ;; I don't understand why setting the point again is necessary, but it is. + (goto-char pos) + (rename-buffer buffer-name) + (org-narrow-to-subtree)))) -(require 'org-auto-tangle) -(add-hook 'org-mode-hook 'org-auto-tangle-mode) - -(add-hook 'write-file-hooks 'time-stamp) -(add-hook 'org-mode-hook - (lambda () - ;; yasnippet - ;;disabled; (make-variable-buffer-local 'yas/trigger-key) - ;;disabled; (org-set-local 'yas/trigger-key [tab]) - ;;disabled; (define-key yas/keymap [tab] 'yas/next-field-group) - ;; flyspell mode for spell checking everywhere - ;;disabled; (flyspell-mode 1) - ;; auto-fill mode on - (auto-fill-mode 1))) - - (add-to-list 'font-lock-extra-managed-props 'display) - -(font-lock-add-keywords - 'org-mode - '(("\\({{{[a-zA-Z#%)(_-+0-9]+}}}\\)" 0 - `(face nil display - ,(format "%s" - (let* ((input-str (match-string 0)) - (el (with-temp-buffer - (insert input-str) - (goto-char (point-min)) - (org-element-context))) - (text (org-macro-expand el org-macro-templates))) - (if text - text - input-str))))))) - -(global-set-key "\C-cl" 'org-store-link) -(global-set-key "\C-ch" 'counsel-org-link) -(global-set-key "\C-cne" 'elgantt-open) -(global-set-key "\C-cnn" 'org-capture) - -(global-set-key "\C-cia" '(lambda ()(interactive) - (org-time-stamp '(16)))) -(global-set-key "\C-cii" '(lambda () (interactive) - (org-time-stamp-inactive '(16)))) - -(after! org-mode - (add-hook! 'org-insert-heading-hook - (if - (or - (string-match-p "journal.org" buffer-file-name) - (string-match-p "money" buffer-file-name) - (string-match-p "therapy.org" buffer-file-name)) - ((lambda () - (interactive) - (org-time-stamp-inactive '(16)) - (newline))) - (setq org-insert-heading-hook nil) - ))) - -(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 - '( - ("INBOX" :foreground "cyan" :weight bold) - ("TASK" :foreground "purple" :weight bold) - ("PROJ" :foreground "violet" :weight bold) - ("LOOP" :foreground "magenta" :weight bold) - ("WAIT" :foreground "yellow" :weight bold) - ("HOLD" :foreground "orange" :weight bold) - ("DONE" :foreground "green" :weight bold) - ("KILL" :foreground "grey" :weight bold))) - -(setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/agenda.org" "Inbox") "* %i%?") - ("i" "idea" entry (file+headline "~/enc/org/agenda.org" "Ideas") "* %?") - ("d" "reminder" entry (file+headline "~/enc/org/agenda.org" "Reminders") "* %i%? \n %U") - ("p" "person" entry (file+headline "~/enc/org/people.org" "Sort") - "* %(org-contacts-template-name) -:PROPERTIES: -:EMAIL: %(org-contacts-template-email) -:PHONE: -:ALIAS: -:NICKNAME: -:IGNORE: -:ICON: -:NOTE: -:ADDRESS: -:BIRTHDAY: -:END:"))) +(advice-add 'org-tree-to-indirect-buffer :override 'my-org-tree-to-indirect-buffer) (setq org-archive-default-command #'org-archive-subtree-hierarchically) @@ -383,92 +322,106 @@ and the contents of the files below the headlines." (org-end-of-subtree t t) (org-paste-subtree level tree-text)))))))) -(setq my-linkcolor-org "wheat3") -(setq my-linkcolor-file "MediumSeaGreen") -(setq my-linkcolor-web "DeepSkyBlue") +(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) +(org-roam-db-autosync-enable) -(defun my-set-linkcolors () - "Defines the colors of various link colors" - (interactive) +(setq org-roam-capture-templates + '(("n" "default" plain + "%?" + :if-new (file+head "${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: \n") + :empty-lines 1 + :unnarrowed t) + ("t" "Therapy" plain + "#+title: ${title}\n" + :if-new (file+head "therapy/therapy-${slug}.org" "#+title: ${title}\n#+category: 📗 ${title}\n#+filetags: 📗\n") + :empty-lines 1 + :unnarrowed))) - ;; Org links -------------------------------------------------------------------------- +(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) - (org-link-set-parameters "id" :face `(:foreground ,my-linkcolor-org :underline t)) - (org-link-set-parameters "contact" :face `(:foreground ,my-linkcolor-org :underline t)) +(setq org-agenda-start-day nil) +(setq org-agenda-start-on-weekday nil) +(setq org-agenda-span 'day) - ;; File links -------------------------------------------------------------------------- +(setq org-agenda-dim-blocked-tasks t) +(setq org-agenda-compact-blocks t) - (org-link-set-parameters "file" :face `(:foreground ,my-linkcolor-file :underline t)) - ;; defined elsewhere;; (org-link-set-parameters "tsfile" :face '`(:foreground "DarkSeaGreen" :underline t)) - (org-link-set-parameters "pdf" :face `(:foreground ,my-linkcolor-file :underline t)) +(setq org-agenda-skip-timestamp-if-deadline-is-shown t) - (org-link-set-parameters "EPA" :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "EPAAFO" :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "JAFO" :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "DAKEPA" :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "BMTSK" :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "ISO" :face `(:foreground ,my-linkcolor-file :underline t)) +(setq org-agenda-skip-deadline-if-done t) +(setq org-agenda-skip-scheduled-if-done t) - (org-link-set-parameters "gemSpec_DS_Anbieter" - :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "gemSpec_Net" - :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "gemSpec_PKI" - :face `(:foreground ,my-linkcolor-file :underline t)) - (org-link-set-parameters "gemSpec_IDP_Dienst" - :face `(:foreground ,my-linkcolor-file :underline t)) +(setq org-agenda-text-search-extra-files (quote (agenda-archives))) - (org-link-set-parameters "messageid" - :face `(:foreground ,my-linkcolor-file :underline t)) +(setq org-agenda-search-headline-for-time nil) - ;; Web links -------------------------------------------------------------------------- +(setq org-agenda-show-all-dates t) - (org-link-set-parameters "http" :face `(:foreground ,my-linkcolor-web :underline t)) - (org-link-set-parameters "https" :face `(:foreground ,my-linkcolor-web :underline t)) +(setq org-agenda-log-mode-items '(closed clock state)) -) +(setq org-agenda-sorting-strategy + (quote ((agenda time-up user-defined-up priority-down category-keep) + (todo priority-down category-keep) + (tags priority-down category-keep) + (search category-keep)))) -(defun my-set-linkcolors () - "Defines the colors of various link colors" - (interactive) +(setq org-agenda-use-tag-inheritance (quote (agenda))) - ;; Org links -------------------------------------------------------------------------- +(setq org-agenda-prefix-format '((agenda . " %l %i %c %s %t") + (todo . " %i %-12:c") + (tags . " %i $-12:c") + (search . " %i %-12:c"))) - (org-link-set-parameters "id" :face '(:foreground "wheat3" :underline t)) - (org-link-set-parameters "contact" :face '(:foreground "wheat3" :underline t)) +(setq org-agenda-tags-column -80 + org-agenda-block-separator ?─ + org-agenda-current-time-string "◀── now ─────────────────────────────────────────────────") - ;; File links -------------------------------------------------------------------------- +(setq org-agenda-time-grid + '((daily today remove-match) + (800 1000 1200 1400 1600 1800 2000) + " ┄┄┄┄┄ " + "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄")) - (org-link-set-parameters "file" :face '(:foreground "MediumSeaGreen" :underline t)) - ;; defined elsewhere;; (org-link-set-parameters "tsfile" :face ''(:foreground "DarkSeaGreen" :underline t)) - (org-link-set-parameters "pdf" :face '(:foreground "MediumSeaGreen" :underline t)) +(add-hook 'org-agenda-mode-hook '(lambda () (hl-line-mode 1))) - (org-link-set-parameters "EPA" :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "EPAAFO" :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "JAFO" :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "DAKEPA" :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "BMTSK" :face '(:foreground "MediumSeaGreen" :underline t)) +(add-to-list 'org-modules 'habit) +(setq org-habit-following-days 2 + org-habit-preceding-days 7 + org-habit-show-all-today nil + org-habit-show-habits-only-for-today t + org-habit-show-habits t) - (org-link-set-parameters "gemSpec_DS_Anbieter" - :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "gemSpec_Net" - :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "gemSpec_PKI" - :face '(:foreground "MediumSeaGreen" :underline t)) - (org-link-set-parameters "gemSpec_IDP_Dienst" - :face '(:foreground "MediumSeaGreen" :underline t)) +(define-key org-mode-map (kbd "C-c h") 'org-habit-stats-view-habit-at-point) +(add-hook 'org-after-todo-state-change-hook 'org-habit-stats-update-properties) - (org-link-set-parameters "messageid" - :face '(:foreground "MediumSeaGreen" :underline t)) +(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) +(global-set-key (kbd "C->") 'mc/mark-next-like-this) +(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) +(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) - ;; Web links -------------------------------------------------------------------------- +(require 'org-auto-tangle) +(add-hook 'org-mode-hook 'org-auto-tangle-mode) - (org-link-set-parameters "http" :face '(:foreground "DeepSkyBlue" :underline t)) - (org-link-set-parameters "https" :face '(:foreground "DeepSkyBlue" :underline t)) +(after! org + (add-hook! 'org-insert-heading-hook + (if (or + (string-match-p "journal.org" buffer-file-name) + (string-match-p "money.org" buffer-file-name) + (string-match-p "therapy.org" buffer-file-name)) + (progn + (org-time-stamp-inactive '(16)) + (newline))))) -) - -(my-set-linkcolors) ;; set colors when loading +(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) (require 'org-crypt) (require 'epa-file) @@ -478,41 +431,7 @@ and the contents of the files below the headlines." (setq org-crypt-key "phil@bajsicki.com") (setenv "GPG_AGENT_INFO" nil) - - -(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e/") - -(setq mu4e-change-filenames-when-moving t) -(setq mu4e-update-interval (* 10 60)) -(setq mu4e-get-mail-command "mbsync -a") -(setq mu4e-maildir "~/enc/.mail") - -(setq mu4e-drafts-folder "/Drafts") -(setq mu4e-sent-folder "/Sent") -(setq mu4e-refile-folder "/Refile") -(setq mu4e-trash-folder "/Trash") - -(mu4e t) - -;; (load (expand-file-name "~/.roswell/helper.el")) - -(setq inferior-lisp-program "sbcl --dynamic-space-size 8192 -Q -l ~/.sbclrc") - -(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) -(global-set-key (kbd "C->") 'mc/mark-next-like-this) -(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) -(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) - -(use-package! org-transclusion - :after org - :init - (map! - :map global-map "" #'org-transclusion-add - :leader - :prefix "n" - :desc "Org Transclusion Mode" "t" #'org-transclusion-mode)) - -(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) +(use-package! org-expiry) (with-eval-after-load 'ox-latex (add-to-list 'org-latex-classes @@ -534,23 +453,14 @@ and the contents of the files below the headlines." ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) -(defun org-super-links-quick-related () - (interactive) - (let ((org-super-links-link-prefix "\nrelated: ")) - (org-super-links-link))) - -(setq org-super-links-related-into-drawer t) -(setq org-super-links-related-drawer-default-name "RELATED" - org-super-links-link-prefix 'org-super-links-link-prefix-timestamp) - -(setq org-export-with-broken-links t) ;; avoiding error on export - -(global-unset-key (kbd "C-c l")) -(global-set-key (kbd "C-c l l") 'org-super-links-link) -(global-set-key (kbd "C-c l s") 'org-super-links-store-link) -(global-set-key (kbd "C-c l i") 'org-super-links-insert-drawer-link) -(global-set-key (kbd "C-c l r") 'org-super-links-quick-related) -(global-set-key (kbd "C-c l d") 'org-super-links-delete-link) +(use-package! org-transclusion + :after org + :init + (map! + :map global-map "" #'org-transclusion-add + :leader + :prefix "n" + :desc "Org Transclusion Mode" "t" #'org-transclusion-mode)) (org-wild-notifier-mode) (setq alert-default-style 'libnotify @@ -558,157 +468,45 @@ and the contents of the files below the headlines." org-wild-notifier-keyword-whitelist nil ;; good for testing org-wild-notifier--alert-severity 'high - alert-fade-time 50 - ) + alert-fade-time 50) -(setq org-refile-targets '((nil :maxlevel . 9) - (org-agenda-files :maxlevel . 9))) -(setq org-outline-path-complete-in-steps nil) -(setq org-refile-use-outline-path t) +(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e/") -(setq org-contacts-files '("~/enc/org/people.org")) +(setq mu4e-change-filenames-when-moving t) +(setq mu4e-update-interval (* 10 60)) +(setq mu4e-get-mail-command "mbsync -a") +(setq mu4e-maildir "~/enc/.mail") -(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) -(org-roam-db-autosync-enable) +(setq mu4e-drafts-folder "/Drafts") +(setq mu4e-sent-folder "/Sent") +(setq mu4e-refile-folder "/Refile") +(setq mu4e-trash-folder "/Trash") -(setq org-roam-capture-templates - '(("n" "default" plain - "%?" - :if-new (file+head "${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: \n") - :empty-lines 1 - :unnarrowed t) - ("j" "journal" plain - "%?" - :if-new (file+head "journal/journal-${slug}.org" "#+title: ${title}\n#+category: 📔${title}\n#+filetags: 📔\n") - :empty-lines 1 - :unnarrowed t) - ("t" "Therapy" plain - "#+title: ${title}\n" - :if-new (file+head "therapy/therapy-${slug}.org" "#+title: ${title}\n#+category: 📗 ${title}\n#+filetags: 📗\n") - :empty-lines 1 - :unnarrowed))) +(mu4e t) -(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) +(use-package! pdf-tools + :defer t + :commands (pdf-loader-install) + :mode "\\.pdf\\'" + :bind (:map pdf-view-mode-map + ("n" . pdf-view-next-line-or-next-page) + ("p" . pdf-view-previous-line-or-previous-page) + ("C-=" . pdf-view-enlarge) + ("C--" . pdf-view-shrink)) + :init (pdf-loader-install) + :config (add-to-list 'revert-without-query ".pdf")) -(global-set-key "\C-ca" 'org-agenda) -(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-agenda-start-day nil - org-agenda-span 'day - org-agenda-dim-blocked-tasks t - org-agenda-sorting-strategy - '(time-up priority-up category-keep) - org-deadline-warning-days 4 - org-log-into-drawer t - org-treat-insert-todo-heading-as-state-change t - org-clock-into-drawer t - org-agenda-log-mode-items '(closed clock state) - org-agenda-prefix-format '((agenda . " %l %i %c %s %t") - (todo . " %i %-12:c") - (tags . " %i $-12:c") - (search . " %i %-12:c")) - org-agenda-compact-blocks nil - org-agenda-use-tag-inheritance (quote (agenda));; agenda performance - org-agenda-block-separator "---------") - -(add-hook 'org-agenda-mode-hook '(lambda () (hl-line-mode 1))) - -(setq org-agenda-skip-deadline-if-done t) - -(setq org-agenda-skip-scheduled-if-done t) - -(setq org-agenda-text-search-extra-files (quote (agenda-archives))) - -(setq org-agenda-log-mode-items (quote (state))) - -(setq org-agenda-search-headline-for-time nil) - -(setq org-agenda-include-diary t) - -(setq org-agenda-repeating-timestamp-show-all t) - -(setq org-agenda-show-all-dates t) - -(setq org-agenda-sorting-strategy - (quote ((agenda time-up user-defined-up priority-down category-keep) - (todo priority-down category-keep) - (tags priority-down category-keep) - (search category-keep)))) - -(setq org-agenda-start-on-weekday nil) - -(setq org-agenda-skip-timestamp-if-deadline-is-shown t) - -(define-key org-agenda-mode-map (kbd "C-p") 'my-scroll-down-half) -(define-key org-agenda-mode-map (kbd "C-n") 'my-scroll-up-half) - -(setq org-agenda-format-date (lambda (date) (concat "\n" - (make-string (window-width) 9472) - "\n" - (org-agenda-format-date-aligned date)))) - -(setq org-export-with-broken-links t) - -(defun my-org-copy-region-as-markdown () - "Copy the region (in Org) to the system clipboard as Markdown." - (interactive) - (if (use-region-p) - (let* ((region - (buffer-substring-no-properties - (region-beginning) - (region-end))) - (markdown - (org-export-string-as region 'md t '(:with-toc nil)))) - (gui-set-selection 'CLIPBOARD markdown)))) - -(add-to-list 'org-modules 'habit) -(setq org-habit-following-days 2 - org-habit-preceding-days 7 - org-habit-show-all-today nil - org-habit-show-habits-only-for-today t - org-habit-show-habits t) - -(define-key org-mode-map (kbd "C-c h") 'org-habit-stats-view-habit-at-point) -(define-key org-agenda-mode-map (kbd "H") 'org-habit-stats-view-habit-at-point-agenda) -(add-hook 'org-after-todo-state-change-hook 'org-habit-stats-update-properties) +(add-hook 'pdf-view-mode-hook #'(lambda () (interactive (display-line-numbers-mode)))) (setq doom-snippets-enable-short-helpers t) -(setq dired-open-extensions '(("gif" . "sxiv") - ("jpg" . "sxiv") - ("png" . "sxiv") - ("mkv" . "mpv") - ("mp4" . "mpv"))) - -(mode-icons-mode) -(add-hook 'dired-mode-hook #'mode-icons--mode-disable) ;; with mode-icons, visiting a dir with dired takes up *lots* of CPU for =mode-icons-reset= (performance-issue) - (add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode)) (autoload 'csv-mode "csv-mode" "Major mode for editing comma-separated value files." t) -;; To open files with .journal extension in hledger-mode -(add-to-list 'auto-mode-alist '("\\.journal\\'" . hledger-mode)) +;; (load (expand-file-name "~/.roswell/helper.el")) -;; Provide the path to you journal file. -;; The default location is too opinionated. -(setq hledger-jfile "~/enc/org/hledger/2023.journal") - -;;; Auto-completion for account names -;; For company-mode users, -(add-to-list 'company-backends 'hledger-company) +(setq inferior-lisp-program "sbcl --dynamic-space-size 8192 -Q -l ~/.sbclrc") (use-package! gptel :config @@ -730,15 +528,4 @@ and the contents of the files below the headlines." (setq gptel--debug t) -;; Set our nickname & real-name as constant variables -(setq - erc-nick "phil_bb" ; Our IRC nick - erc-user-full-name "Phil B.") ; Our /whois name - -;; Define a function to connect to a server -(defun erc/libera () - (interactive) - (erc :server "irc.libera.chat" - :port "6667")) - (setq-default elfeed-search-filter "@1-week-ago +unread ") diff --git a/.config/doom/init.el b/.config/doom/init.el index 2afe183..83555d9 100644 --- a/.config/doom/init.el +++ b/.config/doom/init.el @@ -81,13 +81,12 @@ :checkers syntax ; tasing you for every semicolon you forget - ;;(spell +flyspell) ; tasing you for misspelling mispelling - grammar ; tasing grammar mistake every you make + (spell +flyspell) ; tasing you for misspelling mispelling + ;;grammar ; tasing grammar mistake every you make :tools ansible ;;biblio ; Writes a PhD for you (citation needed) - ;;collab ; buffers with friends debugger ; FIXME stepping through code" to help you add bugs ;;direnv docker @@ -104,9 +103,8 @@ ;;prodigy ; FIXME managing external services & code builders rgb ; creating color strings ;;taskrunner ; taskrunner for all your projects - ;;terraform ; infrastructure as code + terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux - ;;tree-sitter ; syntax and parsing" sitting in a tree... ;;upload ; map local to remote projects via ssh/ftp :os @@ -117,13 +115,13 @@ ;;agda ; types of types of types of types... ;;beancount ; mind the GAAP (cc +lsp) ; C > C++ == 1 - (clojure +lsp) ; java with a lisp + ;;(clojure +lsp) ; java with a lisp common-lisp ; if you've seen one lisp" you've seen them all ;;coq ; proofs-as-programs ;;crystal ; ruby at the speed of c ;;csharp ; unity" .NET" and mono shenanigans data ; config/data formats - (dart +flutter) ; paint ui and not much else + ;;(dart +flutter) ; paint ui and not much else ;;dhall ;;elixir ; erlang done right ;;elm ; care for a cup of TEA? @@ -135,33 +133,33 @@ ;;fortran ; in FORTRAN" GOD is REAL (unless declared INTEGER) ;;fsharp ; ML stands for Microsoft's Language ;;fstar ; (dependent) types and (monadic) effects and Z3 - gdscript ; the language you waited for - ;;(go +lsp) ; the hipster dialect + ;;gdscript ; the language you waited for + (go +lsp) ; the hipster dialect ;;(graphql +lsp) ; Give queries a REST (haskell +lsp) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on json ; At least it ain't XML - (java +lsp) ; the poster child for carpal tunnel syndrome + ;;(java +lsp) ; the poster child for carpal tunnel syndrome (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) - (julia +lsp) ; a better" faster MATLAB + ;;(julia +lsp) ; a better" faster MATLAB ;;kotlin ; a better" slicker Java(Script) latex ; writing papers in Emacs has never been so fun ;;lean ; for folks with too much to prove ;;ledger ; be audit you can be - lua ; one-based indices? one-based indices + ;;lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c - nix ; I hereby declare "nix geht mehr!" + ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel (org +dragndrop +pandoc +pretty +gnuplot +roam2) ; organize your plain life in plain text - php ; perl's insecure younger brother + ;;php ; perl's insecure younger brother plantuml ; diagrams for confusing people more ;;purescript ; javascript" but functional (python +lsp) ; beautiful is better than ugly ;;qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs - raku ; the artist formerly known as perl6 + ;;raku ; the artist formerly known as perl6 ;;rest ; Emacs as a REST client ;;rst ; ReST in peace ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} @@ -175,7 +173,7 @@ ;;terra ; Earth and Moon in alignment for performance. (web +lsp) ; the tubes yaml ; JSON" but readable - (zig +lsp) ; C" but simpler + ;;(zig +lsp) ; C" but simpler :email (mu4e +org +gmail) @@ -186,7 +184,7 @@ calendar ;;emms everywhere ; *leave* Emacs!? You must be joking - ;;irc ; how neckbeards socialize + irc ; how neckbeards socialize (rss +org) ; emacs as an RSS reader ;;twitter ; twitter client https://twitter.com/vnought diff --git a/.config/doom/packages.el b/.config/doom/packages.el index 8aa96e1..51b11f0 100644 --- a/.config/doom/packages.el +++ b/.config/doom/packages.el @@ -8,7 +8,6 @@ (package! all-the-icons) (package! all-the-icons-dired) - (package! doom-themes) (package! battle-haxe) @@ -21,8 +20,6 @@ (package! dired-open) -;; (package! helm-xref) - (package! pdf-tools) ;; Fix for org-roam link issue @@ -51,31 +48,14 @@ (package! org-wild-notifier) (package! org-habit-stats) - - -(package! org-edna) -(package! org-super-links - :recipe ( - :type git - :host github - :repo "toshism/org-super-links" - :branch "develop" - )) - -(package! elgantt - :recipe (:host github :repo "legalnonsense/elgantt")) - -(package! mode-icons) - -(package! qrencode) - -(package! hledger-mode) - -(package! elpher) - -(package! multiple-cursors) +(package! org-contrib + :recipe (:host sourcehut :type git + :repo "~bzg/org-contrib" + :files ("lisp/*.el"))) (package! gptel :recipe (:host github :repo "karthink/gptel" :files ("*.el"))) + +(package! elpher) diff --git a/.config/xmonad/README.org b/.config/xmonad/README.org index 7de122e..5212c5e 100644 --- a/.config/xmonad/README.org +++ b/.config/xmonad/README.org @@ -563,7 +563,7 @@ Notes: I use a ZSA Moonlander so a lot of the 4-5 key sequences are actually jus #+end_src *** Some common keybinds: #+begin_src haskell - , ("M-e", spawn "emacsclient --altername-editor='emacs'") + , ("M-e", spawn "emacsclient -c") , ("M-", spawn "alacritty") , ("M-S-", spawn "feh --recursive --randomize --bg-fill /mnt/ext1/media/Images/Wallpapers/*") , ("M-", spawn "dm-maim") diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.hs index 7cc7618..346c899 100644 --- a/.config/xmonad/xmonad.hs +++ b/.config/xmonad/xmonad.hs @@ -333,7 +333,7 @@ main = do , ("M-S-C-M1-q", killAll) , ("M-d", spawn "rofi -show drun") - , ("M-e", spawn "emacsclient --altername-editor='emacs'") + , ("M-e", spawn "emacsclient -c") , ("M-", spawn "alacritty") , ("M-S-", spawn "feh --recursive --randomize --bg-fill /mnt/ext1/media/Images/Wallpapers/*") , ("M-", spawn "dm-maim")