From: Benjamin Wohlwend Date: Fri, 17 Aug 2018 15:44:55 +0000 (+0200) Subject: added instructions for PyCharm File Watcher setup (#418) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/450983e33309cdd8b6ad3849ee86e8b5b3903706 added instructions for PyCharm File Watcher setup (#418) * added instructions for PyCharm File Watcher setup With these steps, PyCharm will run black on every file save. * Update README.md --- diff --git a/README.md b/README.md index e360232..3becfd3 100644 --- a/README.md +++ b/README.md @@ -619,11 +619,22 @@ $ 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