From: Steven M. Vascellaro Date: Mon, 9 Apr 2018 19:00:37 +0000 (-0400) Subject: README: Add instructions for PyCharm (#81) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/ecc294741ea1ced1d95fa8fee1781d1c5a15e669?ds=sidebyside README: Add instructions for PyCharm (#81) Instructions to add `black` to "External Tools" in PyCharm. Adapted from https://kirankoduru.github.io/python/pylint-with-pycharm.html --- diff --git a/README.md b/README.md index 68bf4f0..5c04215 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,34 @@ you should tell Flake8 to ignore these warnings. Use [proofit404/blacken](https://github.com/proofit404/blacken). +### PyCharm + +1. Install `black`. + + $ pip install black + +2. Locate your `black` installation folder. + + $ which black # MacOS/Linux + /usr/local/bin/black # possible location + + + + $ where black # Windows + %LocalAppData%\Programs\Python\Python36-32\Scripts\black.exe # possible location + +3. Open External tools in PyCharm with `File -> Settings -> Tools -> External Tools`. + +4. Click the + icon to add a new external tool with the following values: + - Name: Black + - Description: Black is the uncompromising Python code formatter. + - Program: + - 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`. + + ### Vim Commands and shortcuts: