The general idea is to save you typing out the same things completely again and again, and again. With snippets, you can create a boilerplate file, and insert commonly used blocks of text. It is inserted by a command or through some trigger text. ? DefinitionĪ snippet is a template that can be inserted into a document. I will briefly cover how you can utilise these apps to get even more out of snippets. The code editor I will use to showcase snippets is Visual Studio Code (VS Code), the most popular editor of the day.Īlso, there are some 'text expander' apps that allow you to use snippets globally (across all apps). Most code editors support snippets out of the box.
Utter a short phrase (type a prefix), wave your wand (press Enter or Tab), and presto! A wonderful event unfolds in front of you.
Snippets can add a touch of magic to your editor.