Quickly linking to jekyll posts in vim
I made a vim plugin that finds all your jekyll posts, lists them, lets you select one, then creates a link right there in your current markdown file.
Here it is in action
What is this shit
If you want to link to one of your own posts in a markdown file for jekyll, it looks like this
[link title]({% post_url 2024-12-10-foobar %})
It’s a good system because if your website domain changes you don’t have to find all the links you made in the past, they get auto-updated each time you generate the website.
I don’t like having to look up the date and title of a post manually, it breaks my flow and with over 1300 posts now on this website it’s actually quite cumbersome to do. Yeah maybe that means I should think about a search feature on my own site. But ugh I cannot be arsed with that right now.
Anyway this lets me generate that link in vim, which is my text editor of choice. I just press ,p
and bam all my posts appear, and they can be searched. Then when I press enter the link appears right where I want it.
The thing that’s really doing the heavy lifting here is the wonderful fzf2, it’s what lets you do all the searching, selecting, drawing windows etc etc. In my script I’m just looking up posts, their titles, then feeding it all to fzf
.