From 547cc41436917857f7cad91da06b8c1a9527f66b Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Thu, 3 Apr 2025 08:50:04 -0400 Subject: [PATCH] feat: Adds find-latest function to zsh, 'fl' alias for it, lazyvim config changes. --- nvim/lazynvim/lua/config/autocmds.lua | 18 ++++++------- nvim/lazynvim/lua/plugins/formatter.lua | 32 ++++++++++++++++-------- nvim/lazynvim/spell/en.utf-8.add | 4 +++ nvim/lazynvim/spell/en.utf-8.add.spl | Bin 259 -> 331 bytes zsh/config/.zshrc | 1 + zsh/config/functions/find-latest | 7 ++++++ 6 files changed, 43 insertions(+), 19 deletions(-) create mode 100755 zsh/config/functions/find-latest diff --git a/nvim/lazynvim/lua/config/autocmds.lua b/nvim/lazynvim/lua/config/autocmds.lua index 5e0808f..d706fc8 100644 --- a/nvim/lazynvim/lua/config/autocmds.lua +++ b/nvim/lazynvim/lua/config/autocmds.lua @@ -15,15 +15,15 @@ createCmd("BufEnter", { }) -- Markdown -createCmd("BufWritePost", { - pattern = { "*.md", "*.markdown" }, - group = markdownGroup, - callback = function(_) - local cursor = vim.fn.getpos(".") - vim.cmd("FormatWrite") - vim.fn.setpos(".", cursor) - end, -}) +-- createCmd("BufWritePost", { +-- pattern = { "*.md", "*.markdown" }, +-- group = markdownGroup, +-- callback = function(_) +-- -- local cursor = vim.fn.getpos(".") +-- vim.cmd("FormatWrite") +-- -- vim.fn.setpos(".", cursor) +-- end, +-- }) -- Go createCmd("BufWritePre", { diff --git a/nvim/lazynvim/lua/plugins/formatter.lua b/nvim/lazynvim/lua/plugins/formatter.lua index 7ca3e28..b7eb5b4 100644 --- a/nvim/lazynvim/lua/plugins/formatter.lua +++ b/nvim/lazynvim/lua/plugins/formatter.lua @@ -1,18 +1,30 @@ return { "stevearc/conform.nvim", opts = { - formatters_by_ft = { - lua = { "stulua" }, - markdown = { - "prettier", - prepend_args = { - "--config", "~/.prettierrc.yaml" - }, + formatters = { + ["markdown-toc"] = { + condition = function(_, ctx) + for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do + if line:find("") then + return true + end + end + end, }, + ["markdownlint-cli2"] = { + condition = function(_, ctx) + local diag = vim.tbl_filter(function(d) + return d.source == "markdownlint" + end, vim.diagnostic.get(ctx.buf)) + return #diag > 0 + end, + }, + }, + formatters_by_ft = { + ["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" }, + ["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" }, + lua = { "stulua" }, swift = { "swiftformat" }, - -- ["*"] = { - -- require("formatter.filetypes.any").remove_trailing_whitespace, - -- }, }, }, } diff --git a/nvim/lazynvim/spell/en.utf-8.add b/nvim/lazynvim/spell/en.utf-8.add index 096d029..b53b064 100755 --- a/nvim/lazynvim/spell/en.utf-8.add +++ b/nvim/lazynvim/spell/en.utf-8.add @@ -14,3 +14,7 @@ wc HVAC dehumidification ansible +orchestrator +ethernet +unifi +wildcard diff --git a/nvim/lazynvim/spell/en.utf-8.add.spl b/nvim/lazynvim/spell/en.utf-8.add.spl index c805b67adcb84b70d9cb47e8b5943c3a9ae56053..d7da2ca60fce0f4e34019806e2c8553ba19197d9 100755 GIT binary patch literal 331 zcmY*VIS#@w5cC*YDmo;Tf*NU$vY3ru-T_4Aru02lBQ$#c<;9#Lp0ZPqV-fN6#nJF0+!yw1NvlB+< zd9TR|@Z1F%Cf)T;O(d>0$x_Hr9w_k?@_mpZg7*~Vq>jv5^gPAj4E>Pw(Q5818;FTX zq*+MzU-Ljd30bG@NZ6&m2rLH_+Fa