From 7dc564c42727ac66dea1e9cb795a2568e00e4628 Mon Sep 17 00:00:00 2001 From: Mayank Dutta <33067129+mayankdutta@users.noreply.github.com> Date: Sun, 4 Jul 2021 02:43:57 +0530 Subject: added Clangd format_on_save (#621) * clang autoformat do save lot of trouble * clang autoformat do save lot of trouble * clang indentation done, comments updated * clang indentation done, comments updated Co-authored-by: Mayank Sharma --- ftplugin/c.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ftplugin/c.lua') diff --git a/ftplugin/c.lua b/ftplugin/c.lua index 8a7ef9fd..d5436315 100644 --- a/ftplugin/c.lua +++ b/ftplugin/c.lua @@ -19,3 +19,13 @@ 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)' + + } + } }) +end -- cgit v1.2.3