Przeglądaj źródła

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

James Walmsley 4 lat temu
rodzic
commit
af3e51eec8
1 zmienionych plików z 5 dodań i 5 usunięć
  1. 5 5
      ftplugin/c.lua

+ 5 - 5
ftplugin/c.lua

@@ -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