dot-emacs

My emacs dotfiles/config
git clone git://git.ethandl.dev/dot-emacs
Log | Files | Refs

commit 8fc92b518721a177c47c8f6e52dc99e4b2f211b4
parent b1787eb272b1dab182b0ae97d90fcc5a6525aed0
Author: Ethan Long <me@ethandl.dev>
Date:   Fri, 19 Jun 2026 23:25:47 +1000

I forgor what I changed xddddd

I think it just involves Python integration with tangling and Org babel

Diffstat:
Mconfig.org | 68+++++++++++++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 51 insertions(+), 17 deletions(-)

diff --git a/config.org b/config.org @@ -257,24 +257,24 @@ To define our desired fonts, we create functions as we did before in [[Code font uses a height of 155. If VAR or MONO are nil, selects the first available font for each from a predefined list." (setq ethandl/org-mono-font-name - (or mono - (seq-find #'ethandl/font-exists - '("CMU Typewriter Text" - "Iosevka" - "Codelia Ligatures" - "Monego" - "Monaco" - "DejaVu Sans Mono" - "monospace")))) + (or mono + (seq-find #'ethandl/font-exists + '("Codelia Ligatures" + "Iosevka" + "Monego" + "Monaco" + "CMU Typewriter Text" + "DejaVu Sans Mono" + "monospace")))) (setq ethandl/org-var-font-name - (or var - (seq-find #'ethandl/font-exists - '("CMU Serif" - "Iosevka Aile" - "Times New Roman" - "DejaVu Serif")))) + (or var + (seq-find #'ethandl/font-exists + '("CMU Serif" + "Iosevka Aile" + "Times New Roman" + "DejaVu Serif")))) (setq ethandl/org-font-ht - (or height 155))) + (or height 155))) #+end_src Next, we define a way to easily apply these fonts. @@ -305,6 +305,7 @@ This is not as simple as it should be, because ~variable-pitch-mode~ takes over Finally, we apply these fonts every time we enter org mode. #+begin_src emacs-lisp + (ethandl/set-org-fonts) (add-hook 'org-mode-hook #'ethandl/set-org-fonts) #+end_src ** Theme @@ -402,7 +403,33 @@ This can be fixed by rendering all \(\text{\LaTeX}\) in the buffer ahead of time #+begin_src emacs-lisp (add-hook 'org-mode-hook (lambda () (org-latex-preview 'buffer))) #+end_src + +By default, the \(\text{\LaTeX}\) previews are displayed with PNG for speed, but I will change this to use SVG for display sexiness: +#+begin_src emacs-lisp + (setq org-latex-preview-process-default 'dvisvgm) +#+end_src +** Start with images +By default, Org will wait until ~org-display-inline-images~ is run to display images. The following sets images to automatically load on file opening: +#+begin_src emacs-lisp + (setq org-startup-with-inline-images t) +#+end_src + +If we want images generated by the output of ~org-babel~ to automatically render, we need to add the following to the hook: +#+begin_src emacs-lisp + (add-hook 'org-babel-after-execute-hook #'org-display-inline-images) +#+end_src +This will save a ~C-c C-x C-v~ invocation every time we want to display newly generated images. * The programming environment +** Org babel env init +Throughout these subsections, I will add languages to a list of languages that Org can evaluate in code blocks. The default list includes elisp, but we will rebuild it from scratch in the following sections: +#+begin_src emacs-lisp + (setq ethandl/org-babel-langs nil) + (defun ethandl/org-babel-load-langs () + (org-babel-do-load-languages + 'org-babel-load-languages + ethandl/org-babel-langs)) + (add-hook 'org-mode-hook #'ethandl/org-babel-load-langs) +#+end_src ** The ~vterm~ terminal emulator To make emacs a useful development environment, we need a good terminal. Instead of using a separate terminal emulator like a Unix puritan, we use the ~vterm~ package: #+begin_src emacs-lisp @@ -431,12 +458,19 @@ Emacs comes with ~markdown-ts-mode~, which utilises treesitter to provide highli (ethandl/treesit-install-async 'markdown) (ethandl/treesit-install-async 'markdown-inline) #+end_src +** Emacs Lisp +Not much needs to be done here. For verbosity, I will specify that we want Org to be able to run elisp: +#+begin_src emacs-lisp + (add-to-list 'ethandl/org-babel-langs '(emacs-lisp . t)) +#+end_src ** Python #+begin_src emacs-lisp (add-to-list 'treesit-language-source-alist '(python "https://github.com/tree-sitter/tree-sitter-python")) - + (ethandl/treesit-install-async 'python) + + (add-to-list 'ethandl/org-babel-langs '(python . t)) #+end_src ** \(\text{\LaTeX}\) I like to keep it simple; we have a built-in \(\text{\LaTeX}\) programming environment, and I won't install anything extra.