2024-06-13 11:25:00 +02:00
|
|
|
require('nvim-format-buffer').setup({
|
|
|
|
verbose = false,
|
|
|
|
format_rules = {
|
|
|
|
{ pattern = { '*.c', '*.h' }, command = 'clang-format' },
|
2024-07-19 18:51:47 +02:00
|
|
|
{ pattern = { '*.py', '*.pyi' }, command = 'black -q --stdin-filename % - 2>/dev/null | isort -q - 2>/dev/null' },
|
2024-06-13 11:25:00 +02:00
|
|
|
{
|
|
|
|
pattern = { '*.js', '*.ts', '*.tsx', '*.vue', '*.css' },
|
|
|
|
command = function()
|
|
|
|
return 'prettier --stdin-filepath ' .. vim.api.nvim_buf_get_name(0)
|
|
|
|
end,
|
|
|
|
},
|
2024-08-22 12:38:56 +02:00
|
|
|
{ pattern = { "*.sql" }, command = "pg_format --spaces=2 --wrap-limit=1000 --no-rcfile" }
|
2024-06-13 11:25:00 +02:00
|
|
|
},
|
|
|
|
})
|