1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-04 17:40:04 +08:00
SpaceVim/bundle/format.nvim/lua/format/ft/c.lua
2024-04-17 12:19:12 +08:00

32 lines
470 B
Lua

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