summaryrefslogtreecommitdiff
path: root/lua/aotrix/plugins/autoformat.lua
blob: 2f02eef1038fad02e1e2c524bc27f7be330b1012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
return {
    "stevearc/conform.nvim",
    opts = {
        notify_on_error = false,
        format_on_save = { timeout_ms = 500, lsp_fallback = true },
        formatters_by_ft = {
            lua = { "lua-format" },
            cpp = { "clang_format" },
            cmake = { "cmakelang" }
        },
        formatters = {
            clang_format = {
                prepend_args = { '--style={BasedOnStyle: LLVM, IndentWidth: 4, ColumnLimit: 120}' }
            },
            shfmt = { prepend_args = { '-i', '4' } }
        }
    }
}