ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

python-black

by thep0y ST4

Black formatter for Sublime Text

Labels formatter

Details

Installs

  • Total 664
  • Win 297
  • Mac 226
  • Linux 141
Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14
Windows 0 3 4 7 3 7 4 7 7 8 6 6 8 7 9 6 10 6 3 3 2 5 4 7 4 4 5 3 8 2 7 6 9 7 4 4 9 3 7 5 3 2 8 8 10 11
Mac 0 7 6 3 0 0 7 6 6 5 5 3 2 1 1 2 3 4 3 2 5 4 4 5 1 2 3 3 4 4 12 11 4 8 7 6 1 5 4 3 4 4 9 6 3 5
Linux 0 3 2 1 3 5 3 2 1 5 6 1 1 1 4 6 4 1 0 1 2 6 2 2 4 1 1 3 5 5 2 3 4 3 4 0 3 2 4 1 2 3 2 2 4 5

Readme

Source
raw.​githubusercontent.​com

python-black

Black formatter for Sublime Text.

It is recommended to use with LSP-pyright.

Installation

There is no need to install black, but if you install it, it will not affect this package.

You can install python-black with package control:

  1. Open your command pallete and type Package Control: Install Package.
  2. Find this project python-black and press Enter.

Local installation

This package has been uploaded to packagecontrol.io, so you do not need to choose local installation:

git clone https://github.com/thep0y/python-black.git

Copy or move the python-black folder to the packages directory of Sublime Text 4.

Usage

1 Key Binding

You can create custom key binding based on samplePreferences - Package Settings - Python Black - Key Bindings, such as:

{
     "keys": [
         "ctrl+super+l"
     ],
     "command": "black"
}

:warning:Note: Do not duplicate the key binding of other packages

2 Settings

There is only one modifiable property in settings:

{
   // Whether to automatically format the entire document when saving
   "format_on_save": true
}

3 Create Black Configuration File

You can quickly generate a black configuration file for the current project.

Command Description
python-black: Create Black Configuration File Creates a pyproject.toml file in the root of the project with basic options. Opens the configuration file if it already exists.

TODO

  • [ ] format all python files in the current project

If someone likes or gives feedback, some features may be added in the future.