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:
parent
c99ce05989
commit
5381e06eb9
5
lua/myworkflow/autocommands.lua
Normal file
5
lua/myworkflow/autocommands.lua
Normal file
@ -0,0 +1,5 @@
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
callback = function()
|
||||
vim.lsp.buf.format { async = false }
|
||||
end
|
||||
})
|
@ -1,3 +1,4 @@
|
||||
require("myworkflow.remap")
|
||||
require("myworkflow.set")
|
||||
require("myworkflow.packer")
|
||||
require("myworkflow.autocommands")
|
||||
|
Loading…
Reference in New Issue
Block a user