- Overview
- Transcript
3.2 Adding Snippets Through Package Control
The key to snippets is to use them religiously. Force yourself to memorize them.
1.Introduction1 lesson, 02:05
1.1Welcome02:05
2.Getting Started9 lessons, 35:20
2.1Installation and Base Settings04:54
2.2Services and Opening Sublime From the Terminal02:20
2.3Multiple Cursors and Incremental Search06:54
2.4The Command Palette04:13
2.5Instant File Changing03:19
2.6Symbols04:17
2.7Key Bindings02:33
2.8Installing Plugins Without Package Control02:54
2.9Package Control03:56
3.Snippets3 lessons, 14:40
3.1Your First Snippet09:04
3.2Adding Snippets Through Package Control02:32
3.3Easier Testing With Snippets03:04
4.Essential Plugins12 lessons, 46:58
4.1Zen Coding07:09
4.2Emmet06:52
4.3Cross-Browser CSS With Prefixr02:17
4.4Fetch Files With Ease 04:22
4.5Lightning Fast Folder and File Creation 02:12
4.6Sidebar Enhancements03:09
4.7Sublime Linter02:01
4.8Sexy Code Snippet Management With Gists07:50
4.9DocBlockr03:49
4.10Pretty Task Management02:42
4.11HTTP Requests Within Sublime02:29
4.12LiveReload02:06
5.Tips, Techniques and Modifications8 lessons, 49:09
5.1Regular Expressions in Sublime05:49
5.2Vintage Mode10:46
5.3Quicker Stylesheet References02:30
5.4Joining Lines04:40
5.5Sublime and Markdown with Marked03:10
5.6All About Projects 05:54
5.7Configuring and Mastering Split Windows07:19
5.8Custom Builds09:01
6.Closing1 lesson, 00:49
6.1Conclusion00:49
3.2 Adding Snippets Through Package Control
The key with snippets is to use them religiously. Force yourself to memorize these or force yourself to name these snippets in a manner in which you don't have to memorize them, because they will naturally occur to you. Now that doesn't mean you have to do all of these snippets by yourself. Maybe we're working on a jQuery project. Well, I can bring up Package Control and Install. And let's look for something jQuery here. JQuery snippets packet. If we want to take a look at what we have available I can bring up the palette again Shift+Cmd+P. I'll type in jQuery and now here's all of the jQuery specific snippets that I have. So let's take a look at the on handler and we can see that it has a tab trigger of .on. So if I expand that, now we get that syntax. So then we could say, grab all anchor tags and now I type .on. And this is fairly clever, because it's part of your process, .on Tab and now we have two different options. We'll do the second one or if we try it one more time, .on and we'll do that first one. That one will be slightly different. So one cool thing about using these community developed snippets is they've really thought about every possible use. So maybe I want to filter through on array, but I can't remember the order of the parameters. Well, I just jquery.each, Tab. We want this second option there. I'll choose that and now we can see I provide my array as the first one. And then we can console.log(num), which will log one, then two. So for the frameworks and libraries that you use most often, make sure that you find some snippets. For example, I use a framework called Laravel and its templating engine is called Blade. So, I will install and I'm gonna look for Blade. Here we go. Here's some Blade snippets that I can use. Next, I will create a view, index.blade.php. You'll see that it has automatically set this syntax to Blade. So now as always, I can bring up the command palette. Take a look at all of the blade options that are available to me. Now if I wanna setup the layout, I type at and then the first three letters. @lay, Tab and now we have that. If I need to do a quick test, @if, Tab and we can say, name equals Jeffrey. Tab again, now we proceed accordingly. Or as a final example, maybe to create a section and yield it at the same time. There we go. So have a play around with this. Download your favorite snippets and when you're ready, move on to the next lesson.