fix(nvim): format files on save with null-ls
This commit is contained in:
parent
09f4e9092e
commit
7932fb1d55
|
@ -36,3 +36,5 @@ lspconfig.tailwindcss.setup {
|
||||||
}
|
}
|
||||||
|
|
||||||
require("opdavies.lsp.handlers").setup()
|
require("opdavies.lsp.handlers").setup()
|
||||||
|
|
||||||
|
require "opdavies.lsp.null-ls"
|
||||||
|
|
|
@ -14,4 +14,15 @@ null_ls.setup {
|
||||||
diagnostics.eslint,
|
diagnostics.eslint,
|
||||||
completion.spell,
|
completion.spell,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
on_attach = function(client)
|
||||||
|
if client.resolved_capabilities.document_formatting then
|
||||||
|
vim.cmd [[
|
||||||
|
augroup LspFormatting
|
||||||
|
autocmd! * <buffer>
|
||||||
|
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
|
||||||
|
augroup END
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue