From 1b5153df2d31694026baae76634ba77479632751 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Fri, 8 May 2026 21:40:40 +0545 Subject: [PATCH] feat(plugin): enable markdownlint integration and activate UI components Add missing markdownlint condition, streamline completion sources, and turn on previously disabled UI features. New Features: - Enable explorer, scroll, select, terminal, toggle, words, and zen UI components - Add TypeScript tool filetype support for JavaScript/JSX/TSX - Provide dynamic source selection for completion based on command context Enhancements: - Simplify markdownlint formatter configuration - Drop unused markdown-toc from markdown formatters - Refine default completion sources per command type Bug Fixes: - Remove redundant markdownlint condition check - Clean up formatter list by dropping markdown-toc- Add proper descriptions to WhichKey mappings --- plugin/code_quality.lua | 12 ++---------- plugin/completion.lua | 12 ++++++++---- plugin/editor.lua | 1 + plugin/snacks.lua | 13 +++++++------ plugin/whichkey.lua | 16 ++++++++-------- 5 files changed, 26 insertions(+), 28 deletions(-) diff --git a/plugin/code_quality.lua b/plugin/code_quality.lua index 5804022..6585fbf 100644 --- a/plugin/code_quality.lua +++ b/plugin/code_quality.lua @@ -36,14 +36,6 @@ require("conform").setup({ 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 = { ["lua"] = { "stylua" }, @@ -54,8 +46,8 @@ require("conform").setup({ ["javascript"] = { "biome" }, ["typescript"] = { "biome" }, ["typescriptreact"] = { "biome" }, - ["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" }, - ["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" }, + ["markdown"] = { "prettier", "markdownlint-cli2"}, + ["markdown.mdx"] = { "prettier", "markdownlint-cli2" }, ["mdx"] = { "prettier" }, ["_"] = { "trim_whitespace" }, }, diff --git a/plugin/completion.lua b/plugin/completion.lua index 8bd3491..70939c1 100644 --- a/plugin/completion.lua +++ b/plugin/completion.lua @@ -1,7 +1,7 @@ add({ "saghen/blink.lib", - "saghen/blink.cmp", - "L3MON4D3/LuaSnip", + { src = "saghen/blink.cmp", build = "cargo build --release" }, + { src = "L3MON4D3/LuaSnip", build = "make install_jsregexp" }, "rafamadriz/friendly-snippets", }) @@ -9,8 +9,12 @@ require("blink.cmp").setup({ fuzzy = { implementation = "prefer_rust" }, snippets = { preset = "luasnip" }, sources = { - default = { "lsp", "path", "snippets", "buffer" }, - providers = {}, + default = function() + local type = vim.fn.getcmdtype() + if type == "/" or type == "?" then return { "buffer" } end + if type == ":" then return { "cmdline" } end + return { "lsp", "path", "snippets", "buffer" } + end, }, completion = { diff --git a/plugin/editor.lua b/plugin/editor.lua index 2b3e7f3..778283b 100644 --- a/plugin/editor.lua +++ b/plugin/editor.lua @@ -70,6 +70,7 @@ end, { expr = true, silent = true }) -- typescript tools require('typescript-tools').setup({ + filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' }, settings = { separate_diagnostic_server = true, publish_diagnostic_on = 'insert_leave', diff --git a/plugin/snacks.lua b/plugin/snacks.lua index 23518ad..f26459b 100644 --- a/plugin/snacks.lua +++ b/plugin/snacks.lua @@ -105,7 +105,7 @@ Snacks.setup({ siblings = true, }, }, - explorer = { enabled = false }, + explorer = { enabled = true }, projects = { enabled = true, dirs = { @@ -328,9 +328,10 @@ Snacks.setup({ }, }, }, - scroll = { enabled = false }, + scroll = { enabled = true }, + select = { enabled = true }, statuscolumn = { - enabled = false, -- Change this to false + enabled = true, -- Change this to false left = { "mark", "sign" }, right = { "fold", "git" }, folds = { @@ -342,10 +343,10 @@ Snacks.setup({ }, refresh = 50, }, - terminal = { enabled = false }, - toggle = { enabled = false }, + terminal = { enabled = true }, + toggle = { enabled = true }, win = { enabled = true }, - words = { enabled = false }, + words = { enabled = true }, zen = { enabled = true, toggles = { diff --git a/plugin/whichkey.lua b/plugin/whichkey.lua index e54c914..74f2adf 100644 --- a/plugin/whichkey.lua +++ b/plugin/whichkey.lua @@ -166,14 +166,14 @@ local normal_mappings = { { "qw", ":wq", desc = "Write and Quit" }, { "r", group = " Refactor" }, - { "rd", "", desc = "Go To Definition" }, -- treesitter navigation - { "rD", "", desc = "List Definition" }, - { "rh", "", desc = "List Definition Head" }, - { "rj", "", desc = "Next Usage" }, - { "rk", "", desc = "Previous Usage" }, - { "rn", "", desc = "Swap Next" }, - { "rp", "", desc = "Swap Previous" }, - { "rr", "", desc = "Smart Rename" }, + { "rd", desc = "Go To Definition" }, -- treesitter navigation + { "rD", desc = "List Definition" }, + { "rh", desc = "List Definition Head" }, + { "rj", desc = "Next Usage" }, + { "rk", desc = "Previous Usage" }, + { "rn", desc = "Swap Next" }, + { "rp", desc = "Swap Previous" }, + { "rr", desc = "Smart Rename" }, { "rs", ":%s/\\<\\>//gI", desc = "Replace Word Buffer" }, { "s", group = " Split" },