Skip to content

Commit

Permalink
Merge 28bf3ed into cea13f4
Browse files Browse the repository at this point in the history
  • Loading branch information
ArjaanBuijk committed Apr 24, 2019
2 parents cea13f4 + 28bf3ed commit 6a4e51b
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -647,11 +647,11 @@ $ where black
3. Open External tools in PyCharm/IntelliJ IDEA

On macOS:

```PyCharm -> Preferences -> Tools -> External Tools```

On Windows / Linux / BSD:

```File -> Settings -> Tools -> External Tools```

4. Click the + icon to add a new external tool with the following values:
Expand All @@ -661,6 +661,7 @@ $ where black
- 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 or Settings -> Keymap -> External Tools -> External Tools - Black`.

6. Optionally, run Black on every file save:
Expand All @@ -676,6 +677,38 @@ $ where black
- Working directory: `$ProjectFileDir$`
- Uncheck "Auto-save edited files to trigger the watcher"



### Wing IDE

Wing supports black via the OS Commands tool, as explained in the Wing documentation on [pep8 formatting](https://wingware.com/doc/edit/pep8). The detailed procedure is:

1. Install `black`.

```console
$ pip install black
```

2. Make sure it runs from the command line, e.g.

```console
$ black --help
```

3. In Wing IDE, activate the **OS Commands** panel and define the command **black** to execute black on the currently selected file:

- Use the Tools -> OS Commands menu selection
- click on **+** in **OS Commands** -> New: Command line..
- Title: black
- Command Line: black %s
- I/O Encoding: Use Default
- Key Binding: F1
- [x] Raise OS Commands when executed
- [x] Auto-save files before execution
- [x] Line mode

4. Select a file in the editor and press **F1** , or whatever Key Binding you selected in step 3, to reformat the file.

### Vim

Commands and shortcuts:
Expand Down

0 comments on commit 6a4e51b

Please sign in to comment.