Doom's `doom!' takes a single module list, so this file cannot be shared:
the two machines want different module sets (vertico + popup + workspaces
here, ivy + dashboard + doom-quit there), and the mac list still carries
pre-3.0 names that this Doom rejects. Instead of merging 143 lines of it,
each machine keeps its own copy:
linux/init.el from linux-adopt, verbatim (cmp: identical)
mac/init.el the previous root init.el, verbatim (cmp: identical)
The root init.el is now an *untracked* symlink into whichever directory
matches the machine, created by bin/link-machine.sh. It has to be
untracked: one branch is shared by both machines, and a tracked symlink can
only have one target. /init.el is gitignored so a stray link can never be
committed and clobber the other machine.
Verified:
- link resolves: file-truename init.el -> .../linux/init.el
- the file parses (check-parens) through the link
- sh -n clean; unknown-machine path exits 1 with a message
- git status clean apart from this commit (symlink is ignored)
On the mac, after pulling: ./bin/link-machine.sh && doom sync
Caveats, all consequences of the link being untracked:
- a fresh clone has no init.el until you run the script
- `git clean -xfd' deletes it; re-run the script
- Emacs' byte-compiler would write init.elc next to the link (repo root);
harmless here since *.elc is ignored and the target's mtime wins when
the .el has been edited
config.el and packages.el stay shared at the root for now: their content is
mostly common, and three-way merges are worth more there than isolation.
That is also why AGENTS.md, snippets/ and qwan/ stay where they are.
Mostalive's emacs configuration
Description
My doom emacs configuration.
Mostly standard stuff, some functions that were not available as packages.
The README was generated by doom emacs when creating a README.org file with it.
Maintainers
- @mostalive (on gitlab, github and twitter)
Plugins
- org-plus-contrib
- org-bullets
- company-box* (
+childframe) -
+present
Hacks
Org-roam-server
Some in file:config.el. Port settings for org-roam-server are not standard, so need a function.
Links removal for blogposts and other exports
Also some functions for replacing org-roam links with links to their website, useful for exports such as blog posts, where links to internal pages are not visible.
Diff-hl errors in magit workaround
Why
I think diff-hl shows changes at the side of a buffer, which I quite like. It seems configured with Doom emacs. For inside magit we now have `magit-delta` so it is not needed there. But for now, use one of the workarounds.
Manual workaround: enable global mode - (global-diff-hl-mode)
Config workaround - disable diff-hl in magit
file:config.el
(after! (magit)
(remove-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh))
adding diff-hl to the after! list did not seem to work. it is all a bit mysterious.
Shorter previews for backlinks in roam-buffer
From https://github.com/org-roam/org-roam/issues/1934 by Jethro Kuan
(defun my/preview-fetcher () (let* ((elem (org-element-context)) (parent (org-element-property :parent elem))) ;; TODO: alt handling for non-paragraph elements (string-trim-right (buffer-substring-no-properties (org-element-property :begin parent) (org-element-property :end parent)))))
(setq org-roam-preview-function #'my/preview-fetcher)
=====
Some in file:config.el. Port settings for org-roam-server are not standard, so need a function. Also some functions for replacing org-roam links with links to their website, for useto export as blog posts.
>>>>>>> 6056fb8 (changes to my desktop config)
Prerequisites
Doom Emacs installation
Features
PDF export from latex, in tufte style
How to test
Render to pdf, and open preview : SPC m e l o (m e - export. l - latex, o - open in pdf viewer)
Instal texlive on MacOS or Ubuntu for PDF
What is it
Texlive is a popular Latex distribution.
How to test
Expect which tex to return /opt/homebrew/bin/tex
MacOs
brew install texlive
Instal fonts for tufte style
Source of inspiration: https://so.nwalsh.com/2020/01/05-latex . Put the code in file:config.el on MacOS. Looks like fonts need to go in $HOME/Library/Fonts. And then one needs to run sudo texhash to actually add the fonts. (https://tex.stackexchange.com/questions/93983/xetex-use-otf-font-macports comment by Alan Munn).
Added fonts:
ET Bembo:
Raleway:
google fonts had it: https://fonts.google.com/specimen/Raleway Readme included https://support.apple.com/en-us/HT201749 documentation on how to install fonts on mac os.
xetex does not seem to support variable size fonts (see README in Raleway folder), so in Downloads
open Raleway/static
select all, and then right-click open. 'install' on the first should install all of them.
Fira Code
Because Operator Mono Ssm is not a free font. FYI : I initially replaced with Fira Mono from google fonts, made by mozilla apparently. Now Fira Code by mozilla works:
\\setmonofont[Scale=MatchLowercase]{Fira Code}
Pretty deltas with magit-delta
Package added in file:packages.el enabled after magit in file:config.el. Highlighting / theme settings in file:~/.gitconfig.
Features
- Line numbers are disabled in Magit and expanding/collapsing of diffs works correctly.
- Line numbers and side-by-side view are enabled in the terminal.
Reason / explanation in https://scripter.co/using-git-delta-with-magit/
Magit does not need line numbers, the line where one can expand/collapse already shows them.
=====
Render to pdf, and open preview : SPC m e l o (m e - export. l - latex, o - open in pdf viewer)
putting https://so.nwalsh.com/2020/01/05-latex in my config.el on MacOS. Looks like fonts need to go in $HOME/Library/Fonts. And then one needs to run sudo texhash to actually add the fonts. (https://tex.stackexchange.com/questions/93983/xetex-use-otf-font-macports comment by Alan Munn).
Added fonts:
- ET Bembo: https://github.com/DavidBarts/ET_Bembo (Tufte font)
- Raleway: google fonts had it: https://fonts.google.com/specimen/Raleway Readme included https://support.apple.com/en-us/HT201749 documentation on how to install fonts on mac os.
-
Operator Mono Ssm - this is not a free font apparently. maybe try Fira code instead.
- replaced with Fira Mono from google fonts, made by mozilla apparently.