I didn't know it was called code snippets at that time, so I spent over 2 weeks trying to find a tool that could help me do this and I almost gave up. And that was when I learned about VsCode Code Snippets. But that also was getting stressful, and I wanted to just type in a few letters, press enter, and boom have my templates showing on my screen. That got me thinking about having my personalized HTML and CSS templates which would have all the base code I always used in my projects.Īt first, I just created the templates and saved them on my system so I could copy the code any time I started a new project. Plus I was always forgetting to link my stylesheets to my HTML pages, making me spend an unreasonable amount of time trying to figure out why my pages were not being styled correctly. This involved me trying to remember how to link my documents to their packages and also use personalized CSS resets and variables. (PS: if you don't want to read the back story and just wanna dive right into the tutorial, then jump right into it.)Īs I started exploring more into coding, I learned about VSCode extensions that made coding faster – code snippets in particular – and I then went on a downloading spree.Īll was going fine and well until I started frequently using frameworks and libraries in my projects. (I doubt anyone knows how to write that by heart.) It was cool and I felt like a code ninja. When I first started learning how to code, the first code snippet I ever used was Ctrl + ! and enter to get an HTML5 document template. Prerequisitesįor this tutorial, I'll assume that you can write a decent amount of code in the language you want to create a code snippet for. In this tutorial, we're going to learn how to write our own custom snippets. Code Snippets are a feature on most text editors, code editors, and IDEs. Snippets help programmers reduce the time it takes to type in repetitive information while coding. A code Snippet is a programming term that refers to a small portion of re-usable source code, machine code, or text.
0 Comments
Leave a Reply. |