PyCharm/IntelliJ IDEA¶

Brew reinstall vim -with-override-system-vi -with-python3 -with-lua -HEAD VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 15 2017 21:17:21) MacOS X (unix) version. Once you’ve installed HomeBrew, you can install Vim: brew install vim Linux users. As always for these type of programs, the Linux installation is the easiest: sudo apt-get install vim Windows users. Installing Vim on windows is not as fast as it is for UNIX. Follow this eight step guide. Now comes the best part — modifying Vim’s. I've got Vim installed on MacOS using Brew and it installs with +python3 support for Python 3.7.2 by default. I'm writing a Vim plugin which utilises some Python 3.7 and would like this to be able to work on parity with Linux with how it works on MacOS. The assumption being both Python 2.x AND Python 3.x could potentially be used. I've installed both python 2.x and python3 - no issues. While installing Vim via Homebrew, no matter what happens only support support for one interpreter is compiled in. You need to compile Vim yourself or get a prebuilt Vim package that was compiled with Python support. If you're on a Debian based system, the easiest way is to download the vim-gnome or vim-gtk package from apt (apt install vim-gtk for instance). Other distros might have a similar package with python support built in.
Brew Install Vim With Python3 Usb
Install
black.
Locate your
blackinstallation folder.
On macOS / Linux / BSD:
On Windows:
Brew Install Python3 Pip
Note that if you are using a virtual environment detected by PyCharm, this is anunneeded step. In this case the path to black is $PyInterpreterDirectory$/black.

Open External tools in PyCharm/IntelliJ IDEA

On macOS:
PyCharm->Preferences->Tools->ExternalTools
On Windows / Linux / BSD:
Vim Python3 Support
File->Settings->Tools->ExternalTools

Brew Install Vim With Python3 Key
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$'
Format the currently opened file by selecting
Tools->ExternalTools->black.Alternatively, you can set a keyboard shortcut by navigating to
PreferencesorSettings->Keymap->ExternalTools->ExternalTools-Black.
Optionally, run Black on every file save:
Make sure you have theFile Watchers plugininstalled.
Go to
PreferencesorSettings->Tools->FileWatchersand click+to add anew watcher:Name: Black
File type: Python
Scope: Project Files
Program: <install_location_from_step_2>
Arguments:
$FilePath$Output paths to refresh:
$FilePath$Working directory:
$ProjectFileDir$
Uncheck “Auto-save edited files to trigger the watcher” in Advanced Options
