diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 5356ac1d..5eeed383 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -17,7 +17,8 @@ map("n", "l", "") map("n", "ll", "Lazy", { desc = "Lazy" }) -- stylua: ignore start map("n", "ld", function() vim.fn.system({ "xdg-open", "https://lazyvim.org" }) end, { desc = "LazyVim Docs" }) -map("n", "lr", function() vim.fn.system({ "xdg-open", "https://github.com/LazyVim/LazyVim" }) end, { desc = "LazyVim Repo" }) +map("n", "lr", function() vim.fn.system({ "xdg-open", "https://github.com/LazyVim/LazyVim" }) end, + { desc = "LazyVim Repo" }) map("n", "lx", "LazyExtras", { desc = "Extras" }) map("n", "lc", function() Util.news.changelog() end, { desc = "LazyVim Changelog" }) map("n", "lu", function() require("lazy").update() end, { desc = "Lazy Update" }) @@ -91,6 +92,25 @@ map("n", "[/", "?\\S\\zs\\s*╭zt", { desc = "Prev block comment" }) -- Plugin Info map("n", "cif", "LazyFormatInfo", { desc = "Formatting" }) map("n", "cic", "ConformInfo", { desc = "Conform" }) +local linters = function() + local linters_attached = require("lint").linters_by_ft[vim.bo.filetype] + local buf_linters = {} + + if not linters_attached then + vim.notify("No linters attached", vim.log.levels.WARN, { title = "Linter" }) + return + end + + for _, linter in pairs(linters_attached) do + table.insert(buf_linters, linter) + end + + local unique_client_names = table.concat(buf_linters, ", ") + local linters = string.format("%s", unique_client_names) + + vim.notify(linters, vim.log.levels.INFO, { title = "Linter" }) +end +map("n", "ciL", linters, { desc = "Lint" }) map("n", "cir", "LazyRoot", { desc = "Root" }) -- U for redo