1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 11:20:06 +08:00

feat(format): add c format

This commit is contained in:
Eric Wong 2024-04-17 12:19:12 +08:00
parent 9e46432d18
commit 01e948f6be

View File

@ -0,0 +1,31 @@
local M = {}
function M.enabled()
return { 'uncrustify', 'clangformat', 'astyle' }
end
function M.clangformat(opt)
return {
exe = 'clang-format',
args = { '-assume-filename=' .. opt.filepath },
stdin = true,
}
end
function M.uncrustify(opt)
return {
exe = 'uncrustify',
args = { '-q', '-l', 'C' },
stdin = true,
}
end
function M.astyle(opt)
return {
exe = 'astyle',
args = {'--mode=c'},
stdin = true
}
end
return M