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

sublack

by jgirardet ST3

Black integration in SublimeText

Details

Installs

  • Total 156
  • Win 35
  • OS X 73
  • Linux 48
Jun 22 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
Windows 0 4 4 2 0 1 3 2 1 3 3 0 1 2 4 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
OS X 0 1 1 6 2 3 4 3 4 6 8 6 2 3 4 3 12 9 2 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0
Linux 1 4 2 9 3 2 2 6 2 4 4 1 1 0 6 4 7 3 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0

Readme

Source
raw.​githubusercontent.​com
/readmes/img/83e009b6139b4e15b8734f5e9b24c0891f5ae44c.svg

sublack

Black integration for SublimeText

Usage

  • Run Black on current file:

    Press Ctrl-Alt-B to format the entire file. You can also Ctrl-Shift-P (Mac: Cmd-Shift-P) and select Sublack: Format file.

  • Run Black with --diff:

    Press Ctrl-Alt-Shift-B will show diff in a new tab. You can also Ctrl-Shift-P (Mac: Cmd-Shift-P) and select Sublack: Diff file.

Installation

  1. Install Black (if you haven't already):

    pip install black # Requires python 3.6
    
  2. In PackageControl just find sublack, and that's it !

or

Without PackageControl install manually by navigating to Sublime's Packages folder and cloning this repository:

git clone https://github.com/jgirardet/sublack.git

Settings

Global settings

Preferences -> Package Settings -> sublack -> settings :

  • black_command:

    Set custom location. Default = "black".

  • black_on_save:

    Black is always run before saving file. Default = false.

  • black_line_length:

    Set custom line length option used by Black. Default = null which lets black default.

  • black_fast:

    Black fast mode. default is false.

  • black_debug_on:

    Show non error messages in console. Default = false. Error messages are always shown in console.

  • black_default_encoding:

    Should not be changed. Only needed on some OSX platforms.

Project settings

Just add sublack as prefix (recommended):

{
"settings":{
    "sublack.black_on_save": true
    }
}

A sublack subsettings is still possible:

{
"settings":{
    "sublack":{
            "black_on_save": true
            }
    }
}

Issues

If there is something wrong with this plugin, add an issue on GitHub and I'll try to address it.

Thanks

This plugin is very inspired by the very good PyYapf Plugin. Thanks to Jason Kane.

Changelog

see install.txt

Contributing

  • remove sublack via Package Control.
  • fork sublack
  • clone your sublack fork to your Packages folder (Preferences --> Browse Packages...).
  • install UnitTesting in Package Control
  • adding a test for new features or bugfix is really nice if you can.
  • add your name to Authors in readme.

Authors

Laboriously coded by Jimmy Girardet

contributions by: