25 lines
569 B
Lua
25 lines
569 B
Lua
vim.pack.add({
|
|
'https://github.com/stevearc/conform.nvim'
|
|
})
|
|
|
|
require('conform').setup({
|
|
formatters_by_ft = {
|
|
cpp = { "clang-format" },
|
|
python = { "black" }
|
|
},
|
|
-- Set default options
|
|
default_format_opts = {
|
|
lsp_format = "fallback",
|
|
},
|
|
-- Set up format-on-save
|
|
format_on_save = { timeout_ms = 1000 },
|
|
-- Customize formatters
|
|
formatters = {
|
|
['clang-format'] = {
|
|
append_args = function(self, ctx)
|
|
return { "-style={IndentWidth: 4}" }
|
|
end,
|
|
},
|
|
},
|
|
})
|