Locked learning resources

You must own this product to watch this lesson.

Locked learning resources

You must own this product to watch this lesson.

Productivity Tweaks

00:00 Welcome to the next lesson. In this one, I want to show you two productivity tweaks you can apply to your Sublime Text setup with two extra plugins you can install. They’re going to help with the sidebar area here, make that a little bit more useful.

00:13 And then we’re also going to install a plugin that is going to help you keep the tab bar area under control and kind of make sure it doesn’t clutter up as easily. All right, so let’s jump in.

00:24 I want to show you the first plugin here, and that has to do with the sidebar. So right now, when you right-click on a file in the sidebar, you have a limited number of options here.

00:36 It’s the same with folders. It’s very limited what you can do here. But there’s a plugin that adds a lot more options to the context menu here in the sidebar, so let’s install that now. We can do that, again, by going through the Install Package and then searching for SideBarEnhancements.

00:52 That’s the one we want. We’re going to install that. And again, of course, after we installed it, we need to quit Sublime. Okay, so we’re back in Sublime Text.

01:00 What you can see now is that when you right-click on a file here, we’re getting a lot more options in this context menu. Now all of a sudden we can do all the things we could do before, but we can actually create new files, we can create new folders, we can open this file in a browser, which is great if you’re working on any kind of web app.

01:22 We can select a special application to open this file with and we can copy the path of that file, or we can even copy the contents of that file as text, we can duplicate it—we can do a bunch of things here that are just a lot more useful than what was here before. And the same thing applies for folders as well, so now we have a lot more options for the context menu here in the sidebar.

01:46 This is really helpful for a lot of the editing work that you’ll want to do, so this can often save you from having to jump into the Finder to make some of these changes, because you can just duplicate a file… Like, what I like to do, for example, is sometimes I have some kind of HTML template that all of my new templates need to be based on, so it kind of helps to just duplicate that directly and then you can give it a new name and you can just continue working with it and you don’t have to jump to the command line or to the Finder. So, I kind of like that.

02:16 Speaking of the sidebar and reducing clutter, sometimes you can get a couple of unwanted files showing up here in the sidebar. For example, if you’re on a Mac, you’ll frequently get these .DS_Store files that are just hidden system files that you don’t really need to see here in the sidebar or things like the __pycache__/ folder and a bunch of folders that are really not necessary for you to see here in the sidebar and are just cluttering the whole thing up.

02:40 So, there is actually a way to fix that. And again, you want to go back to your user settings in Sublime Text.

02:48 And there are two settings we can change here, two options that allow us to exclude some types of files from the sidebar and it also excludes some kinds of folders from the sidebar.

02:58 The first one is called "file_exclude_patterns". And again, that would be a list of file patterns that we want to exclude. And then there’s also "folder_exclude_patterns" and it looks basically the same, just for folders.

03:17 And now I have a list of things that I like to exclude that has kind of grown over the years, and I’m just going to copy and paste that in for you. In case you want to use the same settings here and the same patterns that I’m using, then it probably makes sense for you to go and find the ZIP file that came with the videos, and there you can just copy and paste all of these patterns over because it’s going to be a little bit frustrating having to type them all in. It’s just about, like, 20 or 25 patterns, so I’m just going to get them and copy and paste them in.

03:49 Okay, so I just did that. I copied and pasted all of these settings in here. And you can see a bunch of file types and file patterns that we don’t really want to see in the sidebar. Like, all of these intermediate files, like the PYC files or the .DS_Store files—they’re all kind of useless. And it’s the same with these folders.

04:06 Usually, you don’t want to see your .git/ folder in there or the __pycache__/ folder. And just to show you how this works, when I switch back to the window with the sidebar here, let’s say we don’t want to see TXT files… Or actually, let’s say we don’t want to see RST files here in the sidebar, because there’s a couple more of those.

04:24 I would just go in and add a new pattern here and then save that, and it would update and then hide all of these files. Now, of course, it will look like they’ve disappeared, but they’re only hidden here in the sidebar.

04:35 So if you undo this and actually get rid of this pattern and save again, then of course they’re going to show up again. This is a really flexible way to actually, you know, not make this thing a file browser here on the sidebar, but to actually make the sidebar a very specialized browser for just the relevant files that you need to see and exclude stuff like that, that you don’t need to see all the time.

04:57 Some people go and even hide things like your .gitignore file. They don’t need to see that all the time and they didn’t want it to clutter up the sidebar here.

05:06 So you could hide those files as well. I still keep them around, but I definitely don’t want to see those file types usually, so that’s why I exclude them from my settings. Okay, one more awesome plugin that I’ve been using for a number of years now, and that has to do with how the tab bar works.

05:23 This is a really convenient thing for switching between files, but it can also get super cluttered, right? Because if you’re opening a bunch of files—and with a big project, this is just always going to happen—it becomes unusable. Because now you can’t really tell, “Okay, which file is which?” Like, “How do I switch around here?” And, sure, you can rearrange them, but it was just really making this whole tab thing completely unusable for me.

05:47 And then, of course, there’s also the Goto functionality, the Goto anything functionality, where you can just jump to a file like that. For some reason, I still want to see what files I have open.

05:57 And I finally found a way to deal with that. This thing is called the Zen Tabs plugin and we’re going to install that now. So again, we’re going to go through Install Package, and we’re going to install the Zen Tabs plugin. Okay, so we need to make a couple of changes here to the preferences for that plugin.

06:17 We’re going to go to Package Settings and then find Zen Tabs and go to the user settings here. All right, and we’re just going to start a new settings file here, and we’re going to add this "open_tab_limit" setting, and we’re just going to set that to 5. So, 5 is the limit that I use, but obviously you want to play with that depending on your monitor size and your personal preference. And again, we’re going to restart Sublime Text.

06:43 All right, and so now Zen Tabs is going to keep a limit for the number of open tabs that we can have here. I’ve got this one tab open at the moment, and as soon as I keep adding more tabs by opening more files, and you can see as we’re past the tab limit, Zen Tabs will swap out the older tabs for the new one I want to open.

07:03 This is going to make sure the tab bar area remains uncluttered and it makes it a lot easier to switch between files, because that way I can always see which files I have open and I can always see their file names and their modification status. Actually, speaking of modification, you might be wondering what happens when I edit a file or modify it and then open more tabs. Will Zen Tabs just close my file that I just edited?

07:26 Let’s try that out. I’m just going to make a bunch of modifications here, and now I’m going to open a few more files.

07:33 What you can see here is that the modified files will always stay open and Zen Tabs is just going to replace non-modified files. It will always bump up the tab limit if you have modified files open.

07:44 And in the two years I’ve been using Zen Tabs, I’ve never lost any data due to it. It’s been just rock solid and worked extremely well and it made sure that my tab bar area is nice and clean. And for that reason, I really like this plugin.

07:57 Sometimes, it’s all about getting these little details right and making sure that your editor isn’t driving you nuts with a cluttered tab bar, because you want to see what files you’re working with. All right, cool!

08:07 Just to recap, in this video I walked you through some extra productivity tips. We make the sidebar area here a lot more useful. We made sure it doesn’t get cluttered up with useless file types here and added a couple more options to the context menu.

08:19 And then we also installed a plugin to make sure the tab area here is managed and we’re putting a limit on the number of open tabs to make sure this area actually stays useful here and we don’t have to resort to other means for jumping between files. And these two things really add up and just make your setup nicer.

08:38 What I really like about Sublime Text is that you can actually go in and fix these things that are upsetting you because it’s so malleable and there’s so many plugins that you can install. You could even write your own plugins to do your own fixes there. It’s actually all written in Python, so that’s definitely an option. Cool! Well, enjoy your new Sublime Text setup.

Avatar image for Raul C Pena

Raul C Pena on April 2, 2020

FYI installing SideBarEnhancement is no longer within the Package Install. I had to go to the github repository and download the files into my ST packages and restart ST and it is now working

Avatar image for alphapolaris

alphapolaris on Aug. 29, 2020

@Rual, The “SideBarEnhancements” is good to install through Package manager. Please check out the official site here: packagecontrol.io/packages/SideBarEnhancements

Avatar image for amirrastkhadiv

amirrastkhadiv on Jan. 5, 2021

Could you please explain how to run the code with the Sublime Text?

Avatar image for Bartosz Zaczyński

Bartosz Zaczyński RP Team on Jan. 7, 2021

@amirrastkhadiv As long as “Python” is the selected syntax highlighting for the currently opened file, you can choose Tools | Build command from the menu at the top of the window. Alternatively, you can use the corresponding keyboard shortcut such as Ctrl + B (Command + B on macOS).

You must own this product to join the conversation.