This commit is contained in:
2025-01-01 22:23:49 -05:00
parent 0135da50e8
commit 4ba713bbd4
2 changed files with 41 additions and 30 deletions

View File

@@ -9,7 +9,7 @@ return {
{ {
"<leader>f", "<leader>f",
function() function()
require("conform").format({ async = true, lsp_fallback = true }) require("conform").format { async = true, lsp_fallback = true }
end, end,
mode = "", mode = "",
}, },
@@ -26,5 +26,17 @@ return {
formatters_by_ft = { formatters_by_ft = {
lua = { "stylua" }, lua = { "stylua" },
}, },
hooks = {
pre_format = function(lines, _)
-- Strip comments
local no_comments = {}
for _, line in ipairs(lines) do
if not line:match "%s*//" and not line:match "%s*/%*.*%*/" then
table.insert(no_comments, line)
end
end
return no_comments
end,
},
}, },
} }

View File

@@ -49,5 +49,4 @@ function clip() {
cat $1 | clip.exe cat $1 | clip.exe
} }
# Motd logic fastfetch
clear; cal; cat ~/.motd