瀏覽代碼

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

James Walmsley 4 年之前
父節點
當前提交
af3e51eec8
共有 1 個文件被更改,包括 5 次插入5 次删除
  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