C-x C-c

I rage-quit Emacs this morning. By that, I don’t mean that I hit C-x C-c really hard, although I did do that. I mean I stopped using Emacs.

Read more

Marking a region for highlighting in Hugo posts

You’ll notice that I highlight short phrases in many of my daily post entries here. I think this makes it easier to scan things later. The HTML markup for this is just a styled <mark> tag wrapping the text to be highlighted.

I write my posts in Org-mode and convert them to Hugo-compatible Markdown using ox-hugo. The path from Org-mode to HTML for this is a little convoluted, so I cheat and use a macro to generate the markup.

Read more

Book logging in Emacs

I’ve kept a list of books I’ve read as a plain text (well, technically, Markdown) file for years. I wrote about it here . The public version is rendered using Github Pages at books.baty.net . This is fine, but at some point last year I also started logging books in an Org mode file, just to see how it felt. It felt pretty good!

Read more

Searching Org-roam files

Org-roam is “A plain-text personal knowledge management system” using Emacs and Org-mode and I put nearly all my notes in there. While it’s easy to find notes in org-roam based on filename, there’s no obvious way to search the contents of notes. Weird, right?

I could use the default projectile search, but my org-roam files live within my main ~/org directory, so the results are littered with all my other org documents. I’d prefer to only search in ~/org/roam

I use a simple lisp function to help with this. It uses consult-ripgrep:

(defun jab/search-roam ()
 "Run consult-ripgrep on the org roam directory"
 (interactive)
 (consult-ripgrep org-roam-directory nil))

I added a keybinding for it to my other org-roam bindings:

(map!
 "C-c n f" 'org-roam-node-find
 "s-u" 'org-roam-node-find
 "C-c n i" 'org-roam-node-insert
 "C-c n t" 'org-roam-dailies-goto-today
 "C-c n d" 'org-roam-dailies-capture-today
 "C-c n c" 'org-roam-capture
 "C-c n s" 'jab/search-roam               ;; <-- my new keybinding
 "C-c n l" 'org-roam-buffer-toggle)

Now, with a quick C-s n s I can search my org-roam files using the blazingly fast ripgrep .

If there’s a better way to do this, I’m all ears.

Publishing portions of my Org-roam database

I’m trying something new.

I’ve become a pretty heavy user of Org-roam  for personal notes. I put nearly everything there now; technical notes, contact information, project notes, vendor info, etc. These notes are all nicely linked and backlinked and live in my main ~/org directory so I can easily find things right within Emacs.

A portion of these notes might be useful to other people. So I’m exporting the shareable notes from Org-roam as Hugo -compatible Markdown files. This turned out to be surprisingly easy. You can see the results at https://notes.baty.net and the details of how it works makes a good example.

I’m sure there are a dozen ways to do this, but this seems to work quite well.

Aligning comments in Emacs

I want my per-line code comments to line up nicely, so I’ll often add a bunch of spaces by hand to make things just so. I realized that, being Emacs, there must be an easier way to handle this. Of course there is.

Read more