Sublime Text: Efficient Python Editor

While the environment in which you write your code is not that important and it is just a personal preference, you might like to know that throughout my Scrapy course, I use a robust text editor called Sublime Text.

Sublime Text is light-weight, fast and easy to get the hang off text editor that you can use for writing Python scripts. It also supports almost all other programming languages. Let’s see how to make the best use of it.

Sublime Text Installation

The installation process is straightforward; once you go to Sublime Text homepage: https://www.sublimetext.com/, you can see the download button for your operating system.

After installing Sublime Text, you are ready to use it.

 

 

Package Control Installation

One of the best features Sublime Text has is Package Control. To install it, simply press the shortcut: Ctrl+Shift+p (Linux/Windows) or Command+Shift+p (Mac).

Once you get a line from the drop-down saying: “Install Package Control”, hit Enter to install it.

Sublime Text Package Control installation

After that, you will get a message that it was successfully installed.

Sublime Text Package Control installed

By having the Package Control tool, you have a huge amount of packages (themes, color schemes, extensions, etc…) ready to use. You just need to find them, luckily there is a website which is actually a database of them: https://packagecontrol.io/

Here, you can see bunch of tabs with packages listed that after you go to them will have: description, installation guides, screenshots, etc…

 

Color Scheme Change

Installing packages from Package Control is also a straightforward task, let’s say that you want to install some specific color scheme to change look of the default one that we get out of the box.

We can use this one as an example: https://packagecontrol.io/packages/1337%20Color%20Scheme

So navigate to Sublime Text and once again reuse this shortcut: ctrl+shift+p (Linux/Windows) or Command+Shift+p (Mac).

Then type in: install package

Sublime Text Package Control install packages

After that, hit Enter to install the package from package control. This will take a few seconds while it loads all packages available.

After loading, you can simply type “1337” and our color scheme will pop-up. Finally, hit Enter and in a moment or two, we installed it!

Sublime Text Package Control color scheme

To start using it we can go to Preferences → Color Scheme, and you can then select it from the drop down menu.

The color scheme that is used throughout the Scrapy course is called “Oceanic Next” and you can find it here:

https://packagecontrol.io/packages/Oceanic%20Next%20Color%20Scheme

Pretty JSON

One of the extensions that is also important is “Pretty JSON”; we use it to prettify/format JSON results, you can find more info about the package: https://packagecontrol.io/packages/Pretty%20JSON

Sublime Text Package Control Pretty JSON

Shortcuts

Finally, to be more efficient/faster when you code, I would strongly suggest to spend at least couple of hours learning in depth all shortcuts that Sublime Text has in its arsenal. Once you learn them, you will never look back! One major downside to this is that your mouse will become lonely 🙂

Shortcuts for Windows/Linux users:

http://docs.sublimetext.info/en/latest/reference/keyboard_shortcuts_win.html

Shortcuts for Mac users:

http://docs.sublimetext.info/en/latest/reference/keyboard_shortcuts_osx.html

Rating: 5.0/5. From 1 vote.
Please wait...

Leave a Reply