Lessons: 34Length: 2.5 hours

Next lesson playing in 5 seconds

Cancel
  • Overview
  • Transcript

2.9 Package Control

Will bond's package control is a required install for all Sublime Text 2 users. I'll show you why in this lesson.

Related Links

Note

Package Control provides slightly different versions of the installation command for Sublime Text versions 2 and 3. Be sure to use the right one for your editor.

2.9 Package Control

In one of the previous lessons, I made a note that this file uses a PHP templating engine called Blade. But the problem is that Sublime doesn't have any Blade syntax highlighting support. So I noted that in the future, I would show you how you could set that up in around five seconds. So let's tackle that in this lesson. Now I should note that I mean five seconds as soon as you've installed the necessary tools. So the tool we need was created by Will Bond. It's called Package Control, and this is a necessity for every Sublime Text user. Whether you're a simple, occasional or you're a power user. To download Package Control, we need to go to Will Bond's site. There will be a link to this below the video. And what this is, is it's essentially a package manager. So any packages or plugins created by the community, can be added to this repository. And then, when you need to download them, you can do so directly from your editor. You can probably imagine with some of your old editors, you would find something you wanted to use, it would be on somebody's website. You would download the zip file and you'd have to figure out where am I supposed to drag these files? Ir was all very complicated. But in Sublime Text with Package Control, it's four or five seconds and you're done. So the first step, we need to install it, and all we have to do is copy this line right here and we're going to paste this into Sublime's console. So I'll go back to Sublime and I will hit Ctrl + tilde, and I'm gonna paste in that text right there and hit Return. Now it's done, so we see, please restart Sublime. So let's close that out. Open it up one more time, and now package control is available to us. So we can access that in two ways. We can go to Sublime > Preferences > Package Control, or once again let's just search for it. Package control. And now you see all of the options that are available to you. So nine times outta ten, what you're going to be most interested in is installing a package. But there's also upgrade packages, as well as disable package. So in our case, we want install. So I will click that. But an easier way, because you will be doing this all the time, is to bring up the command pallet and just type install. Install > Enter and now we have a list of all of the items in that repo that are available and there is a lot. In this course we are going to be going over a handful of the ones that I find to be most convenient in my daily workflow. So in our case. I don't even know what the package is that I need, I just know I need syntax highlighting for Blade, so let's figure it out. Shift command p install, and I'm gonna look for Blade. And take a look here's four of them. We have blade snippets and those will be shortcuts, I'm not gonna worry about that. Laravel blade, blade syntax highlighting support and that's exactly what we need. So I'm gonna hit enter and take a look at the bottom of the screen. Laravel successfully installed Blade, and we don't even have to restart. Now if I hit Shift+Cmd+B to bring up all the syntaxes, and I type blade, now we have that option. So when I said five seconds, I literally meant five seconds. Hit Enter, and now we have Blade support. Let's try another one just to see the workflow. We're gonna create a new file and we'll save it as module.coffee. WIthin the public directory, just put it in the JS folder for now. Coffee script is a language on top of JavaScript. So we can say name equals Jeff without using semicolons or var, and I could say console.log great if name equals Jeff. You can do stuff like that. But without syntax highlighting support, this is very difficult to read. So let's see if it's built-in. Coffee script, nope, I don't see that there. I can browse through syntax. Nope, it's not there. Well let's install it. Shift+Cmd+P, install, coffee scripts and there is a couple here but what I want is the syntax highlighting version. That's installed. Now we can add coffee script, and now we have support for coffee script syntax highlighting. So cool.

Back to the top