Execute Inline Code Blocks In Neovim

TL;DR

I wrote a Neovim plugin to run code blocks in my notes and drop the output directly into the file. It looks like this:

Details

I used to keep my grimoire (aka notes app) in emacs using org-mode. There's a lot to org-mode, but the only thing I really cared about was the ability to run inline code blocks and see the output in the file.

I enjoyed emacs, but it wasn't for me so I ended up back on neovim. It does everything I need with the exception of those inline code blocks. I found some org-mode like plugins but the were all eihter way out of date or seemd like personal projects. I figured if I was going to use a personal project it might as well be mine. So, I dug into tree-sitter and built one.

Here's a little video with some details

Notes
  • The example uses my own file format I designed to replace markdown for managing my content. I don't expect anyone to use it, but this might make a foundation for someone to make a code runner that works with markdown or any other format that uses tree-sitter

Reference

Neopolitan

This is the file format I built for myself to replace markdown with something that does more without going all the way to mdx

Reference

Magically format embedded languages in Neovim - TJ DeVries

This is the video that got me started figuring how how to do the tree-sitter stuff. It would have taken me ages longer without