- Overview
- Transcript
2.4 The Command Palette
You're going to love Sublime's command palette. With a simple keystroke, you can make any number of modifications in seconds.
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
2.4 The Command Palette
I'm going to create a new file, and on the Mac, I can do it with Cmd+N. And what that's going to do is create an empty tab, and notice that I can click on these tabs and move them around however I want. I can also right-click and have some additional options like close other tabs. So let's hit Cmd+S, or Ctrl+S on the Windows, to save, and we'll call it test.js. We're gonna create a test JavaScript file. Now, I want you to note that based on the extension, it will automatically set the syntax, which is fine. But let's say, for some reason, syntax to Markdown, something like that. So now we know, of course, that when we add our code, nope, it's not being highlighted correctly. So there's a couple of ways to change the syntax, and you'll find yourself doing this quite a bit. Again, you can come back down here and manually find the one that you want and switch it over to JavaScript, but a much better way is to use the Command Palette. If I go to Tools > Command Palette at the top. You'll see on the Mac, it's Shift+Cmd+P. Now, this is going to be one of your favorite features of Sublime. This is essentially replicating the entire menu bar within this box. And now we can use fuzzy searching to determine exactly what we want. So, for example, in this case, we want to change the syntax to JavaScript. Well, in this case, I would hit Shift+Cmd+P. And now I would type syntax, and now notice that it has all of the items that are available. So in this case, syntax, and I wanna set it to JavaScript, so I can type just a couple of those letters. And again, notice that it's fuzzy searching, and if you're not familiar with that term, fuzzy searching means I don't have to type the characters in order. It's just going to return all of the items where the letters that I type exist. So in this case, if I hit capital S, it's still going to make that available because we're using fuzzy searching. It found a j, it found an s, it found a t. But most of the time, Shift+Cmd+P, syntax JavaScript, and now we've instantly updated it and you can see there. Now, let's set the syntax back to Markdown just for a second. An easier way is, because we know we're using fuzzy searching, I don't really even need to type syntax. Shift+Cmd+T, JavaScript, done. Shift+Cmd+P, markdown, done, and that's a lot quicker. And this needs to be the cycle that you get into. Try to use the mouse as little as possible, and that's one of the keys to being superfast in your coding environment. Touch that mouse as little as humanly possible. And on that note, do keep in mind I'm going to be touching the mouse a lot more because I'm doing a course and I have to point these things out. But in my normal workflow, I very rarely touch it. So let's bring the Command Palette up once again, and you'll see in addition to showing all of the items that are available, it'll also give you some shortcuts. So if I type sidebar, you'll see that we have the option to toggle the sidebar. So now, that's an easy way when you wanna get rid of the sidebar, or in this case, bring it back. Shift+Cmd+P, sidebar, and now it's back. Now actually, in this case, this is one of the few keyboard shortcuts that I've remember, Cmd+K+B. Cmd+K+B, it's a toggle each time. Now, I say it's one of the few ones because I've learned over the years that there's only so many keyboard shortcuts that you can remember, and that's why a tool like this Command Palette is so powerful. I don't have to remember the odd shortcut to change the syntax, whether it's Shift+Ctrl+Cmd+S, I can't remember all of that. I can remember a few, but with the Command Palette, I can just look for the syntax. I can search for what I need. I need to change the sidebar. But of course, the ones that you use most frequently, like adjusting the sidebar, yeah, KB, that's an easy one to remember. So what I recommend is, when you bring this up, just try to commit some of these to memory. Anything that you would ever want to toggle, well, just type toggle, and now you can see all of the options. So, if you don't like the minimap here, we can look for minimap or toggle minimap. There it is, and now we've gotten rid of it, but I'm gonna bring that back because I like it. And that does it for this lesson. In the next one, I'm gonna show you how to very quickly go to any file on your project without even looking at the sidebar.