Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: Add instructions for PyCharm #81

Merged
merged 8 commits into from
Apr 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,34 @@ keep it.
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: <install_location_from_step_2>
- Arguments: $FilePath$

5. Format the currently opened file by selecting `Tools -> External Tools -> black`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add instructions on how to map it as a keymap. (You can simply do it through the regular keymap settings). It'll be there in External Tools

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the instructions as a bullet point on the next line.

- Alternatively, you can set a keyboard shortcut by navigating to `Preferences -> Keymap`.


### Vim

Commands and shortcuts:
Expand Down