1 karma · joined July 31, 2026
As for whether it would be buggy, I'd doubt it? Unless Black's principle of operation is different from most formatters, it should just write the formatted contents to the file, right? The autocommand you'd use would just run Black on your current file on each save. So where % is Vim's symbol for the name of the currently open file, :silent! suppresses stdout/stderr from the formatter, and :! runs a command:
autocmd BufWritePost *.py silent! !<format_cmd> %
(Don't quote me on that, but it should be essentially correct. I'm not at a computer right now.)
Actually, it looks like you can install an (n)vim plugin from the official Black repo here:
https://github.com/psf/black/blob/main/plugin/black.vim
And then the autocmd would be
autocmd BufWritePost *.py silent! Black
This stuff is documented here: https://black.readthedocs.io/en/stable/integrations/editors....
Anyway, I think it's actually a really cool effect of doing this that you realize a lot of the scaffolding underneath most editors _isn't_ that complicated! It's totally understandable :)
It can definitely lead you down all sorts of twisty paths if you look at other people's elaborate configs and decide to do that sort of stuff yourself but it's very pleasant/low-maintenance if you stick to the basics (meaning roughly what people do with VSCode). It takes me roughly a few minutes to configure Neovim for a new language :)
(Of course, there's some other stuff in my init.lua that I've put there for fun, like clipboard and window management scripts, but that's not strictly necessary. I've spent a bit more time figuring out the Lua API to write these, but I personally think it's worth it for the extra ability to mold the editor to my needs).
I wish they'd add a Vi mode. ;)
[1] https://github.com/noctuid/dotfiles/blob/master/emacs/editin...
The default LSP client config at https://github.com/neovim/nvim-lspconfig#suggested-configura... sets everything up for you, if you're using an LSP server. I'm not sure why it hasn't been merged into the Neovim repo; possibly because they want to keep the editor core fast and minimal.
All this means you have to do a little more configuring than with something like VSCode, but to be honest, I haven't legitimately needed to make big changes to my config in a few years. There's stuff I add for fun (like little lua scripts to manage my clipboard and to layout tabs the way I want), but to maintain a 'VSCode' level of functionality none of it's needed. The advantage of spending a little extra time, for me, has been that my editor 'fits like a glove', so to speak :)
Agree that the documentation for all of this could be a lot better and more discoverable. It's good once you get over the initial hump though.
In any case, thanks for taking the time to offer a more charitable perspective on the comment I responded to.
It is absolutely reasonable to ask people to reconsider their prejudices. Your line of thought does nothing but reinforce people’s existing biases without leaving room for the nuance of social context. Racists misuse statistics all the time to justify their awfulness. Consider whether you’re really different from any of those people. Or do I just need to get to know you more?