Automatically format files with LSP before write.
This commit is contained in:
parent
368b931dc8
commit
b83bbf0fdf
1 changed files with 6 additions and 6 deletions
|
|
@ -19,9 +19,9 @@ vim.opt.expandtab = true
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
|
|
||||||
-- Use LSP to format bufer automatically just before write
|
-- Use LSP to format bufer automatically just before write
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
--vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
buffer = buffer,
|
-- buffer = buffer,
|
||||||
callback = function()
|
-- callback = function()
|
||||||
vim.lsp.buf.format { async = false }
|
-- vim.lsp.buf.format { async = false }
|
||||||
end
|
-- end
|
||||||
})
|
--})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue