X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/9c8caecdd6434696d72bca38b93c179693fc2e4d..71bdd727a826e36bc19213c47a324b872439478f:/README.md diff --git a/README.md b/README.md index 8ace440..4ed3df8 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ content instead. *Black* makes code review faster by producing the smallest diffs possible. +Try it out now using the [Black Playground](https://black.now.sh). + --- *Contents:* **[Installation and usage](#installation-and-usage)** | @@ -617,17 +619,28 @@ $ where black - Name: Black - Description: Black is the uncompromising Python code formatter. - Program: - - Arguments: $FilePath$ + - Arguments: `$FilePath$` 5. Format the currently opened file by selecting `Tools -> External Tools -> black`. - Alternatively, you can set a keyboard shortcut by navigating to `Preferences -> Keymap -> External Tools -> External Tools - Black`. +6. Optionally, run Black on every file save: + + 1. Make sure you have the [File Watcher](https://plugins.jetbrains.com/plugin/7177-file-watchers) plugin installed. + 2. Go to `Preferences -> Tools -> File Watchers` and click `+` to add a new watcher: + - Name: Black + - File type: Python + - Scope: Project Files + - Program: + - Arguments: `$FilePath$` + - Output paths to refresh: `$FilePathRelativeToProjectRoot$` + - Working directory: `$ProjectFileDir$` ### Vim Commands and shortcuts: -* `,=` or `:Black` to format the entire file (ranges not supported); +* `:Black` to format the entire file (ranges not supported); * `:BlackUpgrade` to upgrade *Black* inside the virtualenv; * `:BlackVersion` to get the current version of *Black* inside the virtualenv. @@ -758,9 +771,12 @@ location of the file depends on the *Black* version and the system on which *Bla is run. The file is non-portable. The standard location on common operating systems is: -* Windows: `C:\\Users\\AppData\Local\black\black\Cache\\cache..pickle` -* macOS: `/Users//Library/Caches/black//cache..pickle` -* Linux: `/home//.cache/black//cache..pickle` +* Windows: `C:\\Users\\AppData\Local\black\black\Cache\\cache...pickle` +* macOS: `/Users//Library/Caches/black//cache...pickle` +* Linux: `/home//.cache/black//cache...pickle` + +`file-mode` is an int flag that determines whether the file was formatted as 3.6+ only, +as .pyi, and whether string normalization was omitted. ## Testimonials @@ -796,7 +812,7 @@ Using the badge in README.rst: ``` .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/ambv/black -``` +``` Looks like this: [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) @@ -826,8 +842,19 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md). ### 18.8b0 -* fix parsing of `__future__` imports with renames (#389) -* fix scope of `# fmt: off` when directly preceding `yield` and other nodes (#385) +* numeric literals are now normalized to include `_` separators on Python 3.6+ code + (#452) + +* cache is now populated when `--check` is successful for a file which speeds up + consecutive checks of properly formatted unmodified files (#448) + +* fixed parsing of `__future__` imports with renames (#389) + +* fixed scope of `# fmt: off` when directly preceding `yield` and other nodes (#385) + +* note: the Vim plugin stopped registering ``,=`` as a default chord as it turned out + to be a bad idea (#415) + ### 18.6b4 @@ -1196,6 +1223,7 @@ Multiple contributions by: * [Jonas Obrist](mailto:ojiidotch@gmail.com) * [Luka Sterbic](mailto:luka.sterbic@gmail.com) * [Miguel Gaiowski](mailto:miggaiowski@gmail.com) +* [Miroslav Shubernetskiy](mailto:miroslav@miki725.com) * [Neraste](neraste.herr10@gmail.com) * [Osaetin Daniel](mailto:osaetindaniel@gmail.com) * [Peter Bengtsson](mailto:mail@peterbe.com)