Recently I had a talk about one of my pet projects, https://ricsiboard.com/ at a local Java meetup.
Yes yes, I know it's heresy to talk about JS on a Java event, but I think today being a pure Java dev is not really an option. There are too many disruptions, AI/Data comes with Python, full-stack comes with JS, Cloud comes with... well, pretty much anything.
I wanted to have some fun, so I challenged myself to use something else instead of PowerPoint and... figured out a way how to create a presentation with vi. I got some questions about it, so thought a short post might be useful for the ppl of the internet.
What you need to replicate that:
- An installation of Neovim. In an earlier post I've already mentioned why I prefer neovim over gvim and the others.
- (Optional) A configured WSL.
Aaand that's all.
I pretty much wanted to follow convention over configuration - to do it in a way that even in vanilla vi it can be replicated. I wanted to avoid any additional plugin installations. The WSL is nice to have, as it handles custom emojis which is a nice addition to the "slides", zoom the content with Ctrl-+, and you can set up a transparency for the console.
That's fun and can be a useful icebreaker if you have some funny background. My favourite for a long time is
Jakub Rozalski's paintings. It's so unique that can spark a lot of talk even before the talk :-)
Well maybe not THIS much, but you get the point :D
I watched a few videos but honestly, most of the approaches were a pain to manage for my taste. E.g., most of the folks created 1 file per slide with numbers for the ordering and custom scripts for doing the maintenance/reordering (which reminded me sort of the C64 era, when we had to use addresses for GOTO statements haha). So I reverted to using 1 file only, because it is easier to navigate, move content around, reorder the "slides", share, get a grasp of the content on a quick scan, and you can change content with the usual buffer commands such as :ls, :bf, :bl, :bp, :bn.
I used the Markdown format for multiple reasons: it gets some highlight by default, Github renders it nicely, it is a common format, and paging is trivial with a simple macro (more on that later).
Take a look on how it is rendered on Github, quite fancy:
Useful commands, pagination
To create the "slides" I just used some virtual space, while the titles were having an underline of ====.
To create an underline for a header, you can use the combination yypVr=. This yanks the current line, duplicates it, selects the whole line, and replaces all characters with a = char.
For the pagination, I created a simple macro with q2, and the key combination was /=====, Enter, nkztjj. Then you can execute the macro with @2, and simply use @@ afterwards to change page. What it does is it searches for the next underline of the next header, goes to the title text, makes it the top of the screen, and moves below the underline so the next search would jump to a new page.
Some useful commands for adjusting the content is :center (to arrange the content of the current selection to the center of the screen), or using the >> and << commands to shift/decrease the indentation.
And last but not least, using the gx combination will open up an URL in the text, which is useful to show some images, official docs, etc.
Useful tools
For creating ASCII art texts (e.g., for the opening slide or for the section breaks), set the default to the Doom one :-) Yup, I'm a that old haha.
For creating minimal diagrams (in more complex cases, I'd fall back to a picture and a local URL and the gx command):
For adding some nice visuals to the content:
Add a comment