Locked learning resources

You must own this product to watch this lesson.

Locked learning resources

You must own this product to watch this lesson.

Overview

00:00 Hey, and welcome to my video course on setting up Sublime Text for Python development. I just want to give you a quick overview on the things we’re going to set up in this course and just walk you through some of the changes that we’re going to make. So, first of all, I’m going to show you how to install Sublime Text from scratch, I’m going to help you pick between Sublime Text 2 and 3, and we’re going to also install the plugin manager for Sublime Text.

00:23 Then we’re going to go ahead and set up Python from scratch. We’re going to integrate Python code linting—this is going to be a really helpful feature that’s going to give you feedback on your code as you write it. So for example, let’s say I’m introducing a bug here in this piece of code.

00:40 And then when I save the file, I will immediately get feedback from the code linter here directly inline. It’s going to tell me, “Hey! You’ve got an undefined name here, shouldn’t that be a self or something else?”?

00:52 And you’re also seeing this thing pop up here. This is inline code documentation. I’m showing you how to set up inline code documentation popups and also code completion for your Python code. So this is going to be a really, really useful feature and it works with all kinds of Python statements.

01:09 So for example, if we want to import a new module here, I’m just typing out the import statement and already I’m getting this popup here with the autocomplete. And let’s say we want to import the abc module. And again, as I type this out and accept the autocompletion, I’m getting this popup here that shows me the docstring for this module so that I then know exactly what I just selected. And of course, when I go into the abc module, again it shows me all of the different choices available here, for example the abc class. And again, it’s going to show me the docstring for that so I can write my implementation and actually use this functionality. So, this is a really nice, almost IDE-like setup that I’m going to show you how to configure with Sublime Text plugins. In my mind, it looks really pretty, and it’s really not in-your-face and really very supportive in working with your Python code and making it nice and pretty.

02:06 I’m also going to show you how to integrate Git with your Sublime Text setup. I’m going to show you how to set up this lightweight integration that, on the one hand, gives you updates on modifications you make to your code.

02:19 So for example, every time I modify a line and make some changes to it or add a bunch of newlines, I’m going to get these little icons here on the side that are going to tell me what changes I made here. And now, the cool thing is I can also hover over them.

02:34 For example, here, we deleted a couple of lines—I can just hover over that and roll back this particular change. And then, that way, I can make sure I’m not missing out on any modifications that I’ve made and maybe accidentally commit them because I wasn’t aware that I had changed a piece of code, maybe introduced a debug print statement or something like that.

02:54 I’m also going to show you how to write your commit messages with Sublime Text and, actually, how to set up Git also. I’m just going to walk you through how to do everything that I’m showing you with a blank macOS installed. We’re going to install Git, Sublime Text, and Python from scratch, and you’re going to end up with a setup that just works, and there’s no, like, magic steps that you need to take and there’s no confusion around in what order you need to install stuff—you just need to follow the course!

03:20 Another feature you can see here is that I’ve made a couple of visual tweaks to my Sublime Text setup here. I’m actually using a custom editor font, and I’m going to show you how to install those as well so that you can find your own favorite font and set that up in your editing environment. And we’ve made a couple of improvements to Sublime Text font rendering, there are a couple of tweaks you can make just to get this really nice and crisp and uncluttered.

03:45 I’m also showing you how to apply a custom color theme for the sidebar here and all of these additional areas in the Sublime Text window. And we’re also setting up a custom syntax highlighting scheme here.

03:58 So, you can just make this whole thing really pretty and really configure it to your liking, and then you’re going to be able to explore all of the different styles and different themes that Sublime Text has to offer.

04:09 There will also be a couple of tweaks to make it easier for you to write PEP 8 compliant code. PEP 8 is the most common style guide that is used in the Python community, so it really helps if you have an editor that’s going to give you feedback on your code and just make sure that by default what you’re doing adheres to some of the best practices.

04:28 So, we’re going to set this up so that you get your extra whitespace stripped automatically, and that you’re using the right tab settings for Python and that you have these indicators here so that you know how long your lines should be ideally.

04:41 And we’re just going to be building the setup that is really optimized for writing Python code inside Sublime Text. There will also be a couple of productivity tips. For example, I’m going to show you how to make this sidebar here a lot more useful with features like the ability to copy file contents here from a file, or just to duplicate a file or copy its path, and then use that.

05:01 And we’re also going to make sure that here, the tab bar area stays nice and usable so you can not get cluttered up with tons of open tabs. And of course, what I’m showing you here is a setup that I really like, where I can edit the test code here on the right-hand side and the actual production or implementation code at the same time.

05:21 I’m going to show you how to set that up because it’s a really nice setup for working with Python and it’s really powerful if you’re doing test-driven development. All right!

05:29 So with this guide, it’s probably best if you’re able to follow it step by step and actually work through all the videos in sequence, but of course you can also mix and match some of that and just jump to the sections that interest you the most.

05:44 But really, the powerful thing is if you’re starting from scratch, then you can know that these steps are all going to work together and they’re going to work correctly.

05:53 But I’m sure you’re going to have an awesome time setting up your Sublime Text and make it look really pretty and really functional. So, good luck with getting everything set up and enjoy the first lesson!

Avatar image for Sanjay Raisoni

Sanjay Raisoni on Jan. 12, 2023

I’d like to use Sublime Text 4. Why use earlier versions?

You must own this product to join the conversation.