Skip to content

Making Snippets in VSCode

Posted on:February 21, 2024

Whenever I have to decide if I should automate something, there is always that problem with the law of diminishing returns, the concept in economics that describes a point at which the level of benefits gained from an investment (time saved from automation) starts to decline, relative to the amount of resources invested(time it takes me to automate).

Well, I messed up and waited too long for custom code snippets for this blog and I’m much happier having them now!

Even though this is probably really obvious for everyone, I thought I might promote this feature in VScode so that maybe a few others would try it out and save some time too.

I didn’t take it too far and it was really much faster and easier than I thought to build. This is a great case for plugging what you want into your preferred LLM chat bot and copy/pasting a solution for you.

The three snippets I use most often are for inserting images and video into .mdx files and building front matter for posts.

Here is what my frontmatter snippet looks like. It was pretty much one shot generated from an LLM. I still don’t know much about VScode snippets but haven’t had to learn about them for it to be really useful.

This post only took me five minutes to write and share! Hopefully you go play with VScode snippets and find it useful too.