Update [2024-10-03 Thu 00:41]

This commit is contained in:
Phil Bajsicki 2024-10-03 00:41:07 +02:00
parent b2933f2b4a
commit f4050f23d6
9 changed files with 244 additions and 120 deletions

View file

@ -1 +0,0 @@

View file

@ -1,5 +1,6 @@
#+Title: Phil's Doom Emacs Config
#+STARTUP: indent
#+Title: Phil's Doom Emacs Literate Config
#+author: Phil Bajsicki
#+STARTUP: indent show2levels
#+auto_tangle: t
* Intro
@ -14,7 +15,18 @@ Some of the comments are from the default config.el file that ships with Doom Em
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.]]
* Header
:PROPERTIES:
:CREATED: <2024-09-23 Mon 01:07>
:END:
This will generate a header, clarifying that the resulting Doom Emacs ~config.el~ is not to be modified directly.
#+begin_src elisp :tangle config.el
;; -*- lexical-binding: t -*-
;; DO NOT EDIT THIS FILE
;; This file was generated from the .config/doom/README.org file
;; in the following repo: https://git.bajsicki.com/phil/dot/
#+end_src
* config.el
** Basic settings
*** Author/ personal info
@ -211,6 +223,12 @@ Keeps images contained on the screen.
(setq org-image-actual-width '(0.8))
#+end_src
Footnote positioning and style.
#+begin_src elisp :tangle config.el
(setq org-footnote-auto-adjust t)
(setq org-footnote-define-inline t)
#+end_src
Pretty!
#+begin_src emacs-lisp config.el
(setq org-superstar-headline-bullets-list
@ -377,21 +395,6 @@ Change font for DONE tasks
((((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
**** Capture templates
#+begin_src emacs-lisp :tangle config.el
@ -418,6 +421,53 @@ Inserts timestamps in the proper format. ~'(16)~ stands for two universal argume
| i | idea | entry | (file+headline ~/enc/org/agenda.org Ideas) | * %? |
| d | reminder | entry | (file+headline ~/enc/org/agenda.org Reminders) | * %i%? |
**** 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
**** 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)
#+end_src
***** Capture templates
#+begin_src emacs-lisp :tangle config.el
(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
***** 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
**** Functions
***** my-id-get-or-generate
Straight from Karl Voit's config.
@ -653,41 +703,6 @@ 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)
(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
***** 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.
@ -829,7 +844,10 @@ For the files whose paths match the strings in the function, it will advise the
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.
Additionally, outside of the structured files where I am tracking time linearly, I want ~org-expiry-insert-created~, which fits in neatly into this little hook, thus allowing me to inspect my workflows more carefully.
#+begin_src emacs-lisp :tangle config.el
(use-package! org-expiry)
(after! org
(add-hook! 'org-insert-heading-hook
(if (or
@ -838,7 +856,8 @@ This turns making new entries from ~C-<return> C-i i~ into just ~C-<return>~. Mu
(string-match-p "therapy.org" buffer-file-name))
(progn
(org-time-stamp-inactive '(16))
(newline)))))
(newline))
(org-expiry-insert-created))))
#+end_src
*** org-mode expansions
@ -860,19 +879,10 @@ key, which I have set up with my NitroKey. It's some really really cool tech.
(setq org-crypt-key "phil@bajsicki.com")
(setenv "GPG_AGENT_INFO" nil)
#+end_src
**** 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
**** 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
***** LaTeX
Adding the tufte-handout and the memoir classes.
#+begin_src emacs-lisp :tangle config.el
(with-eval-after-load 'ox-latex
@ -905,6 +915,15 @@ I have not settled on this. Meh.
(setq org-latex-default-class "tufte-handout"
org-latex-pdf-process '("latexmk -pdf -bibtex-cond -f -outdir=%o %f"))
#+end_src
***** ox-hugo
:PROPERTIES:
:CREATED: <2024-09-24 Tue 15:08>
:END:
#+begin_src elisp :tangle config.el
(use-package! ox-hugo
:ensure t
:after ox)
#+end_src
**** 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.
@ -949,6 +968,25 @@ Email in Emacs... what more can a man want?
#+end_src
#+RESULTS:
*** circe
:PROPERTIES:
:CREATED: <2024-09-21 Sat 23:50>
:END:
Doesn't work very well. I guess it "works", but I still need to auth manually; not sure what the issue is - my best guess is that my passwords use unusual unicode characters and that screws with the ~(read)~ instruction.
#+begin_src emacs-lisp :tangle config.el
(setq my-credentials-file "~/enc/keys/emacs/circe.el")
(defun my-nickserv-password (server)
(with-temp-buffer
(insert-file-contents-literally my-credentials-file)
(plist-get (read (buffer-string)) :nickserv-password)))
(setq circe-network-options
'(("Libera Chat"
:nick "phil_bb"
:channels ("#emacs" "#emacs-circe")
:nickserv-password my-nickserv-password)))
#+end_src
*** pdf-tools
Gotta read in Emacs, sometimes. Usually in the browser, but when I have to take
@ -1226,7 +1264,7 @@ Custom variables. Note that this file is generally set up automatically by Emacs
:app
calendar
;;emms
emms
everywhere ; *leave* Emacs!? You must be joking
irc ; how neckbeards socialize
(rss +org) ; emacs as an RSS reader
@ -1282,6 +1320,7 @@ Custom variables. Note that this file is generally set up automatically by Emacs
(package! org-auto-tangle)
(package! ox-slack)
(package! ox-tufte)
(package! ox-hugo)
(package! ox-gemini
:recipe (
:host sourcehut
@ -1304,7 +1343,7 @@ Custom variables. Note that this file is generally set up automatically by Emacs
(package! org-wild-notifier)
(package! org-habit-stats)
#+end_src
**** org-expiry
**** org-contrib
#+begin_src emacs-lisp :tangle packages.el
(package! org-contrib
:recipe (:host sourcehut :type git

View file

@ -1,6 +0,0 @@
(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)

View file

@ -1,3 +1,8 @@
;; -*- lexical-binding: t -*-
;; DO NOT EDIT THIS FILE
;; This file was generated from the .config/doom/README.org file
;; in the following repo: https://git.bajsicki.com/phil/dot/
(setq user-full-name "Phil Bajsicki")
(setq-default backup-inhibited t)
@ -104,6 +109,9 @@
(setq org-image-actual-width '(0.8))
(setq org-footnote-auto-adjust t)
(setq org-footnote-define-inline t)
(global-org-modern-mode)
(setq org-read-date-prefer-future t)
@ -184,14 +192,6 @@
((((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")
@ -209,6 +209,40 @@
:BIRTHDAY:
:END:")))
(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-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)
("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)))
(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)
(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."
@ -322,32 +356,6 @@ w (buffer-name (let* ((heading (org-get-heading t t))
(org-end-of-subtree t t)
(org-paste-subtree level tree-text))))))))
(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)
("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)))
(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)
(setq org-agenda-start-day nil)
(setq org-agenda-start-on-weekday nil)
(setq org-agenda-span 'day)
@ -411,6 +419,7 @@ w (buffer-name (let* ((heading (org-get-heading t t))
(require 'org-auto-tangle)
(add-hook 'org-mode-hook 'org-auto-tangle-mode)
(use-package! org-expiry)
(after! org
(add-hook! 'org-insert-heading-hook
(if (or
@ -419,7 +428,8 @@ w (buffer-name (let* ((heading (org-get-heading t t))
(string-match-p "therapy.org" buffer-file-name))
(progn
(org-time-stamp-inactive '(16))
(newline)))))
(newline))
(org-expiry-insert-created))))
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images)
@ -431,8 +441,6 @@ w (buffer-name (let* ((heading (org-get-heading t t))
(setq org-crypt-key "phil@bajsicki.com")
(setenv "GPG_AGENT_INFO" nil)
(use-package! org-expiry)
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("tufte-handout"
@ -453,6 +461,10 @@ w (buffer-name (let* ((heading (org-get-heading t t))
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
(use-package! ox-hugo
:ensure t
:after ox)
(use-package! org-transclusion
:after org
:init
@ -484,6 +496,19 @@ w (buffer-name (let* ((heading (org-get-heading t t))
(mu4e t)
(setq my-credentials-file "~/enc/keys/emacs/circe.el")
(defun my-nickserv-password (server)
(with-temp-buffer
(insert-file-contents-literally my-credentials-file)
(plist-get (read (buffer-string)) :nickserv-password)))
(setq circe-network-options
'(("Libera Chat"
:nick "phil_bb"
:channels ("#emacs" "#emacs-circe")
:nickserv-password my-nickserv-password)))
(use-package! pdf-tools
:defer t
:commands (pdf-loader-install)

View file

@ -182,7 +182,7 @@
:app
calendar
;;emms
emms
everywhere ; *leave* Emacs!? You must be joking
irc ; how neckbeards socialize
(rss +org) ; emacs as an RSS reader

View file

@ -26,6 +26,7 @@
(package! org-auto-tangle)
(package! ox-slack)
(package! ox-tufte)
(package! ox-hugo)
(package! ox-gemini
:recipe (
:host sourcehut

62
.config/doom/packages.el~ Normal file
View file

@ -0,0 +1,62 @@
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
(unpin! straight)
(package! beacon)
(package! counsel)
(package! deft)
(package! all-the-icons)
(package! all-the-icons-dired)
(package! doom-themes)
(package! battle-haxe)
(package! fish-mode)
(package! typescript-mode)
(package! terraform-mode)
(package! wc-mode)
(package! plantuml-mode)
(package! csv-mode)
(package! dired-open)
(package! pdf-tools)
;; Fix for org-roam link issue
(package! org-auto-tangle)
(package! ox-slack)
(package! ox-tufte)
(package! ox-hugo)
(package! ox-gemini
:recipe (
:host sourcehut
:repo "abrahms/ox-gemini"))
(package! org-special-block-extras)
(package! org-transclusion)
(package! org-modern)
(package! org-ql)
(package! org-sidebar
:recipe (
:host github
:repo "alphapapa/org-sidebar"
))
(package! org-contacts)
(package! org-bullets)
(package! org-download)
(package! org-cliplink)
(package! org-roam)
;; (package! org-super-agenda)
(package! org-wild-notifier)
(package! org-habit-stats)
(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)

View file

@ -1,7 +1,7 @@
#+title: Phil's xmonad config
#+author: Phil Bajsicki
#+PROPERTY: header-args :tangle xmonad.hs
#+auto_tangle: t
* Table of Contents :toc:
- [[#info][Info]]
@ -562,6 +562,7 @@ Notes: I use a ZSA Moonlander so a lot of the 4-5 key sequences are actually jus
, ("M-d", spawn "rofi -show drun")
#+end_src
*** Some common keybinds:
#+begin_src haskell
, ("M-e", spawn "emacsclient -c")
, ("M-<Return>", spawn "alacritty")
@ -571,18 +572,22 @@ Notes: I use a ZSA Moonlander so a lot of the 4-5 key sequences are actually jus
, ("M-S-C-M1-s", spawn "xscreensaver-command -lock")
#+end_src
*** Keybindings for keyboard layout changes
*** Keybindings for keyboard layout changes :ATTACH:
:PROPERTIES:
:ID: 5ec9fb1e-82b8-4961-ae4f-5f942c53984f
:END:
#+begin_src haskell
, ("M-j p", spawn "setxkbmap -model pc104 -layout pl -option compose:rctrl")
, ("M-j g", spawn "setxkbmap -model pc104 -layout gr -option compose:rctrl")
#+end_src
*** XMonad.Prompt.OrgMode
This is one of the most useful things in the world.
Written by [[https://xmonad.github.io/xmonad-docs/xmonad-contrib/XMonad-Prompt-OrgMode.html][Tony Zorman]] (a really nice guy) it's truly a great improvement to my workflow.
#+begin_src haskell
, ("M-c i", orgPrompt def "TODO" "~/enc/org/inbox.org")
, ("M-c l", orgPromptPrimary def "LINK" "~/enc/org/inbox.org")
, ("M-c n", orgPrompt def "NOTE" "~/enc/org/inbox.org")
, ("M-c p", orgPromptRefile def "TODO" "~/enc/org/phil.org")
, ("M-c i", orgPromptRefileTo def "INBOX :inbox:" "INBOX" "~/enc/org/inbox.org")
, ("M-c l", orgPromptPrimary def "Unsorted :link:" "~/enc/org/bookmarks.org")
, ("M-c n", orgPromptRefileTo def "NOTE :note:\n" "~/enc/org/.org")
#+end_src
*** Timestamp chords
For local time, EST, and PST.

View file

@ -343,10 +343,9 @@ main = do
, ("M-j p", spawn "setxkbmap -model pc104 -layout pl -option compose:rctrl")
, ("M-j g", spawn "setxkbmap -model pc104 -layout gr -option compose:rctrl")
, ("M-c i", orgPrompt def "TODO" "~/enc/org/inbox.org")
, ("M-c l", orgPromptPrimary def "LINK" "~/enc/org/inbox.org")
, ("M-c n", orgPrompt def "NOTE" "~/enc/org/inbox.org")
, ("M-c p", orgPromptRefile def "TODO" "~/enc/org/phil.org")
, ("M-c i", orgPromptRefileTo def "INBOX :inbox:" "INBOX" "~/enc/org/inbox.org")
, ("M-c l", orgPromptPrimary def "Unsorted :link:" "~/enc/org/bookmarks.org")
, ("M-c n", orgPromptRefileTo def "NOTE :note:\n" "~/enc/org/.org")
-- Time! Timestamps!
, ("M-w l", spawn "sleep 0.5 && xdotool type \"$(date +'%Y.%m.%d %H:%M:%S %Z')\"")