nvim/lua/config/format.lua

14 lines
431 B
Lua
Raw Normal View History

2024-06-13 11:25:00 +02:00
require('nvim-format-buffer').setup({
verbose = false,
format_rules = {
{ pattern = { '*.c', '*.h' }, command = 'clang-format' },
{ pattern = { '*.py', '*.pyi' }, command = 'black -q --stdin-filename % - | isort -q -' },
{
pattern = { '*.js', '*.ts', '*.tsx', '*.vue', '*.css' },
command = function()
return 'prettier --stdin-filepath ' .. vim.api.nvim_buf_get_name(0)
end,
},
},
})