aliquote.org

October 6, 2022

How to configure neovim to properly format python code?. Simpler solution is to add this mapping to your after/ftplugin/python.vim: nmap <buffer> g= :!black --quiet %<cr>:redraw!<cr>:!isort -q %<cr>:redraw!<cr>. Not sure if we really need two redraw, but it works quite well. This could be put in an autocommand if we want to format on save, say. #vim