[LSP] clang - Support autoformat for all file-types. (#634)

This commit is contained in:
James Walmsley 2021-07-04 02:16:24 +01:00 committed by GitHub
parent a8ccb55260
commit af3e51eec8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,9 +23,9 @@ require'lspconfig'.clangd.setup {
if O.lang.clang.autoformat then
require('lv-utils').define_augroups({
_clang_autoformat = {
{
'BufWritePre *.cpp lua vim.lsp.buf.formatting_sync(nil,1000)'
}
} })
{'BufWritePre *.c lua vim.lsp.buf.formatting_sync(nil,1000)'},
{'BufWritePre *.h lua vim.lsp.buf.formatting_sync(nil,1000)'},
{'BufWritePre *.cpp lua vim.lsp.buf.formatting_sync(nil,1000)'},
{'BufWritePre *.hpp lua vim.lsp.buf.formatting_sync(nil,1000)'},
}})
end