- Overview
- Transcript
2.7 Key Bindings
Ironically, one of the things that Sublime Text is most often criticized for is what I love so much about it! Configuration in Sublime takes the shape of a JavaScript object. This means that practically anything and everything can be modified.
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.7 Key Bindings
One of my favorite aspects of Sublime Text 2 is how just about everything can be modified to your preferences. I'll give you an example. If I go to, Sublime > Preferences > Key Bindings- Default. Every single keyboard shortcut is going to be defined in this file and this means you have complete control over it. No longer do you have to go on Google and search for how to modify a particular shortcut. You can do it all from this file in five seconds. So let's try one out for ourselves. By default, to toggle the sidebar, I press Cmd+K and then B, Cmd+K, B and now we have toggled the sidebar. If I do it again, as you'd expect, now the sidebar is gone. Now that's fine for me, but maybe you don't like that sequence and you'd rather change it to something a little more memorable. Maybe something like, Ctrl+S, if you're on the Mac, and if you're on Windows maybe something different, because that wouldn't be the best choice. The only thing you need to keep in mind is the key sequence that you assign, make sure that it's not already assigned to a different effect and many times that will just take a little bit of guess and check. So if I want to change the side bar effect, the easiest way is to look for the side bar. So I would hit Cmd+I to do incremental search and I'll type side bar and there we are. Right here on line 17. So now we see the command is called toggle_side_bar and the assigned shortcut is super, which translates to Cmd on the Mac. Super is a key that comes from Linux. So if we were to change this and for now I'm going to copy it, just so we have a backup. Now I'm going to change it to Ctrl+S. So now immediately after I save the file, if I hit Ctrl+S, I'm now toggling the side bar and maybe that's better for you. Now there's one problem though, and I'm going to reference this a few times in the course. Never edit the default files, and the reason is when the next version of Sublime Text 2 comes out, your modifications are going to be overwritten and that's specifically why you're provided with the Key Bindings User. The user file is where you'll make all of your customizations. So with that in mind, I'm gonna copy this and uncomment the one that comes before it and save it. Now we will go to Sublime > Preferences > User and within here, I can paste in my object with my key binding. Now in this case, there is only one object. So I need to remove the comma from the end. So now that's done. Once again, Ctrl+S to toggle at the side bar and when Sublime is updated, that will still work rather than being overwritten.