Git Product home page Git Product logo

sublack's Introduction

https://travis-ci.org/jgirardet/sublack.svg?branch=master

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

  • black_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.

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

1.6.0:
  • Change keymaps from f to b (like black oO) due to conflict with Anaconda.
  • Change installation instruction to use Packagecontrol.
1.5.0:
1.4.1:
  • add tests
  • Improve Settings menu entry and add Key Bindings menu entry(#9, thanks to catch22)
1.4.0:
  • add black_diff command
  • add black_diff keymap
  • add fast setting
  • refactor code
  • do nothing if already formated and show "already formated" in statusbar
1.3.4:
1.3.3:
  • Fix encoding if not given by SublimeText.
1.3.2:
  • BugFix : Click library Bug with locale under OSX
1.3.1:
  • update README
1.3.0:
  • use '-' argument to format inline document wihout saving it
  • consequently post-save became pre-save
  • line_length typo in settings
  • add log
1.2.0:
  • add error handling (thanks to nicokist)
1.1.0:
  • add line_length option
1.0.0:
  • make plugin
  • add on_save option

sublack's People

Contributors

jgirardet avatar nicokist avatar atadams avatar catch22 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.