X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/8a84bebcfcabddfd5b82a8cff0b830a745999b6c..9ce100ba61b6738298d86818a3d0eee7b18bfed7:/docs/integrations/editors.md?ds=inline diff --git a/docs/integrations/editors.md b/docs/integrations/editors.md index 5d2f83a..1c7879b 100644 --- a/docs/integrations/editors.md +++ b/docs/integrations/editors.md @@ -189,10 +189,13 @@ If you need to do anything special to make your virtualenv work and install _Bla example you want to run a version from main), create a virtualenv manually and point `g:black_virtualenv` to it. The plugin will use it. -To run _Black_ on save, add the following line to `.vimrc` or `init.vim`: +To run _Black_ on save, add the following lines to `.vimrc` or `init.vim`: ``` -autocmd BufWritePre *.py execute ':Black' +augroup black_on_save + autocmd! + autocmd BufWritePre *.py Black +augroup end ``` To run _Black_ on a key press (e.g. F9 below), add this: