This is an easy to install Vim integration for Black code formatter I use.
Use your favorite plugin manager.
Plug 'igorpejic/vim-black'
or
Plugin 'igorpejic/vim-black'
To run black on every save, add this to your ~/.vimrc
:
autocmd BufWritePost *.py execute ':Black'
This script was originally written by: Łukasz Langa.
The original version of the script can be found in the black repository.