This commit is contained in:
ry
2021-12-20 14:28:28 -08:00
parent 8427d4c768
commit bdcdfd0587
10 changed files with 527 additions and 1811 deletions

742
Emacs.org
View File

@@ -1,95 +1,130 @@
#+title: Emacs Custom Configuration File
#+PROPERTY: header-args:emacs-lisp :tangle ~/Dotfiles/.config/doom/config.el :mkdirp yes :lexical yes
#+TITLE: Emacs Configuration
#+PROPERTY: header-args:emacs-lisp :tangle ~/Dotfiles/.config/emacs/init.el :mkdirp yes :lexical yes
* Configuration
:PROPERTIES:
:VISITBILITY: children
:END:
** Table of Contents :TOC_4_gh:
- [[#configuration][Configuration]]
- [[#general][General]]
- [[#load-paths][Load Paths]]
- [[#user-info][User Info]]
- [[#visual][Visual]]
- [[#misc][Misc]]
- [[#theme][Theme]]
- [[#fonts][Fonts]]
- [[#org][Org]]
- [[#fonts-and-symbols][Fonts and Symbols]]
- [[#general-1][General]]
- [[#better-heading-bullets][Better Heading Bullets]]
- [[#center-org-buffers][Center Org Buffers]]
- [[#org-babel][Org Babel]]
- [[#racket-specific-language][Racket Specific Language]]
- [[#babel-languages][Babel Languages]]
- [[#soure-block-creation-shortcuts][Soure Block Creation Shortcuts]]
- [[#babel-configuration-file-automation-hook][Babel Configuration File Automation Hook]]
- [[#programming-languages][Programming Languages]]
- [[#common-lisp][Common Lisp]]
- [[#mu4e-e-mail][Mu4e (E-mail)]]
- [[#erc-irc][ERC (IRC)]]
:VISIBILITY: children
:END:
** Package Management
I use [[https://github.com/raxod502/straight.el][straight.el]] for managing packages as it's fairly simple and robust. At some point I'd like to move to primarily using Guix for Emacs package management.
*** Bootstraping straight.el
#+begin_src emacs-lisp
(setq package-enable-at-startup nil)
;; * Package Management with straight.el
(unless (featurep 'straight)
;; Bootstrap straight.el
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage)))
;; Use straight.el for use-package expressions
(straight-use-package 'use-package)
#+end_src
** General
*** Load Paths
*** User Interface
#+begin_src emacs-lisp
(add-to-list 'load-path "~/.guix-profile/bin/guile")
(add-to-list 'load-path "~/.guix-profile/share/emacs/site-lisp")
(scroll-bar-mode -1) ;; Disable scroll bar
(tool-bar-mode -1) ;; Disable tool bar menu
(tooltip-mode -1) ;; Disable tooltips
(set-fringe-mode 10) ;; Disable fringe mode
(menu-bar-mode -1) ;; Disable menu bar
(global-display-line-numbers-mode t) ;; Display line numbers
(set-default 'truncate-lines nil) ;; Wrap lines at end of screen
(setq visible-bell t) ;; Visible flash to represent a bell
(setq x-select-enable-clipboard t) ;; Enable clipboard
(global-tab-line-mode 1)
(setq inhibit-startup-message t)
;; Match Emacs program path to be the same as user shell
(defun set-exec-path-from-shell-PATH ()
"Set up Emacs' `exec-path' and PATH environment variable to match
that used by the user's shell."
(interactive)
(let ((path-from-shell (replace-regexp-in-string
"[ \t\n]*$" "" (shell-command-to-string
"$SHELL --login -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(set-exec-path-from-shell-PATH)
#+end_src
*** User Info
#+begin_src emacs-lisp
;; Setting general info
(setq user-full-name "Ry"
user-mail-address "ry@opal.sh")
#+end_src
*** Visual
#+begin_src emacs-lisp
;; Set line number
(setq display-line-numbers-type t)
;; Keeps text lines from going off screen.
(set-default 'truncate-lines nil)
;; Add this hook to ERC if I run into trouble with truncated lines in other modes.
;; (add-hook 'erc-mode-hook (lambda () (setq-default truncate-lines nil)))
;; Only enable line numbers for certain modes
(dolist (mode '(org-mode-hook
term-mode-hook
shell-mode-hook
eshell-mode-hook))
;; Disable line mode for specific major/minor modes.
(dolist (mode '(org-mode-hook))
'term-mode-hook
'shell-mode-hook
'eshell-mode-hook
(add-hook mode (lambda () (display-line-numbers-mode 0))))
#+end_src
*** Misc
*** Modeline
Doom's modeline is excellent, and much less cluttered than the default Emacs modeline.
#+begin_src emacs-lisp
;; Enable clipboard
(setq x-select-enable-clipboard t)
(use-package doom-modeline
:straight t
:init (doom-modeline-mode 1)
:custom ((doom-modeline-height 15)))
#+end_src
** Theme
#+begin_src emacs-lisp
;; load theme
(setq doom-theme 'modus-operandi)
*** Keybinding display
Which-key is a package that displays the available commands granted that it's incomplete. For instance, if I type "SPC", I will see all of the commands available to the leader key.
;; Configure Modus theme
#+begin_src emacs-lisp
(use-package which-key
:straight t
:defer 0
:diminish which-key-mode
:config
(which-key-mode)
(setq which-key-idle-delay 0.3))
#+end_src
*** Notifications
**** Alerts
Minimal alerts so I can see notifications from various programs in Emacs.
#+begin_src emacs-lisp
(use-package alert
:straight t
:config
(setq alert-default-style 'notification))
#+end_src
**** Disable Warnings
#+begin_src emacs-lisp
(setq large-file-warning-threshold nil) ;; Disables warnings for large files
(setq vc-follow-symlinks t) ;; Disables warnings for symlinks
#+end_src
*** Helpful Describe Functionality
Helpful.el is a package that reformats the describe-X functions to be much more informative.
#+begin_src emacs-lisp
(use-package helpful
:straight t
:commands (helpful-callable helpful-variable helpful-command helpful-key)
:custom
(counsel-describe-function-function #'helpful-callable)
(counsel-describe-variable-function #'helpful-variable)
:bind
([remap describe-function] . counsel-describe-function)
([remap describe-command] . helpful-command)
([remap describe-variable] . counsel-describe-variable)
([remap describe-key] . helpful-key))
#+end_src
*** Autosaves
#+begin_src emacs-lisp
(use-package super-save
:straight t
:config
(super-save-mode +1))
;; Auto reverting Changed Files
(setq global-auto-revert-non-file-buffers nil)
(global-auto-revert-mode -1)
#+end_src
** Theme
I really enjoy [[https://protesilaos.com/emacs/modus-themes][Modus Themes]] by Protesilaos Stavrou. They are minimal, high contrast, and easy on the eyes.
#+begin_src emacs-lisp
(use-package modus-themes
:straight t
:init
(setq modus-themes-italic-constructs t
modus-themes-bold-constructs nil
@@ -97,35 +132,168 @@ that used by the user's shell."
modus-themes-org-blocks 'greyscale
modus-themes-paren-match 'intense
modus-themes-mixed-fonts t)
;; Load the theme files before enabling a theme
(modus-themes-load-themes)
:config
(modus-themes-load-vivendi) ;; OR (modus-themes-load-operandi)
:bind ("<f5>" . modus-themes-toggle))
(modus-themes-load-vivendi)
:bind
("<f5>" . modus-themes-toggle))
#+end_src
** Fonts
Using [[https://github.com/tonsky/FiraCode][Fira Code]] + Fira Code Retina.
Mozilla's Fira fonts are pretty, and the Sans and Code types look excellent with the corresponding mode.
#+begin_src emacs-lisp
;; Set fonts
(set-face-attribute 'default nil :font "Fira Code" :height 125 :weight 'medium)
(set-face-attribute 'variable-pitch nil :font "Fira Sans" :height 1.0 :weight 'regular)
(set-face-attribute 'fixed-pitch nil :font "Fira Code" :height 1.0 :weight 'medium)
#+end_src
** Keybinding
I came from vim, so naturally I use Evil keybindings. I also used to use Doom Emacs before rolling my own configuration so I've borrowed some ideas from my time spent there as well. Between the two paradigms I rarely leave the home row which is ideal for typing for extended periods of time.
*** General.el (leader-key keybindings)
I really enjoy having a leader key and eschewing the Control and Alt keys entirely. Doom had far too many leader keybindings that I never used so I've boiled them down to the essentials that I used the most.
#+begin_src emacs-lisp
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) ;; Escape exits out of prompts
;; Define Leader Key
(use-package general
:straight t
:config
(general-evil-setup t)
(general-create-definer opal/leader-keys
:keymaps '(normal insert visual emacs)
:prefix "SPC"
:global-prefix "C-SPC")
;; Define Keybindings (potentially move into own file)
(opal/leader-keys
;; Leader-map
";" #'pp-eval-expression ;; Eval expression
":" #'execute-extended-command ;; Eq to M-x
"u" #'universal-argument ;; Universal argument
"w" #'evil-window-map ;; Window functions
"." #'find-file ;; Find file (opens in mini-buffer)
"," #'persp-switch-to-buffer ;; Switch to perspective.el minibuffer
"<" #'switch-to-buffer ;; Switch to non-perspective.el minibuffer
"s" #'swiper ;; Search in current buffer
;; Magit
"gg" #'magit-status
"gi" #'magit-init
"gc" #'magit-clone
;; Buffers
"bd" #'kill-buffer
;; Org
; Babel
"obt" #'org-babel-tangle
; Gen
"ol" #'org-insert-link
"or" #'org-reload
; Agenda
"oa" #'org-agenda
;; Eval
"eb" #'eval-buffer
"er" #'eval-region
"ef" #'eval-defun
"el" #'eval-last-sexp
;; Describe
"df" #'describe-function
"dv" #'describe-variable
"ds" #'describe-symbol
"dk" #'describe-key
"dp" #'describe-package))
#+end_src
*** Evil
#+begin_src emacs-lisp
(use-package evil
:straight t
:init
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(setq evil-want-C-u-scroll t)
(setq evil-want-C-i-jump nil)
(setq evil-respect-visual-line-mode t)
:config
(evil-mode 1)
(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
(define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join)
;; Use visual line motions even outside of visual-line-mode buffers
(evil-global-set-key 'motion "j" 'evil-next-visual-line)
(evil-global-set-key 'motion "k" 'evil-previous-visual-line)
(evil-set-initial-state 'messages-buffer-mode 'normal)
(evil-set-initial-state 'dashboard-mode 'normal))
(use-package evil-collection
:straight t
:after evil
:config
(evil-collection-init))
#+end_src
** Completion Frameworks
At the moment, I'm trying out Ivy and counsel but I've used Vertico and liked it as well.
*** Ivy
#+begin_src emacs-lisp
(use-package ivy
:straight t
:diminish
:bind (("C-s" . 'swiper)
:map ivy-minibuffer-map
("TAB" . ivy-alt-done)
("C-l" . ivy-alt-done)
("C-j" . ivy-next-line)
("C-k" . ivy-previous-line)
:map ivy-switch-buffer-map
("C-k" . ivy-previous-line)
("C-l" . ivy-done)
("C-d" . ivy-reverse-i-search-kill))
:config
(ivy-mode 1))
(use-package ivy-rich
:straight t
:after ivy
:init (ivy-rich-mode 1))
#+end_src
*** Counsel
#+begin_src emacs-lisp
(use-package counsel
:straight t
:bind
(("C-M-j" . 'counsel-switch-buffer)
:map minibuffer-local-map
("C-r" . 'counsel-minibuffer-history))
:custom
(counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
:config
(counsel-mode 1))
#+end_src
** Org
*** Fonts and Symbols
Here we are setting general font configuration in order to make editing in org mode a bit more streamlined to look at.
*** General Configuration
#+begin_src emacs-lisp
;; Set org agenda dir
(setq org-directory "~/Org/")
(defun rymacs/org-font-setup ()
;; Tell Org to stop indenting inside of org source blocks.
(setq org-edit-src-content-indentation 0)
;; Open links in browser
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "firefox")
(defun opal/org-font-setup ()
;; Replace list hyphen with dot
(font-lock-add-keywords 'org-mode
'(("^ *\\([-]\\) "
@@ -156,25 +324,17 @@ Here we are setting general font configuration in order to make editing in org
(set-face-attribute 'line-number nil :inherit 'fixed-pitch)
(set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch))
#+end_src
*** General
Main Org/Agenda configuration.
#+begin_src emacs-lisp
;; Set org agenda dir
(setq org-directory "~/org/")
(defun rymacs/org-mode-setup ()
(defun opal/org-mode-setup ()
(org-indent-mode)
(variable-pitch-mode 1)
(visual-line-mode 1)
(setq org-startup-folded t))
(use-package org
:straight t
:commands (org-capture org-agenda)
:hook (org-mode . rymacs/org-mode-setup)
:hook (org-mode . opal/org-mode-setup)
:config
(setq org-ellipsis "")
(setq org-agenda-start-with-log-mode t)
@@ -182,142 +342,110 @@ Main Org/Agenda configuration.
(setq org-log-into-drawer t)
(setq org-agenda-files
'("~/org/projects/"
"~/org/tasks/"
))
'("~/Org/projects/"
"~/Org/tasks/"))
(require 'org-habit)
(add-to-list 'org-modules 'org-habit)
(setq org-habit-graph-column 60)
(setq org-todo-keywords
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
(sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANC(k@)")))
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
(sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANC(k@)")))
(setq org-refile-targets
'(("archive.org" :maxlevel . 1)
("planner.org" :maxlevel . 1)))
'(("archive.org" :maxlevel . 1)
("planner.org" :maxlevel . 1)))
;; Save Org buffers after refiling!
(advice-add 'org-refile :after 'org-save-all-org-buffers)
(setq org-tag-alist
'((:startgroup)
; Put mutually exclusive tags here
(:endgroup)
("@errand" . ?E)
("@home" . ?H)
("@work" . ?W)
("agenda" . ?a)
("planning" . ?p)
("publish" . ?P)
("batch" . ?b)
("note" . ?n)
("idea" . ?i)))
'((:startgroup)
; Put mutually exclusive tags here
(:endgroup)
("@errand" . ?E)
("@home" . ?H)
("@work" . ?W)
("agenda" . ?a)
("planning" . ?p)
("publish" . ?P)
("batch" . ?b)
("note" . ?n)
("idea" . ?i)))
;; Configure custom agenda views
(setq org-agenda-custom-commands
'(("d" "Dashboard"
((agenda "" ((org-deadline-warning-days 7)))
(todo "NEXT"
((org-agenda-overriding-header "Next Tasks")))
(tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects")))))
'(("d" "Dashboard"
((agenda "" ((org-deadline-warning-days 7)))
(todo "NEXT"
((org-agenda-overriding-header "Next Tasks")))
(tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects")))))
("n" "Next Tasks"
((todo "NEXT"
((org-agenda-overriding-header "Next Tasks")))))
("n" "Next Tasks"
((todo "NEXT"
((org-agenda-overriding-header "Next Tasks")))))
;; Low-effort next actions
("e" tags-todo "+TODO=\"NEXT\"+Effort<15&+Effort>0"
((org-agenda-overriding-header "Low Effort Tasks")
(org-agenda-max-todos 20)
(org-agenda-files org-agenda-files)))))
;; Low-effort next actions
("e" tags-todo "+TODO=\"NEXT\"+Effort<15&+Effort>0"
((org-agenda-overriding-header "Low Effort Tasks")
(org-agenda-max-todos 20)
(org-agenda-files org-agenda-files)))))
;; Create capture templates
(setq org-capture-templates
`(("t" "Tasks")
("tt" "Task" entry (file+olp "~/org/planner/tasks.org" "Inbox")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)
`(("t" "Tasks")
("tt" "Task" entry (file+olp "~/org/planner/tasks.org" "Inbox")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)
("p" "Projects")
("pp" "Project File" entry (file+olp "~/org/projects/auto-infra-overview.org" "Inbox")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)))
;; Init font setup
(rymacs/org-font-setup))
("p" "Projects")
("pp" "Project File" entry (file+olp "~/org/projects/auto-infra-overview.org" "Inbox")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)))
;; Init org font setup
(opal/org-font-setup))
#+end_src
*** Better Heading Bullets
*** Pretty Bullets
Creates nicer (-) bullets.
#+begin_src emacs-lisp
;; Change default pretty bullets to circles
(use-package org-bullets
:straight t
:after org
:hook (org-mode . org-bullets-mode)
:custom
(org-bullets-bullet-list '("" "" "" "" "" "" "")))
#+end_src
*** Center Org Buffers
*** Visual Fill Mode
Creates margins in Org mode to make it more pleasant to look at.
#+begin_src emacs-lisp
;; Creates margins, and centerrs content in org mode.
(defun rymacs/org-mode-visual-fill ()
(defun opal/org-mode-visual-fill ()
(setq visual-fill-column-width 100
visual-fill-column-center-text t)
visual-fill-column-center-text t)
(visual-fill-column-mode 1))
(use-package visual-fill-column
:hook (org-mode . rymacs/org-mode-visual-fill))
:straight t
:hook (org-mode . opal/org-mode-visual-fill))
#+end_src
*** Org Babel
Org Babel allows us to evaluate source code blocks within org mode. With this functionality, we can tell org babel to insert the content of the source block codes into any file specified by using the org-babel-tangle function.
**** Racket Specific Language
#+begin_src emacs-lisp
(use-package ob-racket
:after org
:config
(add-hook 'ob-racket-pre-runtime-library-load-hook
#'ob-racket-raco-make-runtime-library))
#+end_src
**** Babel Languages
#+begin_src emacs-lisp
;; Load languages for babel code blocks.
(with-eval-after-load 'org
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(racket . t)
(python . t)
(scheme . t)
(javascript . t)
(html . t)
(css . t)
(lisp . t)))
'((emacs-lisp . t)))
(push '("conf-unix" . conf-unix) org-src-lang-modes))
;; Set geiser default language
(setq geiser-default-implementation '(guile))
#+end_src
#+RESULTS:
| guile |
**** Soure Block Creation Shortcuts
Here we use a package called org-tempo.
#+begin_src emacs-lisp
;; Make shortcuts to easily create babel source code blocks.
(with-eval-after-load 'org
(require 'org-tempo)
@@ -329,178 +457,98 @@ Here we use a package called org-tempo.
(add-to-list 'org-structure-template-alist '("js" . "src javascript"))
(add-to-list 'org-structure-template-alist '("html" . "src html"))
(add-to-list 'org-structure-template-alist '("css" . "src css"))
(add-to-list 'org-structure-template-alist '("rt" . "src racket"))
(add-to-list 'org-structure-template-alist '("cl" . "src lisp")))
#+end_src
**** Babel Configuration File Automation Hook
TODO: This needs to be fixed, or find an equiv.
Since we don't want to have to manually use the org-babel-tangle function everytime we make changes to the corresponding .org file, we create an automation hook that executes the function every time we save.
** Programming/Editor
*** General
**** Syntax (Flycheck)
#+begin_src emacs-lisp
(use-package flycheck :straight t)
#+end_src
**** Rainbow Delimiters
#+begin_src emacs-lisp
(use-package rainbow-delimiters
:straight t
:init
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
(add-hook 'org-mode-hook #'rainbow-delimiters-mode))
#+end_src
**** Rainbow Mode
Sets HTML strings to have the background of the color they represent.
#+begin_src emacs-lisp
(use-package rainbow-mode :straight t)
#+end_src
*** Lisp
#+begin_src emacs-lisp
(use-package parinfer
:straight t
:init
(progn
(setq parinfer-extensions
'(defaults
pretty-parens
evil))
(add-hook 'prog-mode-hook #'parinfer-mode)))
#+end_src
** Magit
#+begin_src emacs-lisp
(use-package magit
:straight t)
#+end_src
** E-Mail
I've been using IceDove/Thunderbird for e-mail until I get around to making this a comparable solutions.
#+begin_src emacs-lisp
;; (use-package mu4e
;; :straight t
;; :config
;; ;; This is set to 't' to avoid mail syncing issues when using mbsync
;; (setq mu4e-change-filenames-when-moving t)
;; ;; Define a function that automatically executes rymacs/org-babel-tangle-config (a wrapper around org-babel-tangle) when saving this file.
;; (defun rymacs/org-babel-tangle-config ()
;; (when (string-equal (file-name-directory (buffer-file-name))
;; (expand-file-name "~/.dotfiles/.config/doom"))
;; ;; Refresh mail using isync every 5 minutes
;; (setq mu4e-update-interval (* 5 60))
;; (setq mu4e-get-mail-command "mbsync -a -c ~/Dotfiles/.config/mbsync/mbsyncrc")
;; (setq mu4e-maildir "~/Mail")
;; (let ((org-confirm-babel-evaluate nil))
;; (org-babel-tangle))))
;; (setq mu4e-contexts
;; (list
;; ;; Opal.sh
;; (make-mu4e-context
;; :name "Ry P."
;; :match-func
;; (lambda (msg)
;; (when msg
;; (string-prefix-p "/opal.sh" (mu4e-message-field msg :maildir))))
;; (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'rymacs/org-babel-tangle-config)))
;; :vars '((user-mail-address . "ry@opal.sh")
;; (user-full-name . "Ry P.")
;; (mu4e-drafts-folder . "/opal.sh/Drafts")
;; (mu4e-sent-folder . "/opal.sh/Sent")
;; (mu4e-trash-folder . "/opal.sh/Trash")))))
;; (setq mu4e-maildir-shortcuts
;; '(("/opal.sh/Inbox" . ?i)
;; ("/opal.sh/Sent" . ?s)
;; ("/opal.sh/Trash" . ?t)
;; ("/opal.sh/Drafts" . ?d))))
#+end_src
# *** Org Roam
# I use Org Roam as an alternative to writing traditional notes. Instead of long sprawling .org files, each note in Org roam is a excerpt of a specific idea or topic that has links to other notes made with Org Roam. Roam also allows you to pull up a buffer to look at which notes are linked in other notes. This creates a spawling network of information that is useful, quick to draw information from, and can create a notetaking experience that is interactive and seamless.
# #+begin_src emacs-lisp
# (use-package org-roam
# :init
# (setq org-roam-v2-ack t)
# :custom
# (org-roam-directory "~/roam/notes/")
# (org-roam-completion-everywhere t)
# (org-roam-capture-templates
# '(("d" "default" plain
# "%?"
# :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
# :unnarrowed t)
# ("r" "resources" plain
# (file "~/roam/templates/resource-template.org")
# :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
# :unnarrowed t)
# ("f" "files" plain
# (file "~/roam/templates/res-file-note-temp.org")
# :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
# :unnarrowed t)
# ("c" "cli" plain
# (file "~/roam/templates/commands-template.org")
# :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
# :unnarrowed t)))
# :bind (("C-c n l" . org-roam-buffer-toggle)
# ("C-c n f" . org-roam-node-find)
# ("C-c n i" . org-roam-node-insert)
# ("C-c n I" . org-roam-node-insert-immediate)
# ("C-c n p" . my/org-roam-find-project)
# :map org-mode-map
# ("C-M-i" . completion-at-point)
# :map org-roam-dailies-map
# ("Y" . org-roam-dailies-capture-yesterday)
# ("T" . org-roam-dailies-capture-tomorrow))
# :bind-keymap
# ("C-c n d" . org-roam-dailies-map)
# :config
# (require 'org-roam-dailies) ;; Ensure the keymap is available
# (org-roam-db-autosync-mode))
# ;; Function to enable the ability to quickly insert a link without
# ;; opening a capture buffer.
# (defun org-roam-node-insert-immediate (arg &rest args)
# (interactive "P")
# (let ((args (cons arg args))
# (org-roam-capture-templates (list (append (car org-roam-capture-templates)
# '(:immediate-finish t)))))
# (apply #'org-roam-node-insert args)))
# #+end_src
# *** Deft Configuration
# Deft is a package that helps browse and filter plain text files. I use it to search through org-roam notes.
# #+begin_src emacs-lisp
# (use-package deft
# :after org
# :bind
# ("C-c n d" . deft)
# :custom
# (deft-recursive t)
# (deft-use-filter-string-for-filename t)
# (deft-default-extension "org")
# (deft-directory org-roam-directory))
# #+end_src
** Programming Languages
*** Common Lisp
#+begin_src emacs-lisp
(after! sly
(load "/home/ry/quicklisp/clhs-use-local.el" t)
(setq sly-lisp-implementations
'((sbcl ("/bin/sbcl" "-L" "sbcl" "-Q" "run") :coding-system utf-8-unix)
(ccl ("/usr/local/bin/ccl64" :coding-system utf-8-unix)))))
(defmacro define-sly-lisp (name)
`(defun ,name () (interactive) (let ((sly-default-lisp ',name)) (sly))))
(define-sly-lisp sbcl)
(define-sly-lisp ccl)
#+end_src
** Mu4e (E-mail)
Account Information:
- IMAP: imap.opal.sh -- 993
- SMTP smtp.opal.sh -- 587
** IRC
Right now I'm pretty happy with Matrix bridging into IRC rooms so this will stay commented out for now. I might try out the Emacs Matrix client at some point soon.
#+begin_src emacs-lisp
(use-package mu4e
:config
;; This is set to 't' to avoid mail syncing issues when using mbsync
(setq mu4e-change-filenames-when-moving t)
;; Refresh mail using isync every 5 minutes
(setq mu4e-update-interval (* 5 60))
(setq mu4e-get-mail-command "mbsync -a -c ~/Dotfiles/.config/mbsync/mbsyncrc")
(setq mu4e-maildir "~/Mail")
(setq mu4e-contexts
(list
;; Opal.sh
(make-mu4e-context
:name "Ry P."
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/opal.sh" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "ry@opal.sh")
(user-full-name . "Ry P.")
(mu4e-drafts-folder . "/opal.sh/Drafts")
(mu4e-sent-folder . "/opal.sh/Sent")
(mu4e-trash-folder . "/opal.sh/Trash")))))
(setq mu4e-maildir-shortcuts
'(("/opal.sh/Inbox" . ?i)
("/opal.sh/Sent" . ?s)
("/opal.sh/Trash" . ?t)
("/opal.sh/Drafts" . ?d))))
;; (use-package erc
;; :straight t
;; (setq erc-server "irc.libera.chat" ;sets default server
;; erc-nick "opalvaults" ; Sets nick
;; erc-user-full-name "opalvaults"
;; erc-track-shorten-start 8
;; erc-kill-buffer-on-part t
;; erc-auto-query 'bury
;; erc-fill-column 90
;; erc-fill-function 'erc-fill-static
;; erc-fill-static-center 20
;; erc-track-visibility nil
;; erc-interpret-mirc-color t
;; erc-rename-buffers t
;; erc-track-exclude-server-buffer t))
#+end_src
** ERC (IRC)
#+begin_src emacs-lisp
(setq erc-server "irc.libera.chat" ;sets default server
erc-nick "opalvaults" ; Sets nick
erc-user-full-name "opalvaults"
erc-track-shorten-start 8
erc-kill-buffer-on-part t
erc-auto-query 'bury
erc-fill-column 90
erc-fill-function 'erc-fill-static
erc-fill-static-center 20
erc-track-visibility nil
erc-interpret-mirc-color t
erc-rename-buffers t
erc-track-exclude-server-buffer t)
#+end_src
#+RESULTS:
: t