feat[ALL] First commit
This commit is contained in:
commit
b04e50f694
702
config.el
Normal file
702
config.el
Normal file
@ -0,0 +1,702 @@
|
|||||||
|
(setq tab-always-indent t)
|
||||||
|
(setq org-roam-directory "~/org/")
|
||||||
|
|
||||||
|
(setq doom-theme 'doom-dark+)
|
||||||
|
(setq doom-font (font-spec :family "Hack Nerd Font Mono" :size 16 :weight 'medium))
|
||||||
|
(setq auto-save-default nil)
|
||||||
|
|
||||||
|
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-shortmenu)
|
||||||
|
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-footer)
|
||||||
|
|
||||||
|
(setq fancy-splash-image (concat doom-private-dir "emacs.png"))
|
||||||
|
|
||||||
|
(setq user-full-name "Judah Sotomayor"
|
||||||
|
user-mail-address "")
|
||||||
|
|
||||||
|
(map! :desc "Switch to normal mode" "M-c" #'evil-normal-state)
|
||||||
|
|
||||||
|
(setq org-pretty-entities 0)
|
||||||
|
|
||||||
|
(defun bash ()
|
||||||
|
(interactive)
|
||||||
|
(term "/bin/bash"))
|
||||||
|
(map!
|
||||||
|
:desc "Start a bash shell"
|
||||||
|
"<f6>" #'bash)
|
||||||
|
|
||||||
|
(add-hook 'term-mode-hook 'hide-mode-line-mode)
|
||||||
|
|
||||||
|
(use-package! sage-shell-mode
|
||||||
|
:defer)
|
||||||
|
|
||||||
|
;; Ob-sagemath supports only evaluating with a session.
|
||||||
|
(setq org-babel-default-header-args:sage '((:session . t)
|
||||||
|
(:results . "output")))
|
||||||
|
|
||||||
|
;; C-c c for asynchronous evaluating (only for SageMath code blocks).
|
||||||
|
(with-eval-after-load "org"
|
||||||
|
(define-key org-mode-map (kbd "C-c c") 'ob-sagemath-execute-async))
|
||||||
|
|
||||||
|
(map! :leader
|
||||||
|
:desc "The Emacs Calculator"
|
||||||
|
"C" #'calc)
|
||||||
|
|
||||||
|
(defun fava ()
|
||||||
|
(interactive)
|
||||||
|
(async-shell-command "flatpak run org.gnome.gitlab.johannesjh.favagtk"))
|
||||||
|
(map! :leader
|
||||||
|
:desc "Start favagtk"
|
||||||
|
"r b" #'fava)
|
||||||
|
|
||||||
|
(use-package! ob-mermaid)
|
||||||
|
|
||||||
|
(use-package! ob-svgbob)
|
||||||
|
(setq org-svgbob-executable "svgbob_cli")
|
||||||
|
|
||||||
|
(setq org-babel-svgbob--parameters
|
||||||
|
'(:background transparent
|
||||||
|
))
|
||||||
|
|
||||||
|
(defun current-date () (interactive)
|
||||||
|
(shell-command-to-string " bash -c 'echo -n $(date +%Y-%m-%d)'"))
|
||||||
|
(defun insert-current-date () (interactive)
|
||||||
|
(insert (current-date)))
|
||||||
|
|
||||||
|
(map! :leader
|
||||||
|
:desc "Insert the current date into the buffer"
|
||||||
|
"i d" #'insert-current-date)
|
||||||
|
|
||||||
|
(use-package! age
|
||||||
|
:ensure t
|
||||||
|
:demand t
|
||||||
|
:custom
|
||||||
|
(age-program "age")
|
||||||
|
(age-default-identity "~/.age/personal")
|
||||||
|
(age-default-recipient "~/.age/personal.pub")
|
||||||
|
:config
|
||||||
|
(age-file-enable))
|
||||||
|
|
||||||
|
(setq org-confirm-babel-evaluate t)
|
||||||
|
(setq org-link-shell-confirm-function t)
|
||||||
|
(setq org-link-elisp-confirm-function t)
|
||||||
|
(setq enable-local-variables t)
|
||||||
|
(setq enable-local-eval 'maybe)
|
||||||
|
|
||||||
|
(after! org-roam
|
||||||
|
(defun vulpea-project-p ()
|
||||||
|
"Return non-nil if current buffer has any todo entry.
|
||||||
|
TODO entries marked as done are ignored, meaning the this
|
||||||
|
function returns nil if current buffer contains only completed
|
||||||
|
tasks."
|
||||||
|
(seq-find ; (3)
|
||||||
|
(lambda (type)
|
||||||
|
(eq type 'todo))
|
||||||
|
(org-element-map ; (2)
|
||||||
|
(org-element-parse-buffer 'headline) ; (1)
|
||||||
|
'headline
|
||||||
|
(lambda (h)
|
||||||
|
(org-element-property :todo-type h)))))
|
||||||
|
|
||||||
|
(defun vulpea-project-update-tag ()
|
||||||
|
"Update PROJECT tag in the current buffer."
|
||||||
|
(when (and (not (active-minibuffer-window))
|
||||||
|
(vulpea-buffer-p))
|
||||||
|
(save-excursion
|
||||||
|
(goto-char (point-min))
|
||||||
|
(let* ((tags (vulpea-buffer-tags-get))
|
||||||
|
(original-tags tags))
|
||||||
|
(if (vulpea-project-p)
|
||||||
|
(setq tags (cons "hastodos" tags))
|
||||||
|
(setq tags (remove "hastodos" tags)))
|
||||||
|
|
||||||
|
;; cleanup duplicates
|
||||||
|
(setq tags (seq-uniq tags))
|
||||||
|
|
||||||
|
;; update tags if changed
|
||||||
|
(when (or (seq-difference tags original-tags)
|
||||||
|
(seq-difference original-tags tags))
|
||||||
|
(apply #'vulpea-buffer-tags-set tags))))))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-p ()
|
||||||
|
"Return non-nil if the currently visited buffer is a note."
|
||||||
|
(and buffer-file-name
|
||||||
|
(string-prefix-p
|
||||||
|
(expand-file-name (file-name-as-directory org-roam-directory))
|
||||||
|
(file-name-directory buffer-file-name))))
|
||||||
|
|
||||||
|
(defun vulpea-project-files ()
|
||||||
|
"Return a list of note files containing 'hastodos' tag." ;
|
||||||
|
(seq-uniq
|
||||||
|
(seq-map
|
||||||
|
#'car
|
||||||
|
(org-roam-db-query
|
||||||
|
[:select [nodes:file]
|
||||||
|
:from tags
|
||||||
|
:left-join nodes
|
||||||
|
:on (= tags:node-id nodes:id)
|
||||||
|
:where (like tag (quote "%\"hastodos\"%"))]))))
|
||||||
|
|
||||||
|
(defun vulpea-agenda-files-update (&rest _)
|
||||||
|
"Update the value of `org-agenda-files'."
|
||||||
|
(setq org-agenda-files (vulpea-project-files)))
|
||||||
|
|
||||||
|
(add-hook 'find-file-hook #'vulpea-project-update-tag)
|
||||||
|
(add-hook 'before-save-hook #'vulpea-project-update-tag)
|
||||||
|
|
||||||
|
(advice-add 'org-agenda :before #'vulpea-agenda-files-update)
|
||||||
|
(advice-add 'org-todo-list :before #'vulpea-agenda-files-update)
|
||||||
|
|
||||||
|
;; functions borrowed from `vulpea' library
|
||||||
|
;; https://github.com/d12frosted/vulpea/blob/6a735c34f1f64e1f70da77989e9ce8da7864e5ff/vulpea-buffer.el
|
||||||
|
|
||||||
|
(defun vulpea-buffer-tags-get ()
|
||||||
|
"Return filetags value in current buffer."
|
||||||
|
(vulpea-buffer-prop-get-list "filetags" "[ :]"))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-tags-set (&rest tags)
|
||||||
|
"Set TAGS in current buffer.
|
||||||
|
If filetags value is already set, replace it."
|
||||||
|
(if tags
|
||||||
|
(vulpea-buffer-prop-set
|
||||||
|
"filetags" (concat ":" (string-join tags ":") ":"))
|
||||||
|
(vulpea-buffer-prop-remove "filetags")))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-tags-add (tag)
|
||||||
|
"Add a TAG to filetags in current buffer."
|
||||||
|
(let* ((tags (vulpea-buffer-tags-get))
|
||||||
|
(tags (append tags (list tag))))
|
||||||
|
(apply #'vulpea-buffer-tags-set tags)))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-tags-remove (tag)
|
||||||
|
"Remove a TAG from filetags in current buffer."
|
||||||
|
(let* ((tags (vulpea-buffer-tags-get))
|
||||||
|
(tags (delete tag tags)))
|
||||||
|
(apply #'vulpea-buffer-tags-set tags)))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-prop-set (name value)
|
||||||
|
"Set a file property called NAME to VALUE in buffer file.
|
||||||
|
If the property is already set, replace its value."
|
||||||
|
(setq name (downcase name))
|
||||||
|
(org-with-point-at 1
|
||||||
|
(let ((case-fold-search t))
|
||||||
|
(if (re-search-forward (concat "^#\\+" name ":\\(.*\\)")
|
||||||
|
(point-max) t)
|
||||||
|
(replace-match (concat "#+" name ": " value) 'fixedcase)
|
||||||
|
(while (and (not (eobp))
|
||||||
|
(looking-at "^[#:]"))
|
||||||
|
(if (save-excursion (end-of-line) (eobp))
|
||||||
|
(progn
|
||||||
|
(end-of-line)
|
||||||
|
(insert "\n"))
|
||||||
|
(forward-line)
|
||||||
|
(beginning-of-line)))
|
||||||
|
(insert "#+" name ": " value "\n")))))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-prop-set-list (name values &optional separators)
|
||||||
|
"Set a file property called NAME to VALUES in current buffer.
|
||||||
|
VALUES are quoted and combined into single string using
|
||||||
|
`combine-and-quote-strings'.
|
||||||
|
If SEPARATORS is non-nil, it should be a regular expression
|
||||||
|
matching text that separates, but is not part of, the substrings.
|
||||||
|
If nil it defaults to `split-string-default-separators', normally
|
||||||
|
\"[ \f\t\n\r\v]+\", and OMIT-NULLS is forced to t.
|
||||||
|
If the property is already set, replace its value."
|
||||||
|
(vulpea-buffer-prop-set
|
||||||
|
name (combine-and-quote-strings values separators)))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-prop-get (name)
|
||||||
|
"Get a buffer property called NAME as a string."
|
||||||
|
(org-with-point-at 1
|
||||||
|
(when (re-search-forward (concat "^#\\+" name ": \\(.*\\)")
|
||||||
|
(point-max) t)
|
||||||
|
(buffer-substring-no-properties
|
||||||
|
(match-beginning 1)
|
||||||
|
(match-end 1)))))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-prop-get-list (name &optional separators)
|
||||||
|
"Get a buffer property NAME as a list using SEPARATORS.
|
||||||
|
If SEPARATORS is non-nil, it should be a regular expression
|
||||||
|
matching text that separates, but is not part of, the substrings.
|
||||||
|
If nil it defaults to `split-string-default-separators', normally
|
||||||
|
\"[ \f\t\n\r\v]+\", and OMIT-NULLS is forced to t."
|
||||||
|
(let ((value (vulpea-buffer-prop-get name)))
|
||||||
|
(when (and value (not (string-empty-p value)))
|
||||||
|
(split-string-and-unquote value separators))))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-prop-remove (name)
|
||||||
|
"Remove a buffer property called NAME."
|
||||||
|
(org-with-point-at 1
|
||||||
|
(when (re-search-forward (concat "\\(^#\\+" name ":.*\n?\\)")
|
||||||
|
(point-max) t)
|
||||||
|
(replace-match ""))))
|
||||||
|
|
||||||
|
(setq org-agenda-files (vulpea-project-files)))
|
||||||
|
|
||||||
|
(setq org-log-done 'time)
|
||||||
|
(after! org-mode
|
||||||
|
(setq org-log-done 'time)
|
||||||
|
(setq org-archive-location "~/org/archive.org")
|
||||||
|
(add-to-list 'org-tags-exclude-from-inheritance 'hastodos)
|
||||||
|
(setq org-hide-emphasis-markers nil))
|
||||||
|
|
||||||
|
(setq org-directory "~/org/")
|
||||||
|
(setq org-roam-directory org-directory)
|
||||||
|
(setq org-archive-location (concat org-directory "/archive.org::"))
|
||||||
|
|
||||||
|
(setq org-startup-with-inline-images t)
|
||||||
|
|
||||||
|
;; Show images after evaluating code blocks.
|
||||||
|
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images)
|
||||||
|
|
||||||
|
(after! org
|
||||||
|
;; Import ox-latex to get org-latex-classes and other funcitonality
|
||||||
|
;; for exporting to LaTeX from org
|
||||||
|
(use-package! ox-latex
|
||||||
|
:init
|
||||||
|
;; code here will run immediately
|
||||||
|
:config
|
||||||
|
;; code here will run after the package is loaded
|
||||||
|
(setq org-latex-pdf-process
|
||||||
|
'("pdflatex -interaction nonstopmode -output-directory %o %f"
|
||||||
|
"bibtex %b"
|
||||||
|
"pdflatex -interaction nonstopmode -output-directory %o %f"
|
||||||
|
"pdflatex -interaction nonstopmode -output-directory %o %f"))
|
||||||
|
(setq org-latex-with-hyperref nil) ;; stop org adding hypersetup{author..} to latex export
|
||||||
|
;; (setq org-latex-prefer-user-labels t)
|
||||||
|
|
||||||
|
;; deleted unwanted file extensions after latexMK
|
||||||
|
(setq org-latex-logfiles-extensions
|
||||||
|
(quote ("lof" "lot" "tex~" "aux" "idx" "log" "out" "toc" "nav" "snm" "vrb" "dvi" "fdb_latexmk" "blg" "brf" "fls" "entoc" "ps" "spl" "bbl" "xmpi" "run.xml" "bcf" "acn" "acr" "alg" "glg" "gls" "ist")))
|
||||||
|
|
||||||
|
(unless (boundp 'org-latex-classes)
|
||||||
|
(setq org-latex-classes nil))))
|
||||||
|
|
||||||
|
(setq org-latex-to-pdf-process
|
||||||
|
'("xelatex -interaction nonstopmode %f"
|
||||||
|
"xelatex -interaction nonstopmode %f")) ;; for multiple passes
|
||||||
|
|
||||||
|
(setq-default org-html-with-latex `dvisvgm)
|
||||||
|
(setq org-latex-pdf-process
|
||||||
|
'("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(unless (boundp 'org-latex-classes)
|
||||||
|
(setq org-latex-classes nil))
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("ethz"
|
||||||
|
"\\documentclass[a4paper,11pt,titlepage]{memoir}
|
||||||
|
\\usepackage[utf8]{inputenc}
|
||||||
|
\\usepackage[T1]{fontenc}
|
||||||
|
\\usepackage{fixltx2e}
|
||||||
|
\\usepackage{graphicx}
|
||||||
|
\\usepackage{longtable}
|
||||||
|
\\usepackage{float}
|
||||||
|
\\usepackage{wrapfig}
|
||||||
|
\\usepackage{rotating}
|
||||||
|
\\usepackage[normalem]{ulem}
|
||||||
|
\\usepackage{amsmath}
|
||||||
|
\\usepackage{textcomp}
|
||||||
|
\\usepackage{marvosym}
|
||||||
|
\\usepackage{wasysym}
|
||||||
|
\\usepackage{amssymb}
|
||||||
|
\\usepackage{hyperref}
|
||||||
|
\\usepackage{mathpazo}
|
||||||
|
\\usepackage{color}
|
||||||
|
\\usepackage{enumerate}
|
||||||
|
\\definecolor{bg}{rgb}{0.95,0.95,0.95}
|
||||||
|
\\tolerance=1000
|
||||||
|
[NO-DEFAULT-PACKAGES]
|
||||||
|
[PACKAGES]
|
||||||
|
[EXTRA]
|
||||||
|
\\linespread{1.1}
|
||||||
|
\\hypersetup{pdfborder=0 0 0}"
|
||||||
|
("\\chapter{%s}" . "\\chapter*{%s}")
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||||
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||||
|
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("article"
|
||||||
|
"\\documentclass[11pt,a4paper]{article}
|
||||||
|
\\usepackage[utf8]{inputenc}
|
||||||
|
\\usepackage[T1]{fontenc}
|
||||||
|
\\usepackage{fixltx2e}
|
||||||
|
\\usepackage{graphicx}
|
||||||
|
\\usepackage{longtable}
|
||||||
|
\\usepackage{float}
|
||||||
|
\\usepackage{wrapfig}
|
||||||
|
\\usepackage{rotating}
|
||||||
|
\\usepackage[normalem]{ulem}
|
||||||
|
\\usepackage{amsmath}
|
||||||
|
\\usepackage{textcomp}
|
||||||
|
\\usepackage{marvosym}
|
||||||
|
\\usepackage{wasysym}
|
||||||
|
\\usepackage{amssymb}
|
||||||
|
\\usepackage{hyperref}
|
||||||
|
\\usepackage{mathpazo}
|
||||||
|
\\usepackage{color}
|
||||||
|
\\usepackage{enumerate}
|
||||||
|
\\definecolor{bg}{rgb}{0.95,0.95,0.95}
|
||||||
|
\\tolerance=1000
|
||||||
|
[NO-DEFAULT-PACKAGES]
|
||||||
|
[PACKAGES]
|
||||||
|
[EXTRA]
|
||||||
|
\\linespread{1.1}
|
||||||
|
\\hypersetup{pdfborder=0 0 0}"
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")))
|
||||||
|
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes '("ebook"
|
||||||
|
"\\documentclass[11pt, oneside]{memoir}
|
||||||
|
\\setstocksize{9in}{6in}
|
||||||
|
\\settrimmedsize{\\stockheight}{\\stockwidth}{*}
|
||||||
|
\\setlrmarginsandblock{2cm}{2cm}{*} % Left and right margin
|
||||||
|
\\setulmarginsandblock{2cm}{2cm}{*} % Upper and lower margin
|
||||||
|
\\checkandfixthelayout
|
||||||
|
% Much more laTeX code omitted
|
||||||
|
"
|
||||||
|
("\\chapter{%s}" . "\\chapter*{%s}")
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")))
|
||||||
|
|
||||||
|
(defun +org-refresh-latex-images-previews-h ()
|
||||||
|
(dolist (buffer (doom-buffers-in-mode 'org-mode (buffer-list)))
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(+org--toggle-inline-images-in-subtree (point-min) (point-max) 'refresh)
|
||||||
|
(unless (eq org-latex-preview-default-process 'dvisvgm)
|
||||||
|
(org-clear-latex-preview (point-min) (point-max))
|
||||||
|
(org--latex-preview-region (point-min) (point-max))))))
|
||||||
|
|
||||||
|
(add-hook 'doom-load-theme-hook #'+org-refresh-latex-images-previews-h)
|
||||||
|
|
||||||
|
(defun eww-open-this-file ()
|
||||||
|
(set 'directory (file-name-directory buffer-file-name))
|
||||||
|
(set 'filename (file-name-sans-extension buffer-file-name))
|
||||||
|
(set 'extension ".html")
|
||||||
|
(set 'filename (format "%s%s" filename extension))
|
||||||
|
(eww-open-file filename)
|
||||||
|
(evil-window-left)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defun org-export-and-open-eww ()
|
||||||
|
"Export current file to html and open in eww"
|
||||||
|
(interactive)
|
||||||
|
|
||||||
|
(org-html-export-to-html)
|
||||||
|
(if (equal (file-name-extension buffer-file-name) "org")
|
||||||
|
(eww-open-this-file)
|
||||||
|
(message "Failed")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(map! :leader
|
||||||
|
:desc "Export to html and diplay with eww"
|
||||||
|
"r E" #'org-export-and-open-eww)
|
||||||
|
|
||||||
|
(use-package! org-drill
|
||||||
|
:defer nil
|
||||||
|
)
|
||||||
|
|
||||||
|
(map! :leader
|
||||||
|
:desc "Start org-drill"
|
||||||
|
"d d" #'org-drill-directory)
|
||||||
|
|
||||||
|
(map! :leader
|
||||||
|
:desc "Start org-drill in cram mode"
|
||||||
|
"d c" #'org-drill-cram)
|
||||||
|
|
||||||
|
(use-package! ob-lilypond)
|
||||||
|
(setq ly-arrange-mode t)
|
||||||
|
|
||||||
|
(use-package! org-edna)
|
||||||
|
(org-edna-mode)
|
||||||
|
|
||||||
|
(use-package org-habit
|
||||||
|
:custom
|
||||||
|
(org-habit-graph-column 1)
|
||||||
|
(org-habit-preceding-days 10)
|
||||||
|
(org-habit-following-days 1)
|
||||||
|
(org-habit-show-habits-only-for-today nil))
|
||||||
|
|
||||||
|
(use-package! org-heatmap
|
||||||
|
:after (org)
|
||||||
|
:config
|
||||||
|
(org-heatmap-mode))
|
||||||
|
|
||||||
|
(setq org-hugo-base-dir "~/org/website/")
|
||||||
|
|
||||||
|
(use-package! citar
|
||||||
|
:ensure t
|
||||||
|
:demand t
|
||||||
|
:custom
|
||||||
|
(citar-bibliography "~/org/references.bib")
|
||||||
|
(citar-file-note-extensions '(".org"))
|
||||||
|
(org-cite-global-bibliography '("~/org/references.bib"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(org-cite-csl-styles-dir
|
||||||
|
(expand-file-name "~/Zotero/styles/"))
|
||||||
|
(org-cite-export-processors
|
||||||
|
'((t . (csl "apa.csl")) ))
|
||||||
|
|
||||||
|
:hook
|
||||||
|
(LaTeX-mode . citar-capf-setup)
|
||||||
|
(org-mode . citar-capf-setup))
|
||||||
|
(after! org-mode
|
||||||
|
(org-cite-global-bibliography '("~/org/references.bib"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(citar-org-roam-mode)
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("student-apa7"
|
||||||
|
"\\documentclass[stu]{apa7}"
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||||
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("student-turabian"
|
||||||
|
"\\documentclass{turabian-researchpaper}"
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||||
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}")
|
||||||
|
("\\usepackage{biblatex-chicago}")))
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("student-mla"
|
||||||
|
"\\documentclass[stu]{mla}"
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||||
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||||
|
|
||||||
|
;; org-latex-compilers = ("pdflatex" "xelatex" "lualatex"), which are the possible values for %latex
|
||||||
|
(setq org-latex-pdf-process '("LC_ALL=en_US.UTF-8 latexmk -f -pdf -%latex -shell-escape -interaction=nonstopmode -output-directory=%o %f" ))
|
||||||
|
|
||||||
|
(use-package! engrave-faces)
|
||||||
|
(setq org-latex-listings 'engraved)
|
||||||
|
|
||||||
|
(use-package! org-roam
|
||||||
|
:after md-roam
|
||||||
|
:init (setq org-roam-directory "~/org/")) :custom
|
||||||
|
|
||||||
|
(after! org-roam
|
||||||
|
:ensure t
|
||||||
|
:custom
|
||||||
|
(setq org-roam-capture-templates
|
||||||
|
'(
|
||||||
|
("d" "default" plain "%?"
|
||||||
|
:target (file+head "%<%Y%m%d-%H%M%S>.org"
|
||||||
|
"#+TITLE: ${title}\n#+HTML_HEAD: <link rel=\"stylesheet\" type=\"text/css\" href=\"css/retro.css\" />\n")
|
||||||
|
:unnarrowed t)
|
||||||
|
|
||||||
|
("s" "school" plain "%?"
|
||||||
|
:target (file+head "%<%Y%m%d-%H%M%S>.org"
|
||||||
|
"#+TITLE: ${title}
|
||||||
|
#+LATEX_CLASS: student-apa7
|
||||||
|
#+LATEX_OPTIONS: stu,hidelinks
|
||||||
|
#+LATEX_HEADER: \\course{}
|
||||||
|
#+LATEX_HEADER:\\authorsnames{Judah Sotomayor}
|
||||||
|
#+LATEX_HEADER: \\authorsaffiliations{}
|
||||||
|
#+LATEX_HEADER: \\professor{}
|
||||||
|
#+LATEX_HEADER: \\usepackage{times}
|
||||||
|
#+LATEX_HEADER: \\duedate{}
|
||||||
|
#+OPTIONS: toc:nil\n")
|
||||||
|
:unnarrowed t)
|
||||||
|
|
||||||
|
("c" "encrypted" plain "%?"
|
||||||
|
:target (file+head "%<%Y%m%d-%H%M%S>.sec.org.age"
|
||||||
|
"#+TITLE: ${title}\n#+FILETAGS: :secure:noexport:\n#+HTML_HEAD: <link rel=\"stylesheet\" type=\"text/css\" href=\"css/retro.css\" />\n\n\n* No Export Below This Line")
|
||||||
|
:unnarrowed t)
|
||||||
|
|
||||||
|
("w" "website" plain "%?"
|
||||||
|
:target (file+head "website/org/%<%Y%m%d-%H%M%S>.org"
|
||||||
|
"#+TITLE: ${title}\n")
|
||||||
|
:unnarrowed t))))
|
||||||
|
|
||||||
|
(after! org-roam (map! :leader (:prefix ("r" . "roam")
|
||||||
|
|
||||||
|
:desc "Search for a node in org-roam files"
|
||||||
|
"f" #'org-roam-node-find
|
||||||
|
|
||||||
|
:desc "Insert the link to a node from org-roam"
|
||||||
|
"i" #'org-roam-node-insert
|
||||||
|
|
||||||
|
:desc "Rescan org-roam files and add new nodes to database"
|
||||||
|
"s" #'org-roam-db-sync
|
||||||
|
|
||||||
|
:desc "Jump to a random node"
|
||||||
|
"r" #'org-roam-node-random
|
||||||
|
|
||||||
|
:desc "Capture inside an existing or new node"
|
||||||
|
"c" #'org-roam-capture
|
||||||
|
|
||||||
|
:desc "Go to or create a daily note"
|
||||||
|
"d" #'org-roam-dailies-goto-today
|
||||||
|
|
||||||
|
:desc "Seek a daily note"
|
||||||
|
"D" #'org-roam-dailies-goto-date
|
||||||
|
|
||||||
|
:desc "Extract a subtree to a new file"
|
||||||
|
"e" #'org-roam-extract-subtree))
|
||||||
|
|
||||||
|
(map!
|
||||||
|
:desc "Alternative keybind to insert a roam link while in insert mode"
|
||||||
|
:i "M-[" #'org-roam-node-insert))
|
||||||
|
|
||||||
|
(use-package! websocket
|
||||||
|
:after org-roam)
|
||||||
|
|
||||||
|
(use-package! org-roam-ui
|
||||||
|
:after org-roam ;; or :after org
|
||||||
|
;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
|
||||||
|
;; a hookable mode anymore, you're advised to pick something yourself
|
||||||
|
;; if you don't care about startup time, use
|
||||||
|
;; :hook (after-init . org-roam-ui-mode)
|
||||||
|
:config
|
||||||
|
(setq org-roam-ui-sync-theme t
|
||||||
|
org-roam-ui-follow t
|
||||||
|
org-roam-ui-update-on-save t
|
||||||
|
org-roam-ui-open-on-start t))
|
||||||
|
|
||||||
|
(after! org-roam-ui (map! :leader (:prefix ("r" . "roam") (:prefix ("u" . "roam-ui")
|
||||||
|
|
||||||
|
:desc "Focus the current node in org-roam-ui view"
|
||||||
|
"f" #'org-roam-ui-node-zoom
|
||||||
|
|
||||||
|
:desc "Focus the current node's local graph in org-roam-ui view"
|
||||||
|
"l" #'org-roam-ui-node-local
|
||||||
|
|
||||||
|
:desc "Begin org-roam ui mode"
|
||||||
|
"u" #'open-org-roam-ui
|
||||||
|
|
||||||
|
))))
|
||||||
|
|
||||||
|
(defun open-org-roam-ui ()
|
||||||
|
(interactive)
|
||||||
|
(org-roam-ui-mode)
|
||||||
|
(async-shell-command "surf http://localhost:35901/"))
|
||||||
|
|
||||||
|
(setq browse-url-browser-function 'browse-url-generic
|
||||||
|
browse-url-generic-program "surf")
|
||||||
|
|
||||||
|
'(org-file-apps
|
||||||
|
(quote
|
||||||
|
((auto-mode . emacs)
|
||||||
|
("\\.mm\\'" . default)
|
||||||
|
("\\.x?html?\\'" . "surf %s")
|
||||||
|
("\\.pdf\\'" . default))))
|
||||||
|
|
||||||
|
(after! org-roam
|
||||||
|
(setq org-roam-dailies-capture-templates
|
||||||
|
`(("d" "default" entry
|
||||||
|
"* %?"
|
||||||
|
:target (file+head "%<%Y-%m-%d>.sec.org.age"
|
||||||
|
"#+title: %<%Y-%m-%d>\n")))))
|
||||||
|
|
||||||
|
(require 'cl-lib)
|
||||||
|
|
||||||
|
(defun org-global-props-key-re (key)
|
||||||
|
"Construct a regular expression matching key and an optional plus and eating the spaces behind.
|
||||||
|
Test for existence of the plus: (match-beginning 1)"
|
||||||
|
(concat "^" (regexp-quote key) "\\(\\+\\)?[[:space:]]+"))
|
||||||
|
|
||||||
|
(defun org-global-props (&optional buffer)
|
||||||
|
"Get the plists of global org properties of current buffer."
|
||||||
|
(with-current-buffer (or buffer (current-buffer))
|
||||||
|
(org-element-map (org-element-parse-buffer) 'keyword (lambda (el) (when (string-equal (org-element-property :key el) "PROPERTY") (nth 1 el))))))
|
||||||
|
|
||||||
|
(defun org-global-prop-value (key)
|
||||||
|
"Get global org property KEY of current buffer.
|
||||||
|
Adding up values for one key is supported."
|
||||||
|
(let ((key-re (org-global-props-key-re key))
|
||||||
|
(props (org-global-props))
|
||||||
|
ret)
|
||||||
|
(cl-loop with val for prop in props
|
||||||
|
when (string-match key-re (setq val (plist-get prop :value))) do
|
||||||
|
(setq
|
||||||
|
val (substring val (match-end 0))
|
||||||
|
ret (if (match-beginning 1)
|
||||||
|
(concat ret " " val)
|
||||||
|
val)))
|
||||||
|
ret))
|
||||||
|
|
||||||
|
(after! org
|
||||||
|
(use-package! ox-extra
|
||||||
|
:config
|
||||||
|
(ox-extras-activate '(latex-header-blocks ignore-headlines))))
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("altacv" "\\documentclass[10pt,a4paper,ragged2e,withhyper]{altacv}
|
||||||
|
\\usepackage[rm]{roboto}
|
||||||
|
\\usepackage[defaultsans]{lato}
|
||||||
|
\\usepackage{paracol}
|
||||||
|
[NO-DEFAULT-PACKAGES]
|
||||||
|
[NO-PACKAGES]
|
||||||
|
% Change the page layout if you need to
|
||||||
|
\\geometry{left=1.25cm,right=1.25cm,top=1.5cm,bottom=1.5cm,columnsep=1.2cm}
|
||||||
|
|
||||||
|
% Use roboto and lato for fonts
|
||||||
|
\\renewcommand{\\familydefault}{\\sfdefault}
|
||||||
|
|
||||||
|
% Change the colours if you want to
|
||||||
|
\\definecolor{SlateGrey}{HTML}{2E2E2E}
|
||||||
|
\\definecolor{LightGrey}{HTML}{666666}
|
||||||
|
\\definecolor{DarkPastelRed}{HTML}{450808}
|
||||||
|
\\definecolor{PastelRed}{HTML}{8F0D0D}
|
||||||
|
\\definecolor{GoldenEarth}{HTML}{E7D192}
|
||||||
|
|
||||||
|
\\colorlet{name}{black}
|
||||||
|
\\colorlet{tagline}{black}
|
||||||
|
\\colorlet{heading}{black}
|
||||||
|
\\colorlet{headingrule}{black}
|
||||||
|
\\colorlet{subheading}{black}
|
||||||
|
\\colorlet{accent}{black}
|
||||||
|
\\colorlet{emphasis}{SlateGrey}
|
||||||
|
\\colorlet{body}{LightGrey}
|
||||||
|
|
||||||
|
% Change some fonts, if necessary
|
||||||
|
\\renewcommand{\\namefont}{\\Huge\\rmfamily\\bfseries}
|
||||||
|
\\renewcommand{\\personalinfofont}{\\footnotesize}
|
||||||
|
\\renewcommand{\\cvsectionfont}{\\LARGE\\rmfamily\\bfseries}
|
||||||
|
\\renewcommand{\\cvsubsectionfont}{\\large\\bfseries}
|
||||||
|
|
||||||
|
% Change the bullets for itemize and rating marker
|
||||||
|
% for \cvskill if you want to
|
||||||
|
\\renewcommand{\\itemmarker}{{\\small\\textbullet}}
|
||||||
|
\\renewcommand{\\ratingmarker}{\\faCircle}
|
||||||
|
"
|
||||||
|
|
||||||
|
("\\cvsection{%s}" . "\\cvsection*{%s}")
|
||||||
|
("\\cvevent{%s}" . "\\cvevent*{%s}")))
|
||||||
|
|
||||||
|
(map! :n "g j" #'evil-next-visual-line)
|
||||||
|
(map! :n "g k" #'evil-previous-visual-line)
|
||||||
|
|
||||||
|
(after! company-mode
|
||||||
|
(setq company-idle-delay nil))
|
||||||
|
(setq company-idle-delay nil)
|
||||||
|
|
||||||
|
(require 'zmq)
|
||||||
|
|
||||||
|
(use-package! exec-path-from-shell)
|
||||||
|
(after! exec-path-from-shell
|
||||||
|
(dolist (var '("SSH_AUTH_SOCK" "SSH_AGENT_PID" "GPG_AGENT_INFO"))
|
||||||
|
(add-to-list 'exec-path-from-shell-variables var))
|
||||||
|
(exec-path-from-shell-initialize)
|
||||||
|
)
|
953
config.org
Normal file
953
config.org
Normal file
@ -0,0 +1,953 @@
|
|||||||
|
#+TITLE: Doom-emacs config
|
||||||
|
#+AUTHOR: Judah Sotomayor
|
||||||
|
#+STARTUP: overview
|
||||||
|
|
||||||
|
|
||||||
|
Welcome to my configuration!
|
||||||
|
I hope you enjoy your time here :)
|
||||||
|
It's not all very well documented, but I have done my best to split everything into a logical order.
|
||||||
|
Perhaps in 10 years I will still be using it, but who knows.
|
||||||
|
* Task List
|
||||||
|
** TODO Reorganize into use-cases rather than packages
|
||||||
|
* Setting Basics
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq tab-always-indent t)
|
||||||
|
(setq org-roam-directory "~/org/")
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
* Theme and Font
|
||||||
|
Set the theme.
|
||||||
|
/Use something dark/
|
||||||
|
+I also prefer relative line numbers because of *evil* mode+ Relative line numbers don't work, because of foling in Org-mode.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq doom-theme 'doom-dark+)
|
||||||
|
(setq doom-font (font-spec :family "Hack Nerd Font Mono" :size 16 :weight 'medium))
|
||||||
|
(setq auto-save-default nil)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** Doom splash screen
|
||||||
|
I really don't like the widgets, and I think it takes longer to load so I get rid of them
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-shortmenu)
|
||||||
|
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-footer)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
Set a sweet splash image
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq fancy-splash-image (concat doom-private-dir "emacs.png"))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
* User details
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq user-full-name "Judah Sotomayor"
|
||||||
|
user-mail-address "")
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
* Evil configuration
|
||||||
|
I want a non-ESC way to get back to normal mode:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(map! :desc "Switch to normal mode" "M-c" #'evil-normal-state)
|
||||||
|
#+END_SRC
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq org-pretty-entities 0)
|
||||||
|
#+END_SRC
|
||||||
|
* Terminal setup
|
||||||
|
I like to just use bash:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defun bash ()
|
||||||
|
(interactive)
|
||||||
|
(term "/bin/bash"))
|
||||||
|
(map!
|
||||||
|
:desc "Start a bash shell"
|
||||||
|
"<f6>" #'bash)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
I don't like the modeline in the terminal.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(add-hook 'term-mode-hook 'hide-mode-line-mode)
|
||||||
|
#+END_SRC
|
||||||
|
* Sage-math
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! sage-shell-mode
|
||||||
|
:defer)
|
||||||
|
|
||||||
|
;; Ob-sagemath supports only evaluating with a session.
|
||||||
|
(setq org-babel-default-header-args:sage '((:session . t)
|
||||||
|
(:results . "output")))
|
||||||
|
|
||||||
|
;; C-c c for asynchronous evaluating (only for SageMath code blocks).
|
||||||
|
(with-eval-after-load "org"
|
||||||
|
(define-key org-mode-map (kbd "C-c c") 'ob-sagemath-execute-async))
|
||||||
|
#+END_SRC
|
||||||
|
I like to have a shortcut for calc as well, for simpler calculations
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(map! :leader
|
||||||
|
:desc "The Emacs Calculator"
|
||||||
|
"C" #'calc)
|
||||||
|
#+END_SRC
|
||||||
|
* Beancount
|
||||||
|
I want to launch favagtk more easily. Let's do that here:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defun fava ()
|
||||||
|
(interactive)
|
||||||
|
(async-shell-command "flatpak run org.gnome.gitlab.johannesjh.favagtk"))
|
||||||
|
(map! :leader
|
||||||
|
:desc "Start favagtk"
|
||||||
|
"r b" #'fava)
|
||||||
|
#+END_SRC
|
||||||
|
* Graphing Applications
|
||||||
|
** Mermaid.js
|
||||||
|
Mermaid.js requires the mmcli executable from npm.
|
||||||
|
Mermaid is a tool that allows you to graph many kinds of entities:
|
||||||
|
- Relationship diagrams
|
||||||
|
- Flowcharts
|
||||||
|
- Gantt diagrams
|
||||||
|
There's other kinds too.
|
||||||
|
The package on ELPA is perfect. Needs no config, fits right in with Babel.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! ob-mermaid)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** SVGBob
|
||||||
|
SVGBob is an ASCII art renderer. It can do all kinds of nifty things with just a few basic .------./\
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! ob-svgbob)
|
||||||
|
(setq org-svgbob-executable "svgbob_cli")
|
||||||
|
|
||||||
|
(setq org-babel-svgbob--parameters
|
||||||
|
'(:background transparent
|
||||||
|
))
|
||||||
|
#+END_SRC
|
||||||
|
* Fun Stuff
|
||||||
|
* Useful Functions
|
||||||
|
** Get the date from the shell
|
||||||
|
I want to grab the current date and put it in the buffer.
|
||||||
|
Because I sometimes use Fish or another shell, it's good to make sure bash is running the command using the src_bash{`-c`} flag.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defun current-date () (interactive)
|
||||||
|
(shell-command-to-string " bash -c 'echo -n $(date +%Y-%m-%d)'"))
|
||||||
|
(defun insert-current-date () (interactive)
|
||||||
|
(insert (current-date)))
|
||||||
|
|
||||||
|
(map! :leader
|
||||||
|
:desc "Insert the current date into the buffer"
|
||||||
|
"i d" #'insert-current-date)
|
||||||
|
#+END_SRC
|
||||||
|
* Creating Diagrams and graphs
|
||||||
|
** TODO set default values using org-babel's features for that.
|
||||||
|
|
||||||
|
* Securing Sensitive Files
|
||||||
|
** Age.el
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! age
|
||||||
|
:ensure t
|
||||||
|
:demand t
|
||||||
|
:custom
|
||||||
|
(age-program "age")
|
||||||
|
(age-default-identity "~/.age/personal")
|
||||||
|
(age-default-recipient "~/.age/personal.pub")
|
||||||
|
:config
|
||||||
|
(age-file-enable))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** Org-mode security settings
|
||||||
|
These mostly concern limiting evaluation of code-blocks without confirmation.
|
||||||
|
The final two lines concern local variables, which may try to evaluate code.
|
||||||
|
|
||||||
|
Emacs has better default values now, so it will ask to evaluate local variables.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq org-confirm-babel-evaluate t)
|
||||||
|
(setq org-link-shell-confirm-function t)
|
||||||
|
(setq org-link-elisp-confirm-function t)
|
||||||
|
(setq enable-local-variables t)
|
||||||
|
(setq enable-local-eval 'maybe)
|
||||||
|
#+END_SRC
|
||||||
|
* Org-mode for a great todo list
|
||||||
|
** Making the Agenda features more efficient
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
|
(dolist (file (org-roam-list-files))
|
||||||
|
(message "processing %s" file)
|
||||||
|
(with-current-buffer (or (find-buffer-visiting file)
|
||||||
|
(find-file-noselect file))
|
||||||
|
(vulpea-project-update-tag)
|
||||||
|
(save-buffer)))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+RESULTS:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Only include files with the hastodos tag.
|
||||||
|
This section is contributed from [[https://gist.github.com/d12frosted/a60e8ccb9aceba031af243dff0d19b2e][d12frosted]] and use his vulpea.el package's functions.
|
||||||
|
I ripped out the essentials because I don't want all the other stuff in that package.
|
||||||
|
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(after! org-roam
|
||||||
|
(defun vulpea-project-p ()
|
||||||
|
"Return non-nil if current buffer has any todo entry.
|
||||||
|
TODO entries marked as done are ignored, meaning the this
|
||||||
|
function returns nil if current buffer contains only completed
|
||||||
|
tasks."
|
||||||
|
(seq-find ; (3)
|
||||||
|
(lambda (type)
|
||||||
|
(eq type 'todo))
|
||||||
|
(org-element-map ; (2)
|
||||||
|
(org-element-parse-buffer 'headline) ; (1)
|
||||||
|
'headline
|
||||||
|
(lambda (h)
|
||||||
|
(org-element-property :todo-type h)))))
|
||||||
|
|
||||||
|
(defun vulpea-project-update-tag ()
|
||||||
|
"Update PROJECT tag in the current buffer."
|
||||||
|
(when (and (not (active-minibuffer-window))
|
||||||
|
(vulpea-buffer-p))
|
||||||
|
(save-excursion
|
||||||
|
(goto-char (point-min))
|
||||||
|
(let* ((tags (vulpea-buffer-tags-get))
|
||||||
|
(original-tags tags))
|
||||||
|
(if (vulpea-project-p)
|
||||||
|
(setq tags (cons "hastodos" tags))
|
||||||
|
(setq tags (remove "hastodos" tags)))
|
||||||
|
|
||||||
|
;; cleanup duplicates
|
||||||
|
(setq tags (seq-uniq tags))
|
||||||
|
|
||||||
|
;; update tags if changed
|
||||||
|
(when (or (seq-difference tags original-tags)
|
||||||
|
(seq-difference original-tags tags))
|
||||||
|
(apply #'vulpea-buffer-tags-set tags))))))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-p ()
|
||||||
|
"Return non-nil if the currently visited buffer is a note."
|
||||||
|
(and buffer-file-name
|
||||||
|
(string-prefix-p
|
||||||
|
(expand-file-name (file-name-as-directory org-roam-directory))
|
||||||
|
(file-name-directory buffer-file-name))))
|
||||||
|
|
||||||
|
(defun vulpea-project-files ()
|
||||||
|
"Return a list of note files containing 'hastodos' tag." ;
|
||||||
|
(seq-uniq
|
||||||
|
(seq-map
|
||||||
|
#'car
|
||||||
|
(org-roam-db-query
|
||||||
|
[:select [nodes:file]
|
||||||
|
:from tags
|
||||||
|
:left-join nodes
|
||||||
|
:on (= tags:node-id nodes:id)
|
||||||
|
:where (like tag (quote "%\"hastodos\"%"))]))))
|
||||||
|
|
||||||
|
(defun vulpea-agenda-files-update (&rest _)
|
||||||
|
"Update the value of `org-agenda-files'."
|
||||||
|
(setq org-agenda-files (vulpea-project-files)))
|
||||||
|
|
||||||
|
(add-hook 'find-file-hook #'vulpea-project-update-tag)
|
||||||
|
(add-hook 'before-save-hook #'vulpea-project-update-tag)
|
||||||
|
|
||||||
|
(advice-add 'org-agenda :before #'vulpea-agenda-files-update)
|
||||||
|
(advice-add 'org-todo-list :before #'vulpea-agenda-files-update)
|
||||||
|
|
||||||
|
;; functions borrowed from `vulpea' library
|
||||||
|
;; https://github.com/d12frosted/vulpea/blob/6a735c34f1f64e1f70da77989e9ce8da7864e5ff/vulpea-buffer.el
|
||||||
|
|
||||||
|
(defun vulpea-buffer-tags-get ()
|
||||||
|
"Return filetags value in current buffer."
|
||||||
|
(vulpea-buffer-prop-get-list "filetags" "[ :]"))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-tags-set (&rest tags)
|
||||||
|
"Set TAGS in current buffer.
|
||||||
|
If filetags value is already set, replace it."
|
||||||
|
(if tags
|
||||||
|
(vulpea-buffer-prop-set
|
||||||
|
"filetags" (concat ":" (string-join tags ":") ":"))
|
||||||
|
(vulpea-buffer-prop-remove "filetags")))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-tags-add (tag)
|
||||||
|
"Add a TAG to filetags in current buffer."
|
||||||
|
(let* ((tags (vulpea-buffer-tags-get))
|
||||||
|
(tags (append tags (list tag))))
|
||||||
|
(apply #'vulpea-buffer-tags-set tags)))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-tags-remove (tag)
|
||||||
|
"Remove a TAG from filetags in current buffer."
|
||||||
|
(let* ((tags (vulpea-buffer-tags-get))
|
||||||
|
(tags (delete tag tags)))
|
||||||
|
(apply #'vulpea-buffer-tags-set tags)))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-prop-set (name value)
|
||||||
|
"Set a file property called NAME to VALUE in buffer file.
|
||||||
|
If the property is already set, replace its value."
|
||||||
|
(setq name (downcase name))
|
||||||
|
(org-with-point-at 1
|
||||||
|
(let ((case-fold-search t))
|
||||||
|
(if (re-search-forward (concat "^#\\+" name ":\\(.*\\)")
|
||||||
|
(point-max) t)
|
||||||
|
(replace-match (concat "#+" name ": " value) 'fixedcase)
|
||||||
|
(while (and (not (eobp))
|
||||||
|
(looking-at "^[#:]"))
|
||||||
|
(if (save-excursion (end-of-line) (eobp))
|
||||||
|
(progn
|
||||||
|
(end-of-line)
|
||||||
|
(insert "\n"))
|
||||||
|
(forward-line)
|
||||||
|
(beginning-of-line)))
|
||||||
|
(insert "#+" name ": " value "\n")))))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-prop-set-list (name values &optional separators)
|
||||||
|
"Set a file property called NAME to VALUES in current buffer.
|
||||||
|
VALUES are quoted and combined into single string using
|
||||||
|
`combine-and-quote-strings'.
|
||||||
|
If SEPARATORS is non-nil, it should be a regular expression
|
||||||
|
matching text that separates, but is not part of, the substrings.
|
||||||
|
If nil it defaults to `split-string-default-separators', normally
|
||||||
|
\"[ \f\t\n\r\v]+\", and OMIT-NULLS is forced to t.
|
||||||
|
If the property is already set, replace its value."
|
||||||
|
(vulpea-buffer-prop-set
|
||||||
|
name (combine-and-quote-strings values separators)))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-prop-get (name)
|
||||||
|
"Get a buffer property called NAME as a string."
|
||||||
|
(org-with-point-at 1
|
||||||
|
(when (re-search-forward (concat "^#\\+" name ": \\(.*\\)")
|
||||||
|
(point-max) t)
|
||||||
|
(buffer-substring-no-properties
|
||||||
|
(match-beginning 1)
|
||||||
|
(match-end 1)))))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-prop-get-list (name &optional separators)
|
||||||
|
"Get a buffer property NAME as a list using SEPARATORS.
|
||||||
|
If SEPARATORS is non-nil, it should be a regular expression
|
||||||
|
matching text that separates, but is not part of, the substrings.
|
||||||
|
If nil it defaults to `split-string-default-separators', normally
|
||||||
|
\"[ \f\t\n\r\v]+\", and OMIT-NULLS is forced to t."
|
||||||
|
(let ((value (vulpea-buffer-prop-get name)))
|
||||||
|
(when (and value (not (string-empty-p value)))
|
||||||
|
(split-string-and-unquote value separators))))
|
||||||
|
|
||||||
|
(defun vulpea-buffer-prop-remove (name)
|
||||||
|
"Remove a buffer property called NAME."
|
||||||
|
(org-with-point-at 1
|
||||||
|
(when (re-search-forward (concat "\\(^#\\+" name ":.*\n?\\)")
|
||||||
|
(point-max) t)
|
||||||
|
(replace-match ""))))
|
||||||
|
|
||||||
|
(setq org-agenda-files (vulpea-project-files)))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** Basic settings
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq org-log-done 'time)
|
||||||
|
(after! org-mode
|
||||||
|
(setq org-log-done 'time)
|
||||||
|
(setq org-archive-location "~/org/archive.org")
|
||||||
|
(add-to-list 'org-tags-exclude-from-inheritance 'hastodos)
|
||||||
|
(setq org-hide-emphasis-markers nil))
|
||||||
|
|
||||||
|
(setq org-directory "~/org/")
|
||||||
|
(setq org-roam-directory org-directory)
|
||||||
|
(setq org-archive-location (concat org-directory "/archive.org::"))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** Appearances
|
||||||
|
*** Deprecated: TODO Keywords
|
||||||
|
I like to have a few different todo keywords for different sorts of activities.
|
||||||
|
Purchasing todos:
|
||||||
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
|
|
||||||
|
(setq org-todo-keywords
|
||||||
|
'((sequence "PROJ(p)" "|" "COMPLETE")
|
||||||
|
(type "TICKLE")
|
||||||
|
(type "DELE")
|
||||||
|
(type "WAIT")
|
||||||
|
(sequence "TODO(t)" "|" "DONE")
|
||||||
|
(sequence "DELEGATED" "VERIFY" "|" "DONE")
|
||||||
|
(sequence "BUY(b)" "|" "BOUGHT")
|
||||||
|
))
|
||||||
|
(setq org-todo-keyword-faces
|
||||||
|
'(("TODO" . "salmon1")
|
||||||
|
("START" . "spring green" )
|
||||||
|
("DELE" . "gold")
|
||||||
|
("TICKLE" . "magenta")
|
||||||
|
("WAIT" . "gold")
|
||||||
|
("PROJ" . "deep sky blue")))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
These settings aren't very useful for me, as I like default colors and keywords.
|
||||||
|
*** Deprecated: Settings for org-modern
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
|
(setq org-modern-todo-faces
|
||||||
|
'(("START" :background "spring green" :foreground "black")
|
||||||
|
("DELE" :background "gold" :foreground "black")
|
||||||
|
("WAIT" :background "gold" :foreground "black")
|
||||||
|
("PROJ" :background "deep sky blue" :foreground "black")
|
||||||
|
("TICKLE" :background "magenta" :foreground "black")))
|
||||||
|
|
||||||
|
(setq org-modern-priority-faces
|
||||||
|
'((?A :background "salmon1" :foreground "black")
|
||||||
|
(?B :background "gold" :foreground "black")
|
||||||
|
(?C :background "spring green" :foreground "black")))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
I currently have org-modern stripped out of my config.
|
||||||
|
I probably won't need this again, but in case I do I want all my preferences to be there.
|
||||||
|
*** Images Preferences
|
||||||
|
We want to show images when loading a file, and also after evaluating code blocks.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq org-startup-with-inline-images t)
|
||||||
|
|
||||||
|
;; Show images after evaluating code blocks.
|
||||||
|
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images)
|
||||||
|
#+END_SRC
|
||||||
|
** Export settings
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(after! org
|
||||||
|
;; Import ox-latex to get org-latex-classes and other funcitonality
|
||||||
|
;; for exporting to LaTeX from org
|
||||||
|
(use-package! ox-latex
|
||||||
|
:init
|
||||||
|
;; code here will run immediately
|
||||||
|
:config
|
||||||
|
;; code here will run after the package is loaded
|
||||||
|
(setq org-latex-pdf-process
|
||||||
|
'("pdflatex -interaction nonstopmode -output-directory %o %f"
|
||||||
|
"bibtex %b"
|
||||||
|
"pdflatex -interaction nonstopmode -output-directory %o %f"
|
||||||
|
"pdflatex -interaction nonstopmode -output-directory %o %f"))
|
||||||
|
(setq org-latex-with-hyperref nil) ;; stop org adding hypersetup{author..} to latex export
|
||||||
|
;; (setq org-latex-prefer-user-labels t)
|
||||||
|
|
||||||
|
;; deleted unwanted file extensions after latexMK
|
||||||
|
(setq org-latex-logfiles-extensions
|
||||||
|
(quote ("lof" "lot" "tex~" "aux" "idx" "log" "out" "toc" "nav" "snm" "vrb" "dvi" "fdb_latexmk" "blg" "brf" "fls" "entoc" "ps" "spl" "bbl" "xmpi" "run.xml" "bcf" "acn" "acr" "alg" "glg" "gls" "ist")))
|
||||||
|
|
||||||
|
(unless (boundp 'org-latex-classes)
|
||||||
|
(setq org-latex-classes nil))))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq org-latex-to-pdf-process
|
||||||
|
'("xelatex -interaction nonstopmode %f"
|
||||||
|
"xelatex -interaction nonstopmode %f")) ;; for multiple passes
|
||||||
|
|
||||||
|
(setq-default org-html-with-latex `dvisvgm)
|
||||||
|
(setq org-latex-pdf-process
|
||||||
|
'("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(unless (boundp 'org-latex-classes)
|
||||||
|
(setq org-latex-classes nil))
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("ethz"
|
||||||
|
"\\documentclass[a4paper,11pt,titlepage]{memoir}
|
||||||
|
\\usepackage[utf8]{inputenc}
|
||||||
|
\\usepackage[T1]{fontenc}
|
||||||
|
\\usepackage{fixltx2e}
|
||||||
|
\\usepackage{graphicx}
|
||||||
|
\\usepackage{longtable}
|
||||||
|
\\usepackage{float}
|
||||||
|
\\usepackage{wrapfig}
|
||||||
|
\\usepackage{rotating}
|
||||||
|
\\usepackage[normalem]{ulem}
|
||||||
|
\\usepackage{amsmath}
|
||||||
|
\\usepackage{textcomp}
|
||||||
|
\\usepackage{marvosym}
|
||||||
|
\\usepackage{wasysym}
|
||||||
|
\\usepackage{amssymb}
|
||||||
|
\\usepackage{hyperref}
|
||||||
|
\\usepackage{mathpazo}
|
||||||
|
\\usepackage{color}
|
||||||
|
\\usepackage{enumerate}
|
||||||
|
\\definecolor{bg}{rgb}{0.95,0.95,0.95}
|
||||||
|
\\tolerance=1000
|
||||||
|
[NO-DEFAULT-PACKAGES]
|
||||||
|
[PACKAGES]
|
||||||
|
[EXTRA]
|
||||||
|
\\linespread{1.1}
|
||||||
|
\\hypersetup{pdfborder=0 0 0}"
|
||||||
|
("\\chapter{%s}" . "\\chapter*{%s}")
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||||
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||||
|
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("article"
|
||||||
|
"\\documentclass[11pt,a4paper]{article}
|
||||||
|
\\usepackage[utf8]{inputenc}
|
||||||
|
\\usepackage[T1]{fontenc}
|
||||||
|
\\usepackage{fixltx2e}
|
||||||
|
\\usepackage{graphicx}
|
||||||
|
\\usepackage{longtable}
|
||||||
|
\\usepackage{float}
|
||||||
|
\\usepackage{wrapfig}
|
||||||
|
\\usepackage{rotating}
|
||||||
|
\\usepackage[normalem]{ulem}
|
||||||
|
\\usepackage{amsmath}
|
||||||
|
\\usepackage{textcomp}
|
||||||
|
\\usepackage{marvosym}
|
||||||
|
\\usepackage{wasysym}
|
||||||
|
\\usepackage{amssymb}
|
||||||
|
\\usepackage{hyperref}
|
||||||
|
\\usepackage{mathpazo}
|
||||||
|
\\usepackage{color}
|
||||||
|
\\usepackage{enumerate}
|
||||||
|
\\definecolor{bg}{rgb}{0.95,0.95,0.95}
|
||||||
|
\\tolerance=1000
|
||||||
|
[NO-DEFAULT-PACKAGES]
|
||||||
|
[PACKAGES]
|
||||||
|
[EXTRA]
|
||||||
|
\\linespread{1.1}
|
||||||
|
\\hypersetup{pdfborder=0 0 0}"
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")))
|
||||||
|
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes '("ebook"
|
||||||
|
"\\documentclass[11pt, oneside]{memoir}
|
||||||
|
\\setstocksize{9in}{6in}
|
||||||
|
\\settrimmedsize{\\stockheight}{\\stockwidth}{*}
|
||||||
|
\\setlrmarginsandblock{2cm}{2cm}{*} % Left and right margin
|
||||||
|
\\setulmarginsandblock{2cm}{2cm}{*} % Upper and lower margin
|
||||||
|
\\checkandfixthelayout
|
||||||
|
% Much more laTeX code omitted
|
||||||
|
"
|
||||||
|
("\\chapter{%s}" . "\\chapter*{%s}")
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
*** Fixing dvipng image handling
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(defun +org-refresh-latex-images-previews-h ()
|
||||||
|
(dolist (buffer (doom-buffers-in-mode 'org-mode (buffer-list)))
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(+org--toggle-inline-images-in-subtree (point-min) (point-max) 'refresh)
|
||||||
|
(unless (eq org-latex-preview-default-process 'dvisvgm)
|
||||||
|
(org-clear-latex-preview (point-min) (point-max))
|
||||||
|
(org--latex-preview-region (point-min) (point-max))))))
|
||||||
|
|
||||||
|
(add-hook 'doom-load-theme-hook #'+org-refresh-latex-images-previews-h)
|
||||||
|
#+END_SRC
|
||||||
|
*** Export Function
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defun eww-open-this-file ()
|
||||||
|
(set 'directory (file-name-directory buffer-file-name))
|
||||||
|
(set 'filename (file-name-sans-extension buffer-file-name))
|
||||||
|
(set 'extension ".html")
|
||||||
|
(set 'filename (format "%s%s" filename extension))
|
||||||
|
(eww-open-file filename)
|
||||||
|
(evil-window-left)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defun org-export-and-open-eww ()
|
||||||
|
"Export current file to html and open in eww"
|
||||||
|
(interactive)
|
||||||
|
|
||||||
|
(org-html-export-to-html)
|
||||||
|
(if (equal (file-name-extension buffer-file-name) "org")
|
||||||
|
(eww-open-this-file)
|
||||||
|
(message "Failed")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
We'll want a handy shortcut for this.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(map! :leader
|
||||||
|
:desc "Export to html and diplay with eww"
|
||||||
|
"r E" #'org-export-and-open-eww)
|
||||||
|
#+END_SRC
|
||||||
|
#+RESULTS:
|
||||||
|
: /home/user/.config/doom/
|
||||||
|
|
||||||
|
** Org-drill
|
||||||
|
Set some good keybinds for quick access:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! org-drill
|
||||||
|
:defer nil
|
||||||
|
)
|
||||||
|
|
||||||
|
(map! :leader
|
||||||
|
:desc "Start org-drill"
|
||||||
|
"d d" #'org-drill-directory)
|
||||||
|
|
||||||
|
(map! :leader
|
||||||
|
:desc "Start org-drill in cram mode"
|
||||||
|
"d c" #'org-drill-cram)
|
||||||
|
#+END_SRC
|
||||||
|
** ob-lilypond
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! ob-lilypond)
|
||||||
|
(setq ly-arrange-mode t)
|
||||||
|
#+END_SRC
|
||||||
|
** org-edna
|
||||||
|
Edna allows better dependency handling for todos and the like.
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! org-edna)
|
||||||
|
(org-edna-mode)
|
||||||
|
#+END_SRC
|
||||||
|
** Org-habit
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
|
(use-package org-habit
|
||||||
|
:custom
|
||||||
|
(org-habit-graph-column 1)
|
||||||
|
(org-habit-preceding-days 10)
|
||||||
|
(org-habit-following-days 1)
|
||||||
|
(org-habit-show-habits-only-for-today nil))
|
||||||
|
|
||||||
|
(use-package! org-heatmap
|
||||||
|
:after (org)
|
||||||
|
:config
|
||||||
|
(org-heatmap-mode))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* Ox-hugo
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq org-hugo-base-dir "~/org/website/")
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
* Crafting a Writing Environment
|
||||||
|
For writing I like to automate as much as possible.
|
||||||
|
This means creating an environment that does citations and such /for/ me.
|
||||||
|
** Automatic Citations with *citar* and *org-cite*
|
||||||
|
Citar is a sweet little package for managing citations. Right here we'll set it up
|
||||||
|
We want a general bibliography file, a styles directory, and a default set of styles.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! citar
|
||||||
|
:ensure t
|
||||||
|
:demand t
|
||||||
|
:custom
|
||||||
|
(citar-bibliography "~/org/references.bib")
|
||||||
|
(citar-file-note-extensions '(".org"))
|
||||||
|
(org-cite-global-bibliography '("~/org/references.bib"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(org-cite-csl-styles-dir
|
||||||
|
(expand-file-name "~/Zotero/styles/"))
|
||||||
|
(org-cite-export-processors
|
||||||
|
'((t . (csl "apa.csl")) ))
|
||||||
|
|
||||||
|
:hook
|
||||||
|
(LaTeX-mode . citar-capf-setup)
|
||||||
|
(org-mode . citar-capf-setup))
|
||||||
|
(after! org-mode
|
||||||
|
(org-cite-global-bibliography '("~/org/references.bib"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(citar-org-roam-mode)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** Scholarly Writing Environment with Org-mode
|
||||||
|
I like to keep formatting simple.
|
||||||
|
Let's use a package or two to set a decent document class:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("student-apa7"
|
||||||
|
"\\documentclass[stu]{apa7}"
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||||
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("student-turabian"
|
||||||
|
"\\documentclass{turabian-researchpaper}"
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||||
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}")
|
||||||
|
("\\usepackage{biblatex-chicago}")))
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("student-mla"
|
||||||
|
"\\documentclass[stu]{mla}"
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||||
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||||
|
|
||||||
|
;; org-latex-compilers = ("pdflatex" "xelatex" "lualatex"), which are the possible values for %latex
|
||||||
|
(setq org-latex-pdf-process '("LC_ALL=en_US.UTF-8 latexmk -f -pdf -%latex -shell-escape -interaction=nonstopmode -output-directory=%o %f" ))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
*** Engraving Faces
|
||||||
|
Ever wonder why code export sucks with \latex ? Me neither! Let's fix it!
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! engrave-faces)
|
||||||
|
(setq org-latex-listings 'engraved)
|
||||||
|
#+END_SRC
|
||||||
|
** Zettelkasten environment with org-roam
|
||||||
|
Org-roam enables features essential to a Zettelkasten such as inter-ID linking.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! org-roam
|
||||||
|
:after md-roam
|
||||||
|
:init (setq org-roam-directory "~/org/")) :custom
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(after! org-roam
|
||||||
|
:ensure t
|
||||||
|
:custom
|
||||||
|
(setq org-roam-capture-templates
|
||||||
|
'(
|
||||||
|
("d" "default" plain "%?"
|
||||||
|
:target (file+head "%<%Y%m%d-%H%M%S>.org"
|
||||||
|
"#+TITLE: ${title}\n#+HTML_HEAD: <link rel=\"stylesheet\" type=\"text/css\" href=\"css/retro.css\" />\n")
|
||||||
|
:unnarrowed t)
|
||||||
|
|
||||||
|
("s" "school" plain "%?"
|
||||||
|
:target (file+head "%<%Y%m%d-%H%M%S>.org"
|
||||||
|
"#+TITLE: ${title}
|
||||||
|
#+LATEX_CLASS: student-apa7
|
||||||
|
#+LATEX_OPTIONS: stu,hidelinks
|
||||||
|
#+LATEX_HEADER: \\course{}
|
||||||
|
#+LATEX_HEADER:\\authorsnames{Judah Sotomayor}
|
||||||
|
#+LATEX_HEADER: \\authorsaffiliations{}
|
||||||
|
#+LATEX_HEADER: \\professor{}
|
||||||
|
#+LATEX_HEADER: \\usepackage{times}
|
||||||
|
#+LATEX_HEADER: \\duedate{}
|
||||||
|
#+OPTIONS: toc:nil\n")
|
||||||
|
:unnarrowed t)
|
||||||
|
|
||||||
|
("c" "encrypted" plain "%?"
|
||||||
|
:target (file+head "%<%Y%m%d-%H%M%S>.sec.org.age"
|
||||||
|
"#+TITLE: ${title}\n#+FILETAGS: :secure:noexport:\n#+HTML_HEAD: <link rel=\"stylesheet\" type=\"text/css\" href=\"css/retro.css\" />\n\n\n* No Export Below This Line")
|
||||||
|
:unnarrowed t)
|
||||||
|
|
||||||
|
("w" "website" plain "%?"
|
||||||
|
:target (file+head "website/org/%<%Y%m%d-%H%M%S>.org"
|
||||||
|
"#+TITLE: ${title}\n")
|
||||||
|
:unnarrowed t))))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
*** Keybinds
|
||||||
|
Org-roam has many commands, of which I have bound the most important below.
|
||||||
|
This entails creating a local leader.
|
||||||
|
I use =r= for this purpose. It is close and goes well with *roam*.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(after! org-roam (map! :leader (:prefix ("r" . "roam")
|
||||||
|
|
||||||
|
:desc "Search for a node in org-roam files"
|
||||||
|
"f" #'org-roam-node-find
|
||||||
|
|
||||||
|
:desc "Insert the link to a node from org-roam"
|
||||||
|
"i" #'org-roam-node-insert
|
||||||
|
|
||||||
|
:desc "Rescan org-roam files and add new nodes to database"
|
||||||
|
"s" #'org-roam-db-sync
|
||||||
|
|
||||||
|
:desc "Jump to a random node"
|
||||||
|
"r" #'org-roam-node-random
|
||||||
|
|
||||||
|
:desc "Capture inside an existing or new node"
|
||||||
|
"c" #'org-roam-capture
|
||||||
|
|
||||||
|
:desc "Go to or create a daily note"
|
||||||
|
"d" #'org-roam-dailies-goto-today
|
||||||
|
|
||||||
|
:desc "Seek a daily note"
|
||||||
|
"D" #'org-roam-dailies-goto-date
|
||||||
|
|
||||||
|
:desc "Extract a subtree to a new file"
|
||||||
|
"e" #'org-roam-extract-subtree))
|
||||||
|
|
||||||
|
(map!
|
||||||
|
:desc "Alternative keybind to insert a roam link while in insert mode"
|
||||||
|
:i "M-[" #'org-roam-node-insert))
|
||||||
|
#+END_SRC
|
||||||
|
*** Nice UI to access Zettelkasten notes with Org-roam ui
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! websocket
|
||||||
|
:after org-roam)
|
||||||
|
|
||||||
|
(use-package! org-roam-ui
|
||||||
|
:after org-roam ;; or :after org
|
||||||
|
;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
|
||||||
|
;; a hookable mode anymore, you're advised to pick something yourself
|
||||||
|
;; if you don't care about startup time, use
|
||||||
|
;; :hook (after-init . org-roam-ui-mode)
|
||||||
|
:config
|
||||||
|
(setq org-roam-ui-sync-theme t
|
||||||
|
org-roam-ui-follow t
|
||||||
|
org-roam-ui-update-on-save t
|
||||||
|
org-roam-ui-open-on-start t))
|
||||||
|
|
||||||
|
(after! org-roam-ui (map! :leader (:prefix ("r" . "roam") (:prefix ("u" . "roam-ui")
|
||||||
|
|
||||||
|
:desc "Focus the current node in org-roam-ui view"
|
||||||
|
"f" #'org-roam-ui-node-zoom
|
||||||
|
|
||||||
|
:desc "Focus the current node's local graph in org-roam-ui view"
|
||||||
|
"l" #'org-roam-ui-node-local
|
||||||
|
|
||||||
|
:desc "Begin org-roam ui mode"
|
||||||
|
"u" #'open-org-roam-ui
|
||||||
|
|
||||||
|
))))
|
||||||
|
#+END_SRC
|
||||||
|
**** Function to pull up org-roam ui
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defun open-org-roam-ui ()
|
||||||
|
(interactive)
|
||||||
|
(org-roam-ui-mode)
|
||||||
|
(async-shell-command "surf http://localhost:35901/"))
|
||||||
|
#+END_SRC
|
||||||
|
*** Default Browser for Export
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq browse-url-browser-function 'browse-url-generic
|
||||||
|
browse-url-generic-program "surf")
|
||||||
|
|
||||||
|
'(org-file-apps
|
||||||
|
(quote
|
||||||
|
((auto-mode . emacs)
|
||||||
|
("\\.mm\\'" . default)
|
||||||
|
("\\.x?html?\\'" . "surf %s")
|
||||||
|
("\\.pdf\\'" . default))))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** Journal Environment with org-roam
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(after! org-roam
|
||||||
|
(setq org-roam-dailies-capture-templates
|
||||||
|
`(("d" "default" entry
|
||||||
|
"* %?"
|
||||||
|
:target (file+head "%<%Y-%m-%d>.sec.org.age"
|
||||||
|
"#+title: %<%Y-%m-%d>\n")))))
|
||||||
|
#+END_SRC
|
||||||
|
*** Property getters and setters
|
||||||
|
These are to fulfill my need to get property values for generating my [[id:6672f401-32a1-49ef-8004-ac77ece67f5b][journal index]].
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(require 'cl-lib)
|
||||||
|
|
||||||
|
(defun org-global-props-key-re (key)
|
||||||
|
"Construct a regular expression matching key and an optional plus and eating the spaces behind.
|
||||||
|
Test for existence of the plus: (match-beginning 1)"
|
||||||
|
(concat "^" (regexp-quote key) "\\(\\+\\)?[[:space:]]+"))
|
||||||
|
|
||||||
|
(defun org-global-props (&optional buffer)
|
||||||
|
"Get the plists of global org properties of current buffer."
|
||||||
|
(with-current-buffer (or buffer (current-buffer))
|
||||||
|
(org-element-map (org-element-parse-buffer) 'keyword (lambda (el) (when (string-equal (org-element-property :key el) "PROPERTY") (nth 1 el))))))
|
||||||
|
|
||||||
|
(defun org-global-prop-value (key)
|
||||||
|
"Get global org property KEY of current buffer.
|
||||||
|
Adding up values for one key is supported."
|
||||||
|
(let ((key-re (org-global-props-key-re key))
|
||||||
|
(props (org-global-props))
|
||||||
|
ret)
|
||||||
|
(cl-loop with val for prop in props
|
||||||
|
when (string-match key-re (setq val (plist-get prop :value))) do
|
||||||
|
(setq
|
||||||
|
val (substring val (match-end 0))
|
||||||
|
ret (if (match-beginning 1)
|
||||||
|
(concat ret " " val)
|
||||||
|
val)))
|
||||||
|
ret))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
** Resume setup for a stellar CV
|
||||||
|
*** ox-extra for ":ignore:" tags
|
||||||
|
I want to be able to ignore headings on export.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(after! org
|
||||||
|
(use-package! ox-extra
|
||||||
|
:config
|
||||||
|
(ox-extras-activate '(latex-header-blocks ignore-headlines))))
|
||||||
|
#+END_SRC
|
||||||
|
*** Resume template
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("altacv" "\\documentclass[10pt,a4paper,ragged2e,withhyper]{altacv}
|
||||||
|
\\usepackage[rm]{roboto}
|
||||||
|
\\usepackage[defaultsans]{lato}
|
||||||
|
\\usepackage{paracol}
|
||||||
|
[NO-DEFAULT-PACKAGES]
|
||||||
|
[NO-PACKAGES]
|
||||||
|
% Change the page layout if you need to
|
||||||
|
\\geometry{left=1.25cm,right=1.25cm,top=1.5cm,bottom=1.5cm,columnsep=1.2cm}
|
||||||
|
|
||||||
|
% Use roboto and lato for fonts
|
||||||
|
\\renewcommand{\\familydefault}{\\sfdefault}
|
||||||
|
|
||||||
|
% Change the colours if you want to
|
||||||
|
\\definecolor{SlateGrey}{HTML}{2E2E2E}
|
||||||
|
\\definecolor{LightGrey}{HTML}{666666}
|
||||||
|
\\definecolor{DarkPastelRed}{HTML}{450808}
|
||||||
|
\\definecolor{PastelRed}{HTML}{8F0D0D}
|
||||||
|
\\definecolor{GoldenEarth}{HTML}{E7D192}
|
||||||
|
|
||||||
|
\\colorlet{name}{black}
|
||||||
|
\\colorlet{tagline}{black}
|
||||||
|
\\colorlet{heading}{black}
|
||||||
|
\\colorlet{headingrule}{black}
|
||||||
|
\\colorlet{subheading}{black}
|
||||||
|
\\colorlet{accent}{black}
|
||||||
|
\\colorlet{emphasis}{SlateGrey}
|
||||||
|
\\colorlet{body}{LightGrey}
|
||||||
|
|
||||||
|
% Change some fonts, if necessary
|
||||||
|
\\renewcommand{\\namefont}{\\Huge\\rmfamily\\bfseries}
|
||||||
|
\\renewcommand{\\personalinfofont}{\\footnotesize}
|
||||||
|
\\renewcommand{\\cvsectionfont}{\\LARGE\\rmfamily\\bfseries}
|
||||||
|
\\renewcommand{\\cvsubsectionfont}{\\large\\bfseries}
|
||||||
|
|
||||||
|
% Change the bullets for itemize and rating marker
|
||||||
|
% for \cvskill if you want to
|
||||||
|
\\renewcommand{\\itemmarker}{{\\small\\textbullet}}
|
||||||
|
\\renewcommand{\\ratingmarker}{\\faCircle}
|
||||||
|
"
|
||||||
|
|
||||||
|
("\\cvsection{%s}" . "\\cvsection*{%s}")
|
||||||
|
("\\cvevent{%s}" . "\\cvevent*{%s}")))
|
||||||
|
#+END_SRC
|
||||||
|
** Better EViL keybinds
|
||||||
|
*** Remapping =g-j/k=
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(map! :n "g j" #'evil-next-visual-line)
|
||||||
|
(map! :n "g k" #'evil-previous-visual-line)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
* Company-mode for great autocompletes
|
||||||
|
I don't really want company-mode to run on timeouts.
|
||||||
|
I want VIM-like autocompletion, where =C-x o= and friends gives me my autocompletion.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(after! company-mode
|
||||||
|
(setq company-idle-delay nil))
|
||||||
|
(setq company-idle-delay nil)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* Test
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(require 'zmq)
|
||||||
|
#+END_SRC
|
||||||
|
* Initializing shell environment variables
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package! exec-path-from-shell)
|
||||||
|
(after! exec-path-from-shell
|
||||||
|
(dolist (var '("SSH_AUTH_SOCK" "SSH_AGENT_PID" "GPG_AGENT_INFO"))
|
||||||
|
(add-to-list 'exec-path-from-shell-variables var))
|
||||||
|
(exec-path-from-shell-initialize)
|
||||||
|
)
|
||||||
|
#+END_SRC
|
18
custom.el
Normal file
18
custom.el
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
(put 'narrow-to-region 'disabled nil)
|
||||||
|
(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.
|
||||||
|
'(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'")
|
||||||
|
'(warning-suppress-types
|
||||||
|
'((org-element-cache)
|
||||||
|
(org-element-cache)
|
||||||
|
(org-element-cache)
|
||||||
|
(defvaralias))))
|
||||||
|
(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.
|
||||||
|
)
|
90
images/example.svg
Normal file
90
images/example.svg
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="32" class="svgbob">
|
||||||
|
<style>
|
||||||
|
.svgbob line, .svgbob path, .svgbob circle, .svgbob rect, .svgbob polygon {
|
||||||
|
stroke: black;
|
||||||
|
stroke-width: 2;
|
||||||
|
stroke-opacity: 1;
|
||||||
|
fill-opacity: 1;
|
||||||
|
stroke-linecap: round;
|
||||||
|
stroke-linejoin: miter;
|
||||||
|
}
|
||||||
|
.svgbob text {
|
||||||
|
white-space: pre;
|
||||||
|
fill: black;
|
||||||
|
font-family: Iosevka Fixed, monospace;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.svgbob rect.backdrop {
|
||||||
|
stroke: none;
|
||||||
|
fill: transparent;
|
||||||
|
}
|
||||||
|
.svgbob .broken {
|
||||||
|
stroke-dasharray: 8;
|
||||||
|
}
|
||||||
|
.svgbob .filled {
|
||||||
|
fill: black;
|
||||||
|
}
|
||||||
|
.svgbob .bg_filled {
|
||||||
|
fill: transparent;
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.svgbob .nofill {
|
||||||
|
fill: transparent;
|
||||||
|
}
|
||||||
|
.svgbob .end_marked_arrow {
|
||||||
|
marker-end: url(#arrow);
|
||||||
|
}
|
||||||
|
.svgbob .start_marked_arrow {
|
||||||
|
marker-start: url(#arrow);
|
||||||
|
}
|
||||||
|
.svgbob .end_marked_diamond {
|
||||||
|
marker-end: url(#diamond);
|
||||||
|
}
|
||||||
|
.svgbob .start_marked_diamond {
|
||||||
|
marker-start: url(#diamond);
|
||||||
|
}
|
||||||
|
.svgbob .end_marked_circle {
|
||||||
|
marker-end: url(#circle);
|
||||||
|
}
|
||||||
|
.svgbob .start_marked_circle {
|
||||||
|
marker-start: url(#circle);
|
||||||
|
}
|
||||||
|
.svgbob .end_marked_open_circle {
|
||||||
|
marker-end: url(#open_circle);
|
||||||
|
}
|
||||||
|
.svgbob .start_marked_open_circle {
|
||||||
|
marker-start: url(#open_circle);
|
||||||
|
}
|
||||||
|
.svgbob .end_marked_big_open_circle {
|
||||||
|
marker-end: url(#big_open_circle);
|
||||||
|
}
|
||||||
|
.svgbob .start_marked_big_open_circle {
|
||||||
|
marker-start: url(#big_open_circle);
|
||||||
|
}
|
||||||
|
<!--separator-->
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<defs>
|
||||||
|
<marker id="arrow" viewBox="-2 -2 8 8" refX="4" refY="2" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||||
|
<polygon points="0,0 0,4 4,2 0,0"></polygon>
|
||||||
|
</marker>
|
||||||
|
<marker id="diamond" viewBox="-2 -2 8 8" refX="4" refY="2" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||||
|
<polygon points="0,2 2,0 4,2 2,4 0,2"></polygon>
|
||||||
|
</marker>
|
||||||
|
<marker id="circle" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||||
|
<circle cx="4" cy="4" r="2" class="filled"></circle>
|
||||||
|
</marker>
|
||||||
|
<marker id="open_circle" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||||
|
<circle cx="4" cy="4" r="2" class="bg_filled"></circle>
|
||||||
|
</marker>
|
||||||
|
<marker id="big_open_circle" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||||
|
<circle cx="4" cy="4" r="3" class="bg_filled"></circle>
|
||||||
|
</marker>
|
||||||
|
</defs>
|
||||||
|
<rect class="backdrop" x="0" y="0" width="240" height="32"></rect>
|
||||||
|
<line x1="0" y1="8" x2="40" y2="8" class="solid"></line>
|
||||||
|
<polygon points="40,4 48,8 40,12" class="filled"></polygon>
|
||||||
|
<polygon points="200,4 192,8 200,12" class="filled"></polygon>
|
||||||
|
<line x1="200" y1="8" x2="232" y2="8" class="solid"></line>
|
||||||
|
<text x="58" y="12" >Like this one!</text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
196
init.el
Normal file
196
init.el
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
;;; 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).
|
||||||
|
|
||||||
|
(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
|
||||||
|
;;ido
|
||||||
|
;;ivy
|
||||||
|
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 ; 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 ) ; 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 ; 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 +everywhere) ; tasing you for misspelling mispelling
|
||||||
|
grammar ; tasing grammar mistake every you make
|
||||||
|
|
||||||
|
:tools
|
||||||
|
;;ansible
|
||||||
|
biblio ; Writes a PhD for you (citation needed)
|
||||||
|
;;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 +dictionary +offline) ; 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 +lsp) ; 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 +lsp +cdlatex +fold) ; 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 +roam2 +gnuplot +hugo +pomodoro +noter) ; 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
|
||||||
|
;;emmgs
|
||||||
|
;;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)
|
||||||
|
|
||||||
|
)
|
79
packages.el
Normal file
79
packages.el
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
;; -*- no-byte-compile: t; -*-
|
||||||
|
;;; $DOOMDIR/packages.el
|
||||||
|
|
||||||
|
;; 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'.
|
||||||
|
|
||||||
|
|
||||||
|
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
||||||
|
;(package! some-package)
|
||||||
|
|
||||||
|
;; To install a package directly from a remote git repo, you must specify a
|
||||||
|
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
|
||||||
|
;; https://github.com/radian-software/straight.el#the-recipe-format
|
||||||
|
;(package! another-package
|
||||||
|
; :recipe (:host github :repo "username/repo"))
|
||||||
|
|
||||||
|
;; If the package you are trying to install does not contain a PACKAGENAME.el
|
||||||
|
;; file, or is located in a subdirectory of the repo, you'll need to specify
|
||||||
|
;; `:files' in the `:recipe':
|
||||||
|
;(package! this-package
|
||||||
|
; :recipe (:host github :repo "username/repo"
|
||||||
|
; :files ("some-file.el" "src/lisp/*.el")))
|
||||||
|
|
||||||
|
;; If you'd like to disable a package included with Doom, you can do so here
|
||||||
|
;; with the `:disable' property:
|
||||||
|
;(package! builtin-package :disable t)
|
||||||
|
|
||||||
|
;; 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:
|
||||||
|
;(package! builtin-package :recipe (:nonrecursive t))
|
||||||
|
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
|
||||||
|
|
||||||
|
;; Specify a `:branch' to install a package from a particular branch or tag.
|
||||||
|
;; This is required for some packages whose default branch isn't 'master' (which
|
||||||
|
;; our package manager can't deal with; see radian-software/straight.el#279)
|
||||||
|
;(package! builtin-package :recipe (:branch "develop"))
|
||||||
|
|
||||||
|
;; Use `:pin' to specify a particular commit to install.
|
||||||
|
;(package! builtin-package :pin "1a2b3c4d5e")
|
||||||
|
|
||||||
|
|
||||||
|
;; Doom's packages are pinned to a specific commit and updated from release to
|
||||||
|
;; release. The `unpin!' macro allows you to unpin single packages...
|
||||||
|
;(unpin! pinned-package)
|
||||||
|
;; ...or multiple packages
|
||||||
|
;(unpin! pinned-package another-pg-ql)
|
||||||
|
;; Org-mode
|
||||||
|
|
||||||
|
;;(package! org-habit-plus
|
||||||
|
; ; :recipe (:host github :type git :repo "myshevchuk/org-habit-plus"))
|
||||||
|
|
||||||
|
(package! org-roam-ui)
|
||||||
|
|
||||||
|
|
||||||
|
(package! ob-lilypond
|
||||||
|
:recipe (:host github :type git :repo "mjago/ob-lilypond"))
|
||||||
|
|
||||||
|
|
||||||
|
;; Sagemath-related
|
||||||
|
;(package! sage-shell-mode)
|
||||||
|
;(package! ob-sagemath)
|
||||||
|
|
||||||
|
(package! engrave-faces)
|
||||||
|
;; Graphing
|
||||||
|
(package! ob-mermaid)
|
||||||
|
(package! ob-svgbob
|
||||||
|
:recipe (:host nil :type git :repo "https://git.tecosaur.net/tec/ob-svgbob"))
|
||||||
|
|
||||||
|
; Security-related
|
||||||
|
(package! age)
|
||||||
|
|
||||||
|
(package! org-edna)
|
||||||
|
|
||||||
|
(package! org-heatmap
|
||||||
|
:recipe (:host github :type git :repo "aspiers/org-heatmap"))
|
||||||
|
|
||||||
|
(package! exec-path-from-shell)
|
10
snippets/org-mode/<svgbob
Normal file
10
snippets/org-mode/<svgbob
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: SVGBob Code Block
|
||||||
|
# uuid:
|
||||||
|
# key: <svgbob
|
||||||
|
# condition: t
|
||||||
|
# --
|
||||||
|
|
||||||
|
#+BEGIN_SRC svgbob :results file :file images/$1.svg :background transparent :stroke-color $2 :exports results :text-color $3
|
||||||
|
$4
|
||||||
|
#+END_SRC
|
10
snippets/org-mode/mermaid code block
Normal file
10
snippets/org-mode/mermaid code block
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: <mermaidjs
|
||||||
|
# uuid:
|
||||||
|
# key: <mermaidjs
|
||||||
|
# condition: t
|
||||||
|
# --
|
||||||
|
|
||||||
|
#+BEGIN_SRC mermaid :results file :file images/$1 :theme dark :background-color transparent :exports results
|
||||||
|
$2
|
||||||
|
#+END_SRC
|
20
snippets/org-mode/paycheck
Normal file
20
snippets/org-mode/paycheck
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: paycheck
|
||||||
|
# uuid: beancount-paycheck-snippet-2023-S-J-Electric
|
||||||
|
# key: paycheck
|
||||||
|
# condition: t
|
||||||
|
# --
|
||||||
|
${1:`(current-date)`} txn "Paycheck $2 - $3"
|
||||||
|
Income:S-J-Electric:Hourly - $4 USD
|
||||||
|
Income:S-J-Electric:Overtime - $5 USD
|
||||||
|
Income:S-J-Electric:Holiday ${6:0.00} USD
|
||||||
|
Income:S-J-Electric:Vacation ${7:0.00} USD
|
||||||
|
Expenses:Taxes:Lancaster $8 USD
|
||||||
|
Expenses:Taxes:Federal:Withholding $9 USD
|
||||||
|
Expenses:Taxes:Federal:Social-Security $10 USD
|
||||||
|
Expenses:Taxes:Federal:Medicare $11 USD
|
||||||
|
Expenses:Taxes:PA:Withholding $12 USD
|
||||||
|
Expenses:Taxes:PA:Unemployment-Employee $13 USD
|
||||||
|
Expenses:Taxes:PA:LST $14 USD
|
||||||
|
Liabilities:Tithe $0 USD
|
||||||
|
Assets:Bank:Checking
|
18
snippets/org-mode/person
Normal file
18
snippets/org-mode/person
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: person
|
||||||
|
# uuid:
|
||||||
|
# key: ?person
|
||||||
|
# expand-env: ((yas-indent-line 'auto))
|
||||||
|
# condition: t
|
||||||
|
# --
|
||||||
|
* ${Person} :drill:
|
||||||
|
:PROPERTIES:
|
||||||
|
:DRILL_CARD_TYPE: twosided
|
||||||
|
:END:
|
||||||
|
Name this person
|
||||||
|
|
||||||
|
** Image
|
||||||
|
${3:content}
|
||||||
|
|
||||||
|
** Name
|
||||||
|
${5:content}
|
10
snippets/org-mode/sage-block
Normal file
10
snippets/org-mode/sage-block
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: sage-block
|
||||||
|
# uuid: sagemath-block
|
||||||
|
# key: <sage
|
||||||
|
# condition: t
|
||||||
|
# --
|
||||||
|
|
||||||
|
#+BEGIN_SRC sage :session ${1:session-name} :results file :file ${2:filename}
|
||||||
|
${content}
|
||||||
|
#+END_SRC
|
15
snippets/org-mode/two-sided-drill
Normal file
15
snippets/org-mode/two-sided-drill
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: two-sided-drill
|
||||||
|
# uuid:
|
||||||
|
# key: ?two
|
||||||
|
# expand-env: ((yas-indent-line 'auto))
|
||||||
|
# condition: t
|
||||||
|
# --
|
||||||
|
* ${0:title} :drill:
|
||||||
|
${1:prompt}
|
||||||
|
|
||||||
|
** ${2:title}
|
||||||
|
${3:content}
|
||||||
|
|
||||||
|
** ${4:title}
|
||||||
|
${5:content}
|
Loading…
Reference in New Issue
Block a user