save
This commit is contained in:
@@ -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,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,5 +49,4 @@ function clip() {
|
|||||||
cat $1 | clip.exe
|
cat $1 | clip.exe
|
||||||
}
|
}
|
||||||
|
|
||||||
# Motd logic
|
fastfetch
|
||||||
clear; cal; cat ~/.motd
|
|
||||||
|
|||||||
Reference in New Issue
Block a user