Enable formatting on save
I've usually been against auto-formatting on save and instead preferred to trigger it manually using its own keybinding. I'm enabling it for now to see how I feel about it and I'll either keep or revert it.
This commit is contained in:
parent
e8531ba993
commit
b00cef78af
|
@ -13,6 +13,12 @@ conform.setup {
|
|||
},
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
conform.format { lsp_fallback = true, async = false, timeout_ms = 500 }
|
||||
end)
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
callback = function(args)
|
||||
conform.format {
|
||||
bufnr = args.buf,
|
||||
lsp_fallback = true,
|
||||
quiet = true,
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
|
Reference in a new issue