From 69182fb677180613d3ba0e9042882a5694bb121a Mon Sep 17 00:00:00 2001 From: Aotrix Date: Mon, 24 Feb 2025 15:36:58 +0100 Subject: C++ autoformat finally works! --- lua/aotrix/plugins/autoformat.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'lua/aotrix/plugins/autoformat.lua') 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'}} + } } } -- cgit v1.2.3