Setting up Sublime Text 3 for Python development

Software engineers like to evade who has the ‘best’ development environment – what are the best tools available? Which packages and plug-ins would it be advisable to utilize? These are the substantial inquiries.However, the main issue is this: once you have picked your preferred IDE you ought to invest a lot of time configuring it and figuring out how to receive the most in return.

One of such a text editor is Sublime Text 3. Sublime text is extremely fast, gets steady updates, and – as a major reward – completely cross-platform. Sublime’s awesome plug-in ecosystem is an add-on. There are many plug-ins accessible that make Python development extremely smooth and pleasant.

Let’s start

  • Installation

First install the Sublime Text 3.

Afterward, you need to do is install the package manager that enables you to include and remove the third-party plug-ins which will enhance your development condition.

Install by copying the Python code for Sublime Text 3. Tap View > Show Console to open the console. Now paste the code into the console. Press enter and Reboot ST3.

phython

You would now be able to install packages by utilizing the command cmd+shift+P. Begin typing install until the point when Package Control: Install Package shows up. Press Enter. Look for accessible packages.

  • Make a Custom Settings File

You can completely configure Sublime Text employing JSON-based settings files, making it simple to synchronize or transfer, your personalized settings to another framework. To begin with, make the customized settings. It’s best to make a base file for all the environments and language particular settings records.

  • To set up a base file select Sublime Text > Preferences > Settings – User. Add an empty JSON object to the document and insert your settings.

  • For language particular settings tap the Sublime Text > Preferences > Settings – More > Syntax Specific – User. At that point save the file with the given format: LANGUAGE.sublime-settings. Along these lines, for Python-particular settings, save as Python.sublime-settings.

Other than the packaged themes, you can make use of the following packages to accelerate the work process.

SideBar Enhancements

SideBar Enhancements works as sending files to your Recycle Bin rather than the deleted file being sent into obscurity, never to be returned from within the Sublime Text. It additionally offers a bundle of different traits incorporating having the capacity to make new files from the sidebar.

Requirements Txt

This is a basic module for requirements.txt files which gives syntax featuring. Requirements txt gives syntax highlight-lighting and autocompletion plus a decent form management framework for your requirements.txt files.

Anaconda

Anaconda is a very capable Python package for Sublime. It allows:

  • Python code autocompletion

  • Python linting (features both PEP8 infringement and syntax errors)

  • Python documentation

  • McCabe complexity checker

You can see the majority of the features inside the README file in the Package Settings: Sublime Text > Preferences > Package Settings > Anaconda > README.

  • All AutoComplete

All AutoComplete stretches out the default autocomplete to give autocompletion to every single open file.

  • GitGutter

GitGutter places a margin into Sublime Text which shows if a line has been included, deleted or edited. It is valuable for following whether you have rolled out improvements to past commits.

  • Layout

The lion’s share of layout choices is accessible within the view heading in the menu bar.

In Views – > Columns you can change the view to show 1, 2, 3, or 4 columns, or a grid of 2 * 2 sections, or 1 or 2 rows.

  • Custom Commands

It is not difficult to compose your own custom commands as well as key bindings with Python.

Copy the path of the present document to the clipboard.

Close all tabs aside from the active one.

Introduce them by adding the Python files to your directory of “/Sublime Text 3/Packages/User” through the file menu (Sublime > Preferences > Browse Packages).

After that open the User directory.

To finish the setup, bind them from the Key Bindings – User file (Sublime Text > Preferences > Package Settings >AdvancedNewFile> Key Bindings – User).

Command line tool

Sublime Text also incorporates a command line tool that enables you to open the editorial manager from the shell. The tool termed subl isn’t empowered as a default. To make it accessible from any shell do as given below:

ln – s/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/container/subl/usr/nearby/receptacle/subl

  • Console Shortcuts

Goto Anything (“cmd+p”) is utilized for rapidly finding and opening files. Simply type in a section of a path and filename inside a venture and you can without much of a stress open that document.

Goto Symbol (“cmd+r”) records all classes and functions inside a file to make them less difficult to discover. Just begin writing the one you need.

Goto Line Number (“ctrl+g”) takes you to a particular line number in the active document.

Go to start of the line (cmd+left-arrow key) and Go to end of the line (cmd+right-arrow key)

Multi-Edit is the most loved shortcut key

Delete current line (ctrl+shift+k)

Choose a word, press “cmd+d” to choose the following same word, press “cmd+d” again to choose the following same word.

Click “cmd+click” to make a cursor for editing wherever you click

CTRL + SHIFT + DOWN takes highlighted text down

CTRL + KK: deletes all from the cursor till the end of the line

CTRL + SHIFT + 1-4: takes the file to column 1-4

CTRL + W: closes the current tab

Copyright © 2024 Probytes.