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 230
  • Win 106
  • Mac 82
  • Linux 42
Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8
Windows 7 5 3 2 8 8 10 11 7 15 8 4 4 9 9 5 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 4 3 4 4 9 6 3 5 8 3 5 7 3 12 3 5 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 4 1 2 3 2 2 4 5 3 3 3 3 3 4 1 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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.