Overview
00:02 All right! Welcome to my video lessons on setting up Sublime Text for productive Python development. This is going to be a step-by-step guide to get the setup that I’m showing you now.
00:12 I just want to walk you through some of the cool things that you get from your Sublime Text setup that way. And these are just, you know, the highlights. There are many more visual tweaks and some things that I’ll probably forget to demonstrate, but I’m just trying to like recap most of them. So, first of all, you can see here we’re using a custom color scheme and a custom theme.
00:33 We’re also using a custom font. And personally, I really like these dark themes because they make it a lot easier to focus on the code for longer and they make everything a little bit more readable.
00:44 There are also number of other visual tweaks. We’re tweaking the font rendering settings, we’re adding these little lines here, so that will make it easier for you to actually write code that is PEP 8 compliant with the PEP 8 style guide.
00:57 There’s some settings that make it easier in terms of visual tweaks that show you exactly where the cursor is placed and make that a little bit less distracting.
01:04 And your indentation levels—we’ve also got a setting that will get rid of extra whitespace and you’ll be able to fit much more code on the screen at the same time.
01:14 I really like to edit my source code at the same time when I’m adding tests, writing tests for it, so I’m going to show you how to do that. Now, another thing that I’m showing you how to add is Python code completion.
01:28
Again, you can see here as I’m typing out this import
statement, it’s popping up a couple of recommendations here. So for example, if I want to import the abc
module, it’s going to tell me exactly what this module is about. I could also do something like this, where I’m going, okay, from collections import
and then let’s say we want the defaultdict
class.
01:52 And that, again, is going to work with the autocomplete and it’s going to show me exactly what this thing does here. All right! And then also what you’re seeing here on the left is that as I’m changing that file, it’s updating my Git status, so this is showing me some changes that I’ve made compared to the latest commit that’s in Git.
02:13 So if I go ahead and delete some of these lines here, it’s going to show up as a deleted section, and then I could go in and actually restore the section just by clicking this undo button. And again, this makes it really easy to interact with source control as well. Now, another cool feature is of course the autocompletion that I just showed you.
02:33 And this also works for your own code, right? So, the change that I’m going to make, that probably won’t really make a lot of sense. But again, you know, as I’m typing this out, I get an autocompletion for this method here and I’m also getting the docstring for this function.
02:52 And what I can also do if I wanted to jump to, if I wanted to find out where that function was actually defined, I could just right-click and go to Goto Definition, and that would bounce me to exactly where that piece of code is defined and I could learn more about it. So all of these are super helpful.
03:09 Another thing that I haven’t demonstrated yet is that we have inline code validation. So let’s say I’m making some simple formatting blunders here, like have some extra whitespace.
03:19 And as soon as I save the file, actually I’m going to get feedback on this line. It’s going to tell me that I’m having extra whitespace here that I shouldn’t have.
03:29
And I’m also getting feedback on some other things, you know, if I’m violating some best practices with my Python code. For example, I’m comparing this to None
with the ==
operator—then, again, the linter is going to tell me that I shouldn’t really compare this to None
with the ==
statement but I should rather use the is
statement. Also, if I’m calling a function that isn’t really defined here, then the linter would call me out on that and would tell me, “Hey, you probably have a bug in your code.” And all of this kind of happens inline as I’m writing the code and so this is super helpful.
04:01
I’ll also show you how to integrate Sublime Text with the command line. So here, for example, you can open an existing file directly with the subl
command from the command line.
04:12 I’ll also show you how to integrate the Git command line with Sublime Text so you can write your commit messages actually in Sublime Text. It will get proper syntax highlighting and it will show you how long your lines should be so you can follow these best practices.
04:26 All of this stuff is going to work together. We’re going to make sure we keep your sidebar here uncluttered, and we also want to make sure that we’re keeping your tab bar under control here so that it’s not getting super cluttered with extra tabs.
04:42 And so all of these things, they’re based on what I learned about working with Sublime Text for Python development and kind of my best productivity tweaks.
04:50 And I’m going to walk you from a completely blank operating system install—in this case, I’m using Ubuntu Linux—to having the exact setup that I’m using day in and out. And we’re going to do this in a couple of lessons that you can take independently, or you can also just go through all of them in a row.
05:08 And at the end, you’ll have exactly the setup that I just demonstrated here. All right, so have fun with the course! Best of luck with getting everything set up to your liking. Let’s get started with the first lesson.
You must own this product to join the conversation.