nvim/lua/config/format.lua

15 lines
555 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' },
{
2024-11-02 22:44:40 +01:00
pattern = { '*.js', '*.mjs', '*.ts', '*.mts', '*.tsx', '*.vue', '*.css' },
2024-06-13 11:25:00 +02:00
command = function()
return 'prettier --stdin-filepath ' .. vim.api.nvim_buf_get_name(0)
end,
},
2025-02-07 14:59:55 +01:00
{ pattern = { "*.sql" }, command = "pg_format --spaces=2 --wrap-limit=1000 --no-rcfile" },
{ pattern = { "*.py", "*.pyi" }, command = "ruff check --select I --fix --silent - | ruff format -" }
2024-06-13 11:25:00 +02:00
},
})