Files
Dotfiles/.config/nvim/lua/plugins/conform.lua

27 lines
603 B
Lua

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