Automatically format files with LSP before write.

This commit is contained in:
Warwick 2023-11-14 10:47:38 +00:00
parent 368b931dc8
commit b83bbf0fdf

View file

@ -19,9 +19,9 @@ vim.opt.expandtab = true
vim.opt.number = true
-- Use LSP to format bufer automatically just before write
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = buffer,
callback = function()
vim.lsp.buf.format { async = false }
end
})
--vim.api.nvim_create_autocmd("BufWritePre", {
-- buffer = buffer,
-- callback = function()
-- vim.lsp.buf.format { async = false }
-- end
--})