summaryrefslogtreecommitdiff
path: root/lua/aotrix/plugins/autoformat.lua
diff options
context:
space:
mode:
authorAotrix <[email protected]>2025-02-24 15:36:58 +0100
committerAotrix <[email protected]>2025-02-24 15:36:58 +0100
commit69182fb677180613d3ba0e9042882a5694bb121a (patch)
tree68a33aedb6183e5e97eb36cef6b8d9cda6c22073 /lua/aotrix/plugins/autoformat.lua
parentacf3e9cf09761514301dd6ba6f97978cf4ca5587 (diff)
C++ autoformat finally works!
Diffstat (limited to 'lua/aotrix/plugins/autoformat.lua')
-rw-r--r--lua/aotrix/plugins/autoformat.lua19
1 files changed, 11 insertions, 8 deletions
diff --git a/lua/aotrix/plugins/autoformat.lua b/lua/aotrix/plugins/autoformat.lua
index 4dec682..d46f8af 100644
--- a/lua/aotrix/plugins/autoformat.lua
+++ b/lua/aotrix/plugins/autoformat.lua
@@ -2,15 +2,18 @@ return {
"stevearc/conform.nvim",
opts = {
notify_on_error = false,
- format_on_save = {
- timeout_ms = 500,
- lsp_fallback = true,
- },
+ format_on_save = {timeout_ms = 500, lsp_fallback = true},
formatters_by_ft = {
- lua = { "lua-format" },
- python = { "black", "pyink" },
- cpp = { "clang-format" },
- cmake = { "cmake_format" },
+ lua = {"lua-format"},
+ python = {"black", "pyink"},
+ cpp = {"clang_format"},
+ cmake = {"cmake_format"}
},
+ formatters = {
+ clang_format = {
+ prepend_args = {'--style={BasedOnStyle: LLVM, IndentWidth: 4}'}
+ },
+ shfmt = {prepend_args = {'-i', '4'}}
+ }
}
}