Introduce autocommand for formatting

Now, before a file is saved, we call the vim api format() function
which formats the content of the file.
This commit is contained in:
Marco 2023-10-19 09:42:48 +02:00
parent c99ce05989
commit 5381e06eb9
2 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,5 @@
vim.api.nvim_create_autocmd('BufWritePre', {
callback = function()
vim.lsp.buf.format { async = false }
end
})

View File

@ -1,3 +1,4 @@
require("myworkflow.remap")
require("myworkflow.set")
require("myworkflow.packer")
require("myworkflow.autocommands")