diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/format.lua b/nvim/.config/nvim/lua/vxclutch/lazy/format.lua index d30ede2..a9d1a47 100644 --- a/nvim/.config/nvim/lua/vxclutch/lazy/format.lua +++ b/nvim/.config/nvim/lua/vxclutch/lazy/format.lua @@ -1,30 +1,42 @@ return { - "stevearc/conform.nvim", - dependencies = { - "tpope/vim-sleuth", - }, - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - keys = { - { - "f", - function() - require("conform").format({ async = true, lsp_fallback = true }) - end, - mode = "", - }, - }, - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - local disable_filetypes = { c = true, cpp = true } - return { - timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], - } - end, - formatters_by_ft = { - lua = { "stylua" }, - }, - }, + "stevearc/conform.nvim", + dependencies = { + "tpope/vim-sleuth", + }, + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + keys = { + { + "f", + function() + require("conform").format { async = true, lsp_fallback = true } + end, + mode = "", + }, + }, + opts = { + notify_on_error = false, + format_on_save = function(bufnr) + local disable_filetypes = { c = true, cpp = true } + return { + timeout_ms = 500, + lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], + } + end, + formatters_by_ft = { + 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, + }, + }, } diff --git a/zsh/.zshrc b/zsh/.zshrc index 017e1a5..137bf24 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -49,5 +49,4 @@ function clip() { cat $1 | clip.exe } -# Motd logic -clear; cal; cat ~/.motd +fastfetch