summaryrefslogtreecommitdiff
path: root/after/plugin/conform.lua
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-11-04 07:35:34 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-11-04 07:35:34 +0100
commit379cd763460659bfdbd49386108a9a5ab68663c2 (patch)
tree8778abcf5ee27a6e781e5179fd4d6ef0b6ee9523 /after/plugin/conform.lua
parent68b90b79f06a0fa09866f35e84e4c72405ac547d (diff)
checkpoint
Diffstat (limited to 'after/plugin/conform.lua')
-rw-r--r--after/plugin/conform.lua76
1 files changed, 38 insertions, 38 deletions
diff --git a/after/plugin/conform.lua b/after/plugin/conform.lua
index 7a8bbce..643743f 100644
--- a/after/plugin/conform.lua
+++ b/after/plugin/conform.lua
@@ -12,42 +12,42 @@ conform.setup({
},
})
-conform.formatters["clang-format"] = {
- prepend_args = {
- "--style",
- "{"
- .. "IndentWidth: 4, "
- .. "AlignAfterOpenBracket: BlockIndent, "
- .. "AlignArrayOfStructures: Right, "
- .. "BreakBeforeBraces: Linux, "
- .. "PointerAlignment: Left,"
- .. "AllowShortIfStatementsOnASingleLine: true, "
- .. "AllowShortLoopsOnASingleLine: true, "
- .. "AllowAllArgumentsOnNextLine: true, "
- .. "AllowShortCaseLabelsOnASingleLine: true, "
- .. "BreakAfterReturnType: AllDefinitions, "
- .. "ColumnLimit: "
- .. vim.o.tw
- .. "}",
- },
-}
+-- conform.formatters["clang-format"] = {
+-- prepend_args = {
+-- "--style",
+-- "{"
+-- .. "IndentWidth: 4, "
+-- .. "AlignAfterOpenBracket: BlockIndent, "
+-- .. "AlignArrayOfStructures: Right, "
+-- .. "BreakBeforeBraces: Linux, "
+-- .. "PointerAlignment: Left,"
+-- .. "AllowShortIfStatementsOnASingleLine: true, "
+-- .. "AllowShortLoopsOnASingleLine: true, "
+-- .. "AllowAllArgumentsOnNextLine: true, "
+-- .. "AllowShortCaseLabelsOnASingleLine: true, "
+-- .. "AlwaysBreakAfterReturnType: AllDefinitions, "
+-- .. "ColumnLimit: "
+-- .. vim.o.tw
+-- .. "}",
+-- },
+-- }
--- ID of autocmd for CFormat
-vim.b.CFormatID = nil
--- Enable formatting on save for C only when using the :CFormat command
-vim.api.nvim_create_user_command("CFormat", function()
- if vim.b.CFormatID == nil then
- vim.b.CFormatID = vim.api.nvim_create_autocmd("BufWritePre", {
- buffer = 0,
- callback = function()
- conform.format({ formatters = { "clang-format" } })
- end,
- })
- conform.format({ formatters = { "clang-format" } })
- print("Auto formatting enabled.")
- else
- vim.api.nvim_del_autocmd(vim.b.CFormatID)
- print("Auto formatting disabled.")
- vim.b.CFormatID = nil
- end
-end, {})
+-- -- ID of autocmd for CFormat
+-- vim.b.CFormatID = nil
+-- -- Enable formatting on save for C only when using the :CFormat command
+-- vim.api.nvim_create_user_command("CFormat", function()
+-- if vim.b.CFormatID == nil then
+-- vim.b.CFormatID = vim.api.nvim_create_autocmd("BufWritePre", {
+-- buffer = 0,
+-- callback = function()
+-- conform.format({ formatters = { "clang-format" } })
+-- end,
+-- })
+-- conform.format({ formatters = { "clang-format" } })
+-- print("Auto formatting enabled.")
+-- else
+-- vim.api.nvim_del_autocmd(vim.b.CFormatID)
+-- print("Auto formatting disabled.")
+-- vim.b.CFormatID = nil
+-- end
+-- end, {})