All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
3 " Created: Mon Mar 26 23:27:53 2018 -0700
4 " Requires: Vim Ver7.0+
8 " This plugin formats Python files.
14 " - restore cursor/window position after formatting
16 " - use autoload script
18 if exists("g:load_black")
22 if v:version < 700 || !has('python3')
23 func! __BLACK_MISSING()
24 echo "The black.vim plugin requires vim7.0+ with Python 3.6 support."
26 command! Black :call __BLACK_MISSING()
27 command! BlackUpgrade :call __BLACK_MISSING()
28 command! BlackVersion :call __BLACK_MISSING()
32 let g:load_black = "py1.0"
33 if !exists("g:black_virtualenv")
35 let g:black_virtualenv = "~/.local/share/nvim/black"
37 let g:black_virtualenv = "~/.vim/black"
40 if !exists("g:black_fast")
43 if !exists("g:black_linelength")
44 let g:black_linelength = 88
46 if !exists("g:black_skip_string_normalization")
47 if exists("g:black_string_normalization")
48 let g:black_skip_string_normalization = !g:black_string_normalization
50 let g:black_skip_string_normalization = 0
53 if !exists("g:black_skip_magic_trailing_comma")
54 if exists("g:black_magic_trailing_comma")
55 let g:black_skip_magic_trailing_comma = !g:black_magic_trailing_comma
57 let g:black_skip_magic_trailing_comma = 0
60 if !exists("g:black_quiet")
63 if !exists("g:black_target_version")
64 let g:black_target_version = ""
66 if !exists("g:black_preview")
67 let g:black_preview = 0
70 function BlackComplete(ArgLead, CmdLine, CursorPos)
72 \ 'target_version=py27',
73 \ 'target_version=py36',
74 \ 'target_version=py37',
75 \ 'target_version=py38',
76 \ 'target_version=py39',
77 \ 'target_version=py310',
81 command! -nargs=* -complete=customlist,BlackComplete Black :call black#Black(<f-args>)
82 command! BlackUpgrade :call black#BlackUpgrade()
83 command! BlackVersion :call black#BlackVersion()