")))
(setq org-html-postamble "Copyright (c) 2024 Preston Pan")
(setq org-export-with-section-numbers nil)
#+end_src
*** Contacts
Now we configure org-contacts, which allows me to store contacts in an org mode file:
#+begin_src emacs-lisp :tangle yes
(setq org-contacts-files '("~/org/contacts.org"))
#+end_src
And then we need to add some templates with org-capture in order to add entries to the contacts easier:
#+begin_src emacs-lisp :tangle yes
(defvar my/org-contacts-template "* %^{name}
:PROPERTIES:
:ADDRESS: %^{289 Cleveland St. Brooklyn, 11206 NY, USA}
:BIRTHDAY: %^{yyyy-mm-dd}
:EMAIL: %^{Email}
:NOTE: %^{NOTE}
:END:" "Template for org-contacts.")
(setq org-capture-templates
`(("c" "Contact" entry (file+headline "~/org/contacts.org" "Friends"), my/org-contacts-template
:empty-lines 1)))
#+end_src
*** Org Timer
Sometimes I want a timer to help me keep track of the time.
#+begin_src emacs-lisp :tangle yes
(setq org-clock-sound "~/audio/ding.wav")
#+end_src
** External Packages
we want to include some packages that don't come with doom emacs.
*** KBD-Mode
kbd-mode allows us to edit kmonad kbd files with syntax highlighting:
#+begin_src emacs-lisp :tangle yes
(use-package! kbd-mode)
#+end_src
*** Pinentry
We now set up pinentry for the pass program. We need to set the mode to loopback
in order to enable emacs to start itself as a pinentry program, and we need to allow
loopbacks in gpg-agent.conf.
#+begin_src emacs-lisp :tangle yes
(use-package! pinentry
:init (setq epa-pinentry-mode `loopback)
(pinentry-start))
#+end_src
*** Rainbow Mode
This is not used currently but might in the future.
#+begin_src emacs-lisp :tangle yes
(define-globalized-minor-mode global-rainbow-mode rainbow-mode
(lambda ()
(when (not (memq major-mode
(list 'org-agenda-mode)))
(rainbow-mode 1))))
#+end_src
*** Automatically tangle
Tangling manually every single time is kind of painful. Instead, we allow ourselves to set a flag
in org that allows org to know we should tangle on save:
#+begin_src emacs-lisp :tangle yes
(use-package! org-auto-tangle
:hook (org-mode . org-auto-tangle-mode))
#+end_src
*** Notifications
We use ednc to manage notifications.
#+begin_src emacs-lisp :tangle yes
(ednc-mode 1)
(defun show-notification-in-buffer (old new)
(let ((name (format "Notification %d" (ednc-notification-id (or old new)))))
(with-current-buffer (get-buffer-create name)
(if new (let ((inhibit-read-only t))
(if old (erase-buffer) (ednc-view-mode))
(insert (ednc-format-notification new t))
(pop-to-buffer (current-buffer)))
(kill-buffer)))))
(add-hook 'ednc-notification-presentation-functions
#'show-notification-in-buffer)
(evil-define-key 'normal ednc-view-mode-map
(kbd "d") 'ednc-dismiss-notification
(kbd "RET") 'ednc-invoke-action
(kbd "e") 'ednc-toggle-expanded-view)
#+end_src
*** Playing Video
#+begin_src emacs-lisp :tangle yes
(setq empv-invidious-instance "https://yewtu.be/api/v1")
#+end_src
*** Mastodon
#+begin_src emacs-lisp :tangle yes
(setq mastodon-instance-url "https://types.pl")
(setq mastodon-active-user "ret2pop")
#+end_src
*** Ement
#+begin_src emacs-lisp :tangle yes
;; (ement-connect :uri-prefix "http://localhost:8009")
#+end_src
*** Stem
I wrote a [[https://github.com/ret2pop/stem-mode][major mode]] for my programming language [[https://github.com/ret2pop/stem][stem]].
#+begin_src emacs-lisp :tangle yes
(use-package stem-mode)
(add-to-list 'auto-mode-alist '("\\.stem\\'" . stem-mode))
#+end_src
*** Tufte
Our website uses the tufte css styling and we must therefore tell emacs to generate html that is compliant with this html:
#+begin_src emacs-lisp
(use-package! ox-tufte)
(use-package! plan9-theme)
#+end_src
* packages.el Configuration
These are some external packages that I use that are not provided by doom modules.
#+begin_src emacs-lisp :tangle packages.el
(unpin! evil-collection)
(package! evil-collection
:recipe (:repo "kepi/evil-collection" :branch "mu4e-development"))
(package! pinentry)
(package! kbd-mode
:recipe (:host github
:repo "kmonad/kbd-mode"))
(package! nasm-mode)
(package! org-contrib)
(package! exwm)
(package! org-auto-tangle)
(package! rainbow-mode)
(package! ednc)
(package! mentor)
(package! request) ;; dependency for lemmy client
(package! plz) ;; dependency for lemmy client; either request or plz is idk what to use
(package! curl-to-elisp)
(package! empv)
(package! elpher)
(package! ement)
(package! mastodon)
(package! go-translate)
(package! ts)
(package! chess)
(package! ox-tufte)
(package! plan9-theme)
#+end_src
* init.el Configuration
This installs all the doom modules that we are going to be configuring:
#+begin_src emacs-lisp :tangle init.el
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
chinese
japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
company
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
(ivy +icons +fuzzy)
;; vertico
:ui
;;deft ; notational velocity for Emacs
doom
doom-dashboard
doom-quit
(emoji +unicode)
hl-todo
hydra
indent-guides
(ligatures +extra +fira)
minimap
modeline
;;nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints
(popup +defaults)
;; tabs
treemacs
unicode
(vc-gutter +pretty)
vi-tilde-fringe
window-select
workspaces
zen
:editor
(evil +everywhere)
file-templates
fold
(format +onsave)
;;god ; run Emacs commands without modifier keys
lispy
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
parinfer
;;rotate-text ; cycle region at point between text candidates
snippets
word-wrap
:emacs
dired
electric
(ibuffer +icons)
undo
vc
:term
eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;; term ; basic terminal emulator for Emacs
vterm
:checkers
syntax
(spell +flyspell)
grammar
:tools
;;ansible
;;biblio ; Writes a PhD for you (citation needed)
(debugger +lsp)
;;direnv
;;docker
editorconfig
ein
(eval +overlay)
gist
(lookup +dictionary +offline)
lsp
magit
make
pass
pdf
;;prodigy ; FIXME managing external services & code builders
rgb
;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code
tmux
tree-sitter
;;upload ; map local to remote projects via ssh/ftp
:os
(:if IS-MAC macos)
tty
:lang
;;agda ; types of types of types of types...
;;beancount ; mind the GAAP
(cc +lsp)
;;clojure ; java with a lisp
common-lisp
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
data
;;(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp
;;erlang ; an elegant language for a more civilized age
ess
;;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)
;;(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 +lsp)
;;(java +lsp) ; the poster child for carpal tunnel syndrome
(javascript +lsp)
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
(latex +lsp +fold +cdlatex)
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
;;lua ; one-based indices? one-based indices
(markdown +grip)
;;nim ; python + lisp at the speed of c
nix
;;ocaml ; an objective camel
(org +journal +jupyter +gnuplot +brain +pretty +roam2)
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
(python +lsp +tree-sitter)
;;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)
;;scala ; java, but good
(scheme +guile)
(sh +fish +lsp)
;;sml
solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
(web +lsp)
(yaml +lsp)
;;zig ; C, but simpler
:email
(mu4e +org)
;;notmuch
;;(wanderlust +gmail)
:app
calendar
emms
everywhere
irc
(rss +org)
;;twitter ; twitter client https://twitter.com/vnought
:config
literate
(default +bindings +smartparens))
#+end_src