nvim/lua/config/black.lua

8 lines
282 B
Lua
Raw Normal View History

2024-06-08 01:16:18 +02:00
vim.api.nvim_create_autocmd( { "BufWritePre" }, {
2024-05-23 08:33:22 +02:00
pattern = { "*.py", "*.pyi" },
2024-06-08 01:16:18 +02:00
callback = function(ev)
vim.api.nvim_command([[ :silent! %!/usr/bin/env black -q --stdin-filename % - ]])
2024-06-12 23:26:21 +02:00
vim.cmd.normal(vim.api.nvim_replace_termcodes('<C-o>', true, true, true))
2024-06-08 01:16:18 +02:00
end
2024-05-23 08:33:22 +02:00
})