dot/.config/doom/README.org

1945 lines
124 KiB
Org Mode
Raw Normal View History

2023-08-12 17:25:26 +02:00
#+title: Phil's Doom Emacs Config
#+TODO: ACTIVE | DISABLED
#+STARTUP: indent
#+auto_tangle: t
2023-08-12 17:25:26 +02:00
* Intro
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.
Some of the comments are from the default config.el file that ships with Doom Emacs.
You can extract all the source/ config files from here by running Emacs and hitting ~C-c C-v t~.
A lot of these are swiped from [[https://gitlab.com/dwt1/configuring-emacs/][DT's Configuring Emacs config files]], as well as [[https://github.com/novoid/dot-emacs][Karl Voit's Emacs config.]]
2023-08-12 17:25:26 +02:00
* config.el
** Basic settings
*** Author/ personal info
2023-08-12 17:25:26 +02:00
#+begin_src emacs-lisp :tangle config.el
(setq user-full-name "Phil Bajsicki")
#+end_src
*** Global settings
#+begin_src emacs-lisp :tangle config.el
2023-08-12 17:25:26 +02:00
(setq global-auto-revert-mode t)
(org-edna-mode)
2023-08-12 17:25:26 +02:00
(setq auth-sources '("~/.authinfo"))
(setq-default backup-inhibited t)
(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)
#+END_SRC
*** Theming and prettifying
#+begin_src emacs-lisp :tangle config.el
2023-08-12 17:25:26 +02:00
(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
**** Fonts
#+begin_src emacs-lisp :tangle config.el
(setq doom-themes-enable-bold t
doom-themes-enable-italic t)
(setq doom-font (font-spec :family "IosevkaTerm" :size 12)
doom-unicode-font (font-spec :family "IosevkaTerm" :size 12))
(dolist (charset '(unicode))
(set-fontset-font (frame-parameter nil 'font)
charset (font-spec :family "IosevkaTerm" :size 12)))
#+end_src
#+RESULTS:
: t
**** Font Family List
#+begin_src emacs-lisp :results value format: pp
(print (font-family-list))
#+end_src
#+RESULTS:
: ("Iosevka Nerd Font" "M+CodeLat Nerd Font Propo" "OverpassM Nerd Font Mono" "ProggyClean Nerd Font Propo" "M+CodeLat Nerd Font" "NotoSansM Nerd Font" "Iosevka Nerd Font Mono" "IosevkaTerm Nerd Font Propo" "VictorMono Nerd Font Propo" "Fira Sans" "FiraCode Nerd Font" "M+1Code Nerd Font Mono" "NotoSerif Nerd Font Propo" "UbuntuMono Nerd Font" "M+1 Nerd Font" "VictorMono Nerd Font Mono" "M+2 Nerd Font" "LiterationMono Nerd Font Mono" "NotoSans Nerd Font" "Cousine Nerd Font Mono" "JetBrainsMono Nerd Font Propo" "Hasklug Nerd Font" "Standard Symbols PS" "OpenDyslexic Nerd Font" "Noto Sans CJK TC" "DejaVuSansM Nerd Font Propo" "LiterationMono Nerd Font Propo" "IosevkaTerm Nerd Font Propo" "Noto Serif CJK KR" "IosevkaTerm Nerd Font Propo" "NotoSans Nerd Font" "NotoSansM Nerd Font Propo" "Iosevka Nerd Font Mono" "NotoSerif Nerd Font Propo" "M+1 Nerd Font" "NotoSerif Nerd Font" "Noto Serif CJK TC" "VictorMono Nerd Font Propo" "Noto Sans CJK TC" "M+CodeLat Nerd Font Mono" "VictorMono Nerd Font" "FiraCode Nerd Font Mono" "NotoSans Nerd Font Propo" "Iosevka Term" "Iosevka" "FiraCode Nerd Font Propo" "NotoSans Nerd Font" "NotoSans Nerd Font" "URW Gothic" "NotoSerif Nerd Font" "SauceCodePro Nerd Font Propo" "BlexMono Nerd Font" "Hasklug Nerd Font Mono" "NotoSans Nerd Font Propo" "NotoSans Nerd Font Propo" "InconsolataGo Nerd Font" "Overpass Nerd Font Propo" "BigBlueTermPlus Nerd Font Mono" "NotoSansM Nerd Font" "NotoSansM Nerd Font Propo" "BlexMono Nerd Font Propo" "AurulentSansM Nerd Font Propo" "NotoSans Nerd Font" "M+CodeLat Nerd Font Propo" "MesloLGSDZ Nerd Font Mono" "AurulentSansM Nerd Font Mono" "ProFontWindows Nerd Font Mono" "Cousine Nerd Font Propo" "JetBrainsMonoNL Nerd Font" "IosevkaTerm Nerd Font Propo" "Iosevka Fixed" "OpenDyslexicAlt Nerd Font Propo" "FiraCode Nerd Font" "UbuntuMono Nerd Font Propo" "Monoid Nerd Font Propo" "NotoSerif Nerd Font Propo" "Hasklug Nerd Font" "NotoSans Nerd Font" "SauceCodePro Nerd Font Mono" "Hasklug Nerd Font Mono" "Fira Sans Compressed" "NotoSansM Nerd Font Mono" "NotoSansM Nerd Font Propo" "Lilex Nerd Font Propo" "M+1Code Nerd Font" "Monoid Nerd Font" "BlexMono Nerd Font Propo" "NotoSansM Nerd Font Propo" "NotoSans Nerd Font" "NotoSerif Nerd Font" "JetBrainsMono Nerd Font" "NotoSansM Nerd Font Propo" "CaskaydiaCove Nerd Font" "VictorMono Nerd Font Propo" "NotoSansM Nerd Font Mono" "Iosevka Nerd Font" "NotoSansM Nerd Font Propo" "Iosevka" "Noto Sans CJK KR" "Noto Serif CJK JP" "Noto Sans CJK TC" "NotoSans Nerd Font" "M+1Code Nerd Font Propo" "IosevkaTerm Nerd Font" "IosevkaTerm Nerd Font Mono" "Noto Serif CJK KR" "NotoSansM Nerd Font Propo" "NotoSans Nerd Font Propo" "NotoSans Nerd Font Propo" "M+2 Nerd Font" "NotoSerif Nerd Font" "DroidSansM Nerd Font" "NotoSans Nerd Font Propo" "BlexMono Nerd Font Mono" "NotoSansM Nerd Font Mono" "Nimbus Roman" "RobotoMono Nerd Font Propo" "Noto Sans CJK SC" "Iosevka Fixed" "NotoSerif Nerd Font Propo" "Iosevka Fixed" "M+1Code Nerd Font Mono" "Noto Serif CJK HK" "NotoSerif Nerd Font Propo" "Fira Sans" "NotoSerif Nerd Font Propo" "IosevkaTerm Nerd Font Propo" "BlexMono Nerd Font" "M+1 Nerd Font" "M+CodeLat Nerd Font" "NotoSansM Nerd Font Propo" "ShureTechMono Nerd Font" "RobotoMono Nerd Font Mono" "Iosevka" "Iosevka Nerd Font" "Agave Nerd Font Mono" "BlexMono Nerd Font Mono" "NotoSans Nerd Font Propo" "BlexMono Nerd Font Mono" "Iosevka Nerd Font Mono" "Iosevka Fixed" "CaskaydiaCove Nerd Font" "IosevkaTerm Nerd Font" "BigBlueTerm437 Nerd Font" "NotoSansM Nerd Font Propo" "FiraCode Nerd Font" "Fira Sans Compressed" "Overpass Nerd Font" "Fira Code" "NotoSans Nerd Font Propo" "SauceCodePro Nerd Font Mono" "FiraCode Nerd Font Propo" "BigBlueTermPlus Nerd Font" "NotoSansM Nerd Font Mono" "Hasklug Nerd Font" "Iosevka" "M+1 Nerd Font" "Source Code Pro" "Arimo Nerd Font Propo" "NotoSansM Nerd Font Mono" "AnonymicePro Nerd Font" "Noto Serif CJK SC" "JetBrainsMono Nerd Font Propo" "Iosevka Nerd Font Propo" "Noto Sans CJK HK" "Iosevka Nerd Font Mono" "IosevkaTerm Nerd Font Mono" "VictorMono Nerd Font Mono" "Fira Sans Compressed" "VictorMono Nerd Font" "Noto Sans C
**** Transparency
#+begin_src emacs-lisp :tangle config.el
(set-frame-parameter nil 'alpha-background 70)
(add-to-list 'default-frame-alist '(alpha-background . 80))
#+end_src
**** Helpers for text editing
#+begin_src emacs-lisp :tangle config.el
2023-08-12 17:25:26 +02:00
(setq display-line-numbers-type 'relative)
(setq next-screen-context-lines 4)
(setq-default global-visual-line-mode t)
(setq x-stretch-cursor t)
(setq column-number-mode 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
(setq-default calendar-week-start-day 1)
#+END_SRC
** Package settings
*** Straight
#+begin_src emacs-lisp :tangle config.el
(setq straight-repository-branch "develop")
#+end_src
** emojify-mode
#+begin_src emacs-lisp :tangle no
(global-emojify-mode)
(global-emojify-mode-line-mode)
#+end_src
2023-08-12 17:25:26 +02:00
** Global Keybinds
Setting this here because I experiment with these occasionally and want them reset properly eaach time.
2023-08-13 17:12:50 +02:00
#+begin_src emacs-lisp :tangle config.el
(global-set-key "\C-g" 'keyboard-quit)
(global-set-key "\C-cu" 'browse-url-chrome)
2023-08-12 17:25:26 +02:00
#+end_src
#+RESULTS:
: browse-url-chrome
** org-mode
2023-08-12 17:25:26 +02:00
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
2023-08-12 17:25:26 +02:00
#+begin_src emacs-lisp :tangle config.el
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(setq org-directory "~/enc/org/")
(setq org-enforce-todo-dependencies t)
(setq org-insert-heading-respect-content nil)
(setq org-reverse-note-order nil)
(setq org-show-following-heading t)
(setq org-show-hierarchy-above t)
(setq org-show-siblings nil)
(setq org-deadline-warning-days 7)
(setq org-blank-before-new-entry (quote ((heading . t)
(plain-list-item . nil))))
(setq org-todo-repeat-to-state "LOOP")
(setq org-remove-highlights-with-change nil)
(setq org-read-date-prefer-future nil)
(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 t)
(setq org-log-done (quote time))
(setq org-log-into-drawer t)
(setq org-catch-invisible-edits "smart")
(setq org-completion-use-ido t)
(setq org-use-property-inheritance nil)
(setq org-hierarchical-todo-statistics t)
(org-align-tags t)
#+end_src
***** Automatically write =CREATED= properties in the =PROPERTIES= drawer:
#+BEGIN_SRC emacs-lisp
(org-expiry-insinuate)
;; not checked yet: (setq org-expiry-handler-function 'org-expiry-archive-subtree)
#+END_SRC
**** DISABLED Split lines?
Ensure that hitting ~M-<return>~ splits the line it's on. This is useful when I'm typing something long, and then decide to turn a paragraph into a list
#+begin_src emacs-lisp :tangle no
#+end_src
**** 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
(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
(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
(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
(setq org-element--cache-self-verify nil)
#+END_SRC
**** Theming
:PROPERTIES:
:ID: b663a9ef-f08e-436f-913d-98e4234cf2cd
:END:
#+begin_src emacs-lisp config.el
(setq org-fontify-todo-headline t)
(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)
;;disabled;(setq org-agenda-dim-blocked-tasks t)
;;disabled 2020-07-07;; (setq org-agenda-dim-blocked-tasks 'invisible)
(setq org-agenda-dim-blocked-tasks nil);; show blocked tasks
#+END_SRC
***** Set the width of inline images:
#+BEGIN_SRC emacs-lisp
(setq org-image-actual-width '(600))
#+END_SRC
***** org-modern
#+begin_src emacs-lisp :tangle config.el
(modify-all-frames-parameters
'((right-divider-width . 2)
(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-insert-heading-respect-content t
;; Org styling, hide markup etc.
org-hide-emphasis-markers t
org-pretty-entities t
org-ellipsis "…"
;; 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 ─────────────────────────────────────────────────")
(global-org-modern-mode)
2023-08-12 17:25:26 +02:00
#+end_src
**** Dependencies
#+begin_src emacs-lisp :tangle config.el
(setq-default org-enforce-todo-dependencies t)
(setq org-enforce-todo-checkbox-dependencies t)
#+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
2023-08-12 17:25:26 +02:00
*** 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)
2023-08-12 17:25:26 +02:00
#+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
2023-08-12 17:25:26 +02:00
*** Todo keywords
#+begin_src emacs-lisp :tangle config.el
(after! org
(setq org-todo-keywords
2023-08-12 17:25:26 +02:00
'((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))))
2023-08-12 17:25:26 +02:00
#+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)))))
#+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-<return> C-i i~ into just ~C-<return>~. Much easier, and I don't have to think about this any more.
#+begin_src emacs-lisp :tangle config.el
(add-hook 'org-insert-heading-hook
(lambda ()
(if
(or
(string-match "journal.org" buffer-file-name)
(string-match "money" buffer-file-name)
(string-match "therapy.org" buffer-file-name))
((lambda ()
(interactive)
(org-time-stamp-inactive '(16))
(newline)))
(setq org-insert-heading-hook nil)
)))
#+end_src
#+RESULTS:
| lambda | nil | (if (or (string-match journal buffer-file-name) (string-match money buffer-file-name) (string-match therapy buffer-file-name)) ((lambda nil (interactive) (org-timestamp-inactive '(16)) (newline))) (setq 'org-insert-heading-hook nil)) |
| lambda | nil | (if (or (string-match journal buffer-file-name) (string-match money buffer-file-name) (string-match therapy buffer-file-name)) (progn (org-timestamp-inactive '(16)) (newline)) (progn (signal 'wrong-type-argument (list 'symbolp ''org-insert-heading-hook)))) |
2023-08-12 17:25:26 +02:00
*** Capture templates
#+begin_src emacs-lisp :tangle config.el
(setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/phil.org" "Inbox") "* TODO %i%?")
("i" "idea" entry (file+headline "~/enc/org/phil.org" "Ideas") "* %?")
("d" "reminder" entry (file+headline "~/enc/org/phil.org" "Reminders") "* %i%? \n %U")
("p" "person" entry (file+headline "~/enc/org/people.org" "People")
"* %(org-contacts-template-name)
2023-08-12 17:25:26 +02:00
:PROPERTIES:
:EMAIL: %(org-contacts-template-email)
:PHONE: %(org-contacts-template-phone)
:ALIAS:
:NICKNAME:
:IGNORE:
:ICON:
:NOTE:
:ADDRESS:
:BIRTHDAY:
:END:")))
#+end_src
*** preserving all heading levels when archiving
Karl Voit:
#+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)]]
#+end_quote
#+BEGIN_SRC emacs-lisp
(setq org-archive-default-command #'org-archive-subtree-hierarchically)
(defun org-archive-subtree-hierarchically (&optional prefix)
(interactive "P")
(let* ((fix-archive-p (and (not prefix)
(not (use-region-p))))
(afile (car (org-archive--compute-location
(or (org-entry-get nil "ARCHIVE" 'inherit) org-archive-location))))
(buffer (or (find-buffer-visiting afile) (find-file-noselect afile))))
(org-archive-subtree prefix)
(when fix-archive-p
(with-current-buffer buffer
(goto-char (point-max))
(while (org-up-heading-safe))
(let* ((olpath (org-entry-get (point) "ARCHIVE_OLPATH"))
(path (and olpath (split-string olpath "/")))
(level 1)
tree-text)
(when olpath
(org-mark-subtree)
(setq tree-text (buffer-substring (region-beginning) (region-end)))
(let (this-command (inhibit-message t)) (org-cut-subtree)) ; we dont want to see "Cut subtree" messages
(goto-char (point-min))
(save-restriction
(widen)
(-each path
(lambda (heading)
(if (re-search-forward
(rx-to-string
`(: bol (repeat ,level "*") (1+ " ") ,heading)) nil t)
(org-narrow-to-subtree)
(goto-char (point-max))
(unless (looking-at "^")
(insert "\n"))
(insert (make-string level ?*)
" "
heading
"\n"))
(cl-incf level)))
(widen)
(org-end-of-subtree t t)
(org-paste-subtree level tree-text))))))))
#+END_SRC
*** my-dired-insert-lfile-link-list-to-other-org-window()
#+begin_quote
| 2022-06-20 | I had this idea and implemented it |
Development task: id:2022-06-20-implement-add-lfile-links-to-buffer-with-marked-dired-files
[[https://emacs.stackexchange.com/questions/60359/is-there-a-quicker-way-to-create-links-to-attachments][This stackexchange snippet]] had the almost exactly perfect code which I adapted.
The idea of the process is:
1. I have an Org-mode buffer and a dired buffer side-by-side (which is my usual setup).
2. I place the cursor in the Org-mode buffer so that I may add a list.
3. I switch to the dired buffer and mark one or more files.
4. I invoke this function.
This results in a list that gets added to the Org-mode buffer similar to:
: - [[lfile:This is an example.odt][This is an example.odt]]
: - [[lfile:2022-06-20 an image.png][2022-06-20 an image.png]]
#+end_quote
#+begin_src emacs-lisp :results none
(defun my-dired-insert-lfile-link-list-to-other-org-window (files)
;; adapted by Karl Voit from https://emacs.stackexchange.com/a/60369
(interactive
(list (dired-get-marked-files)))
(unless (eq major-mode 'dired-mode)
(user-error "This command must be triggered in a dired buffer"))
(let ((dired-win (selected-window))
(orgmode-win
(get-window-with-predicate
(lambda (window)
(with-current-buffer (window-buffer window)
(eq major-mode 'org-mode))))))
(unless orgmode-win
(user-error
"Can't attach to subtree. No window displaying an Org buffer"))
(select-window orgmode-win)
(dolist (file files)
(let* ((fname (file-name-nondirectory file))
(link (format "lfile:%s" fname))
(desc fname))
;;(push (list link desc) org-stored-links) ;; original idea was to insert to this buffer in order to paste via C-c C-l
(insert (format "%s" (concat "- [[" link "][" desc "]]\n")))
))
(select-window dired-win)))
#+end_src
*** link colors
#+begin_quote
| 2021-01-11 | moved commands to =my-set-linkcolors= and defined 3 categories of colors |
- 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
#+BEGIN_SRC emacs-lisp
(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
#+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]]
- http: http://Karl-Voit.at [[http://Karl-Voit.at][description]]
- https: https://Karl-Voit.at [[https://Karl-Voit.at][description]]
- id: id:foo-bar [[id:foo-bar][description]]
- contact: [[contact:example]] [[contact:example][description]]
- message-id: [[messageid:foobar@example.com][Email link]]
- 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-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
(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-super-links
***** Quick related link function
#+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
#+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 config.el
(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
;; After the last group, the agenda will display items that didn't
;; match any of these groups, with the default order position of 99
))
(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
2023-08-12 17:25:26 +02:00
This lets me get desktop notifications for TODO items.
#+begin_src emacs-lisp :tangle config.el
(org-wild-notifier-mode)
(setq org-wild-notifier-alert-time '(10))
(setq org-wild-notifier-notification-title "Emacs org-mode agenda")
(setq org-wild-notifier-keyword-whitelist '("TODO"))
#+end_src
** org-id
*** my-id-get-or-generate
Straight from Karl Voit's config.
#+BEGIN_SRC emacs-lisp
(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
2023-08-12 17:25:26 +02:00
#+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
(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
2023-08-12 17:25:26 +02:00
*** 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-roam
2023-08-12 17:25:26 +02:00
#+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
2023-08-12 17:25:26 +02:00
"%?"
: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
** org-elgantt
2023-08-12 17:25:26 +02:00
#+begin_src emacs-lisp :tangle config.el
(add-to-list 'load-path "~/.emacs.d/.local/straight/repos/elgantt/")
(setq elgantt-header-type 'outline
elgantt-draw-overarching-headers t
elgantt-insert-header-even-if-no-timestamp nil
elgantt-scroll-to-current-month-at-startup t)
(setq elgantt-user-set-color-priority-counter 0)
(setq elgantt-custom-header-line
'((:left ((:prop date-at-point
:padding 25)
(:prop todo
:padding 30)))
(:center ((:prop headline)))
(:right ((:prop hashtag
:padding 40
:text-props (face (:background "red")))))))
#+end_src
** org-agenda
2023-08-12 17:25:26 +02:00
*** 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
2023-08-12 17:25:26 +02:00
*** Settings
#+begin_src emacs-lisp :tangle config.el
(setq org-agenda-files (directory-files-recursively "~/enc/org" "org$"))
2023-08-12 17:25:26 +02:00
(setq org-agenda-start-day nil
org-agenda-span '14
org-agenda-dim-blocked-tasks 'invisible
org-agenda-sorting-strategy
'((agenda habit-down time-up priority-down category-keep)
(todo priority-down category-keep)
(search category-keep))
org-deadline-warning-days 3
org-agenda-insert-diary-extract-time t
org-log-into-drawer t
org-clock-into-drawer t
org-agenda-log-mode-items '(closed clock state)
org-agenda-prefix-format "%l %i %c %s %t")
(setq org-agenda-compact-blocks t)
(setq org-agenda-use-tag-inheritance (quote (agenda)));; agenda performance
(setq org-agenda-span 1)
(add-hook 'org-agenda-mode-hook '(lambda () (hl-line-mode 1)))
(setq org-agenda-custom-commands
(quote (("x" "Phil's view" agenda ""
((org-agenda-prefix-format " %i %-12:c %s %t "))))))
2023-08-12 17:25:26 +02:00
#+end_src
**** From Karl Voit
Keep tasks with dates off the global todo lists:
#+BEGIN_SRC emacs-lisp :tangle config.el
(setq org-agenda-todo-ignore-with-date nil)
#+END_SRC
Allow deadlines which are due soon to appear on the global todo lists:
#+BEGIN_SRC emacs-lisp :tangle config.el
(setq org-agenda-todo-ignore-deadlines (quote far))
#+END_SRC
Keep tasks scheduled in the future off the global todo lists
#+BEGIN_SRC emacs-lisp :tangle config.el
(setq org-agenda-todo-ignore-scheduled (quote future))
#+END_SRC
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
http://orgmode.org/worg/org-faq.html
#+BEGIN_SRC emacs-lisp :tangle config.el
;(setq org-agenda-skip-additional-timestamps-same-entry t)
(setq org-agenda-skip-additional-timestamps-same-entry nil)
#+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
open agenda in same buffer, full size
#+BEGIN_SRC emacs-lisp :tangle config.el
(setq org-agenda-window-setup 'current-window)
#+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 habit-down time-up user-defined-up priority-down category-keep)
(todo priority-down category-keep)
(tags priority-down category-keep)
(search category-keep))))
#+END_SRC
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
Agenda sorting functions
#+BEGIN_SRC emacs-lisp :tangle config.el
(setq org-agenda-cmp-user-defined 'bh/agenda-sort)
#+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
Display tags farther right
#+BEGIN_SRC emacs-lisp :tangle config.el
;;(setq org-agenda-tags-column -102)
(setq org-tags-column -101); for powerplantwin 23" TFT turned 90
; degrees; should *not* differ between
; systems! Otherwise Org-files gets
; re-formatted after switching
; system
;;(when (my-system-type-is-windows)
;; ;;(setq org-agenda-tags-column -103);; for 23" TFT turned 90 degrees
;; (setq org-agenda-tags-column -117);; for 24" TFT turned 90 degrees
;; )
;;(when (my-system-is-sting)
;; (setq org-agenda-tags-column -117);; -117 for 23" TFT sting, rotated 90°
;; )
(setq org-agenda-tags-column (- (- (window-total-width) 3))) ;; total width minus 3
#+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/cc5vz5/how_to_avoid_duplicates_in_orgsuperagenda/][reddit]] I got the settings that deadlines are not shown when
SCHEDULED is set:
#+BEGIN_SRC emacs-lisp :tangle config.el
(setq org-agenda-skip-scheduled-if-deadline-is-shown nil)
;;(setq org-agenda-skip-deadline-prewarning-if-scheduled t)
#+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 no
(setq org-agenda-format-date (lambda (date) (concat "\n"
(make-string (window-width) 9472)
"\n"
(org-agenda-format-date-aligned date))))
#+END_SRC
**** habits
«Org has the ability to track the consistency of a special category of
TODOs, called “habits”.»
- http://orgmode.org/manual/Tracking-your-habits.html
- http://orgmode.org/worg/org-tutorials/tracking-habits.html
- global STYLE property values for completion
#+BEGIN_SRC emacs-lisp :tangle config.el
(setq org-global-properties (quote (("STYLE_ALL" . "habit"))))
#+END_SRC
- position the habit graph on the agenda to the right of the default
#+BEGIN_SRC emacs-lisp :tangle config.el
(setq org-habit-graph-column 100)
#+END_SRC
**** my-org-obfuscate-agenda-item
:PROPERTIES:
:CREATED: [2018-09-01 Sat 14:38]
:END:
This was originally developed by [[https://github.com/alphapapa][alphapapa]] as =org-agenda-sharpie()=
and published on [[https://github.com/alphapapa/org-super-agenda/issues/43#issuecomment-403268926][GitHub]].
When invoked on an agenda item, you can enter some text and the agenda
item gets temporarily overwritten. You can use this to obfuscate or
"overwrite" agenda entries before making a screenshot for public use.
#+BEGIN_SRC emacs-lisp :tangle config.el
(defun org-agenda-sharpie ()
"Censor the text of items in the agenda."
(interactive)
(let (regexp old-heading new-heading properties)
;; Save face properties of line in agenda to reapply to changed text
(setq properties (text-properties-at (point)))
;; Go to source buffer
(org-with-point-at (org-find-text-property-in-string 'org-marker
(buffer-substring (line-beginning-position)
(line-end-position)))
;; Save old heading text and ask for new text
(line-beginning-position)
(unless (org-at-heading-p)
;; Not sure if necessary
(org-back-to-heading))
(setq old-heading (when (looking-at org-complex-heading-regexp)
(match-string 4))))
(unless old-heading
(error "Can't find heading. How can this be?"))
;; Back to agenda buffer
(setq new-heading (read-from-minibuffer "Overwrite visible heading with: "))
(add-text-properties 0 (length new-heading) properties new-heading)
;; Replace agenda text
(save-excursion
(let ((inhibit-read-only t))
(goto-char (line-beginning-position))
(when (search-forward old-heading (line-end-position))
(replace-match new-heading 'fixedcase 'literal))))))
#+END_SRC
*** Exports
Export subtree (by default) instead of whole buffer:
http://orgmode.org/manual/The-Export-Dispatcher.html
#+BEGIN_SRC emacs-lisp :tangle config.el
(setq org-export-initial-scope 'subtree)
#+END_SRC
#+RESULTS:
: subtree
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
**** LaTeX classes
http://orgmode.org/org.html#Header-and-sectioning
BEGIN of LaTeX class definitions
#+BEGIN_SRC emacs-lisp :tangle config.el
(with-eval-after-load 'ox-latex
;;(message (concat "################################################\norg-latex-classes = [" org-latex-classes "]"))
#+END_SRC
Customized «scrartcl»
#+BEGIN_SRC emacs-lisp :tangle config.el
(add-to-list 'org-latex-classes
'("scrartcl"
"\\documentclass\[a4paper,parskip=half\]\{scrartcl\}"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
#+END_SRC
«scrartclsmall»
- 2014-10-16: does NOT work yet. Most probably because savetrees does not work well with inputenc
#+BEGIN_SRC emacs-lisp
(add-to-list 'org-latex-classes
'("scrartclsmall"
"\\documentclass\[a4paper,parskip=half\]\{scrartcl\}\\usepackage\{savetrees\}"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
#+END_SRC
«detego»
- 2017-09-13:
#+BEGIN_SRC emacs-lisp :tangle config.el
(add-to-list 'org-latex-classes
'("detego"
"\\documentclass\[a4paper,parskip=half,11pt,headinclude=false,footinclude=false\]\{scrartcl\}
\\usepackage\[ngerman,american\]\{babel\}\\usepackage\{eurosym\}\\usepackage\{xspace\}\\usepackage\[usenames,dvipsnames\]\{xcolor\}
\\usepackage\[protrusion=true,factor=900\]\{microtype\}\\usepackage\{enumitem\}
\\definecolor\{DispositionColor\}\{RGB\}\{0,54,90\}
\\usepackage\{helvet\}
\\renewcommand\{\\familydefault\}\{\\sfdefault\}
\\DeclareRobustCommand\{\\myacro\}\[1\]\{\\textsc\{\\lowercase\{#1\}\}\} %% abbrevations using small caps
\\usepackage{scrlayer-scrpage} \\rehead{\\includegraphics\[height=1cm\]{{c:/Users/karl.voit/.emacs.d/bin/images/Detego-Logo-209x41.png}}} \\pagestyle{scrheadings} %% Logo in header
\\newenvironment{NOTES}{}{} %% declares org-reveal environment in PDF output
\\usepackage[space]{grffile} %% enable spaces in filenames of includegraphics
%% colorful headings:
%\\setheadsepline\{.4pt\}\[\\color\{DispositionColor\}\]
\\renewcommand\{\\headfont\}\{\\normalfont\\sffamily\\color\{DispositionColor\}\}
\\renewcommand\{\\pnumfont\}\{\\normalfont\\sffamily\\color\{DispositionColor\}\}
\\addtokomafont\{disposition\}\{\\color\{DispositionColor\}\}
\\addtokomafont\{caption\}\{\\color\{DispositionColor\}\\footnotesize\}
\\addtokomafont\{captionlabel\}\{\\color\{DispositionColor\}\}
\\usepackage\{enumitem\}
\\setlist\{noitemsep\} %% kills the space between items
"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
#+END_SRC
«rise»
- 2019-12-16
#+BEGIN_SRC emacs-lisp :tangle config.el
(add-to-list 'org-latex-classes
'("rise"
"\\documentclass\[a4paper,parskip=half,11pt,headinclude=false,footinclude=false\]\{scrartcl\}
\\usepackage\[ngerman,american\]\{babel\}\\usepackage\{eurosym\}\\usepackage\{xspace\}\\usepackage\[usenames,dvipsnames\]\{xcolor\}
\\usepackage\[protrusion=true,factor=900\]\{microtype\}\\usepackage\{enumitem\}
\\definecolor\{DispositionColor\}\{RGB\}\{0,54,90\}
\\usepackage\{helvet\}
\\renewcommand\{\\familydefault\}\{\\sfdefault\}
\\DeclareRobustCommand\{\\myacro\}\[1\]\{\\textsc\{\\lowercase\{#1\}\}\} %% abbrevations using small caps
\\usepackage{scrlayer-scrpage} \\rehead{\\includegraphics\[height=1cm\]{{c:/Users/karl.voit/.emacs.d/bin/images/RISE_logo_202x500.jpeg}}} \\pagestyle{scrheadings} %% Logo in header
\\newenvironment{NOTES}{}{} %% declares org-reveal environment in PDF output
\\usepackage[space]{grffile} %% enable spaces in filenames of includegraphics
%% colorful headings:
%\\setheadsepline\{.4pt\}\[\\color\{DispositionColor\}\]
\\renewcommand\{\\headfont\}\{\\normalfont\\sffamily\\color\{DispositionColor\}\}
\\renewcommand\{\\pnumfont\}\{\\normalfont\\sffamily\\color\{DispositionColor\}\}
\\addtokomafont\{disposition\}\{\\color\{DispositionColor\}\}
\\addtokomafont\{caption\}\{\\color\{DispositionColor\}\\footnotesize\}
\\addtokomafont\{captionlabel\}\{\\color\{DispositionColor\}\}
\\usepackage\{enumitem\}
\\setlist\{noitemsep\} %% kills the space between items
"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
#+END_SRC
«lyrics»
- 2017-03-23: 2-column layout sans-serif for lyrics
#+BEGIN_SRC emacs-lisp :tangle config.el
(add-to-list 'org-latex-classes
'("lyrics"
"\\documentclass\[a4paper,parskip=half\]\{scrartcl\}
\\renewcommand*\\sfdefault\{lcmss\} \\renewcommand*\\familydefault\{\\sfdefault\}"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
#+END_SRC
«lyrics2» 2 column version of «lyrics»
#+BEGIN_SRC emacs-lisp :tangle config.el
(add-to-list 'org-latex-classes
'("lyrics2"
"\\documentclass\[a4paper,parskip=half,twocolumn\]\{scrartcl\}
\\renewcommand*\\sfdefault\{lcmss\} \\renewcommand*\\familydefault\{\\sfdefault\}"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
#+END_SRC
Adding TUGRAZ letter export class format
- compare: http://orgmode.org/worg/org-tutorials/org-latex-export.html
#+BEGIN_SRC emacs-lisp :tangle no
(add-to-list 'org-export-latex-classes
'("TUGRAZletter"
"\\documentclass{scrlttr2}
\\usepackage{tugrazletter}
[NO-DEFAULT-PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")))
#+END_SRC
#+begin_src emacs-lisp :tangle config.el
(add-to-list 'org-latex-classes
'("memoirbook"
"\\documentclass[a5paper,12pt]{memoir}"
;; "\\semiisopage[8]"
;; "\\hypersetup{colorlinks=true,linkcolor={Blue},urlcolor={Blue}}" ;; genera un problema al exportar
("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
'(org-export-latex-default-class "memoir")
#+end_src
END of LaTeX class definitions
#+BEGIN_SRC emacs-lisp :tangle config.el
);; with-eval-after-load
#+END_SRC
**** ox-asciidoc - Export to AsciiDoc
https://github.com/yashi/org-asciidoc - «An Org Mode Exporter Backend For AsciiDoc»
#+BEGIN_SRC emacs-lisp :tangle config.el
(use-package ox-asciidoc
;;:ensure t ;; install package if not found OR: (setq use-package-always-ensure t)
:defer 110
)
#+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
;;(setq org-reveal-root "file:///d:/reveal.js")
(cond ((my-system-type-is-gnu)
(setq org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js")
(setq org-reveal-extra-css "file:///home/vk/.emacs.d/bin/reveal_theme_night_local.css"))
((string-equal system-name "GRZN17009")
(setq org-reveal-root "file:///C:/Users/karl.voit/.emacs.d/bin/reveal.js/")
(setq org-reveal-extra-css "file:///C:/Users/karl.voit/.emacs.d/bin/reveal_theme_night_local.css"))
((string-equal system-name "cosmo")
(setq org-reveal-root "file:///C:/Users/John/AppData/Roaming/.emacs.d/bin/reveal.js/")
(setq org-reveal-extra-css "file:///C:/Users/John/AppData/Roaming/.emacs.d/bin/reveal_theme_night_local.css"))
(t
(setq org-reveal-root "http://cdn.jsdelivr.net/reveal.js/3.0.0/"))
)
;; my preferred defaults:
(setq org-reveal-hlevel 2)
(setq org-reveal-postamble "<p> Created by Karl. </p>")
(setq org-reveal-center nil)
(setq org-reveal-progress t)
(setq org-reveal-history nil)
(setq org-reveal-control t)
(setq org-reveal-keyboard t)
(setq org-reveal-overview nil)
(setq org-reveal-transition "default")
;; - transitions:
;; - default
;; - cube
;; - page
;; - concave
;; - zoom
;; - linear
;; - fade
;; - none
(setq org-reveal-theme "night")
;; - Styles:
;; - black (default)
;; - white
;; - league
;; - gray one
;; - sky
;; - nice bright one
;; - beige
;; - nice bright one
;; - simple
;; - bright
;; - serif
;; - old school
;; - blood
;; - cool!
;; - *night*
;; - very nice
;; - moon
;; - solarized
)
#+END_SRC
#+RESULTS:
: t
**** 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
2023-08-12 17:25:26 +02:00
** yasnippets
2023-08-12 17:25:26 +02:00
#+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")))
2023-08-12 17:25:26 +02:00
#+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
#+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
(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
#+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))
;; 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)
#+end_src
2023-08-12 17:25:26 +02:00
* 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.
#+begin_src emacs-lisp :tangle no
2023-08-12 17:25:26 +02:00
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
#+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.
2023-08-12 17:25:26 +02:00
#+begin_src emacs-lisp :tangle init.el
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
2023-08-12 17:25:26 +02:00
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
company ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
;;hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
indent-guides ; highlighted indent columns
(ligatures +extra +iosevka) ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;tabs ; a tab bar for Emacs
treemacs ; a project drawer, like neotree but cooler
unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing
:editor
;;(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
word-wrap ; soft wrapping with language-aware indent
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;ibuffer ; interactive buffer management
(undo +tree) ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
;;eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
(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
;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
lookup ; navigate your code and its documentation
lsp ; M-x vscode
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
;;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
(:if IS-MAC macos) ; improve compatibility with macOS
;;tty ; improve the terminal Emacs experience
:lang
;;agda ; types of types of types of types...
;;beancount ; mind the GAAP
(cc +lsp) ; C > C++ == 1
clojure ; 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
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;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
;;(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
javascript ; all(hope(abandon(ye(who(enter(here))))))
julia ; 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
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
org ; organize your plain life in plain text
php ; perl's insecure younger brother
plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
python ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
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'}"}
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
web ; the tubes
yaml ; JSON, but readable
zig ; C, but simpler
:email
;;(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
calendar
;;emms
everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
:config
;;literate
(default +bindings +smartparens))
2023-08-12 17:25:26 +02:00
#+end_src
2023-08-12 17:25:26 +02:00
* 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_#+begin_src
#+end_src
** Packages:
*** Core
#+begin_src emacs-lisp :tangle packages.el
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
(unpin! straight)
(package! beacon)
(package! counsel)
(package! deft)
#+end_src
*** Themes
#+begin_src emacs-lisp :tangle packages.el
(package! all-the-icons)
(package! all-the-icons-dired)
(package! doom-themes)
#+end_src
2023-08-12 17:25:26 +02:00
*** Modes:
#+begin_src emacs-lisp :tangle packages.el
(package! battle-haxe)
(package! fish-mode)
(package! typescript-mode)
(package! wc-mode)
(package! plantuml-mode)
(package! csv-mode)
2023-08-12 17:25:26 +02:00
#+end_src
*** dired
#+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
*** Org
2023-08-12 17:25:26 +02:00
#+begin_src emacs-lisp :tangle packages.el
;; Fix for org-roam link issue
(package! org :pin "ca873f7")
(package! org-auto-tangle)
(package! org-modern)
(package! org-ql)
(package! org-sidebar
:recipe (
:host github
:repo "alphapapa/org-sidebar"
))
2023-08-12 17:25:26 +02:00
(package! org-contacts)
(package! org-bullets)
(package! org-download)
2023-08-12 17:25:26 +02:00
(package! org-cliplink)
(package! org-roam)
(package! org-super-agenda)
2023-08-12 17:25:26 +02:00
(package! org-wild-notifier)
#+end_src
*** Org-depend
Ensure task dependencies are met.
#+begin_src emacs-lisp :tangle no
2023-08-12 17:25:26 +02:00
(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
2023-08-12 17:25:26 +02:00
*** Elgantt
:PROPERTIES:
:ID: 2d5897d1-6e8c-4163-a131-42daef5856cb
:END:
2023-08-12 17:25:26 +02:00
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