From 779e081d804b694e9f16e0280c2b266e65b329fd Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Thu, 20 Aug 2026 10:43:32 -0400 Subject: [PATCH] feat(plugins): add fff fuzzy finder and supermaven LeetCode toggle plugins --- lua/plugins/fff.lua | 18 +++++++++ lua/plugins/supermaven.lua | 53 +++++++++++++++++++++++++ templates/mdx/accordion.mdx | 8 ++++ templates/mdx/badge.mdx | 1 + templates/mdx/card_group.mdx | 8 ++++ templates/mdx/code_group.mdx | 11 +++++ templates/mdx/color.mdx | 4 ++ templates/mdx/columns.mdx | 8 ++++ templates/mdx/component_preview.mdx | 1 + templates/mdx/diff.mdx | 5 +++ templates/mdx/expandable.mdx | 3 ++ templates/mdx/file_tree.mdx | 6 +++ templates/mdx/frame.mdx | 3 ++ templates/mdx/frontmatter_blog.mdx | 8 ++++ templates/mdx/frontmatter_changelog.mdx | 9 +++++ templates/mdx/frontmatter_doc.mdx | 4 ++ templates/mdx/frontmatter_full.mdx | 23 +++++++++++ templates/mdx/github_info.mdx | 1 + templates/mdx/icon.mdx | 1 + templates/mdx/panel.mdx | 3 ++ templates/mdx/prompt.mdx | 3 ++ templates/mdx/steps.mdx | 8 ++++ templates/mdx/tabs.mdx | 8 ++++ templates/mdx/tile.mdx | 3 ++ templates/mdx/tooltip.mdx | 1 + templates/mdx/tree_folders.mdx | 6 +++ templates/mdx/type_table_auto.mdx | 1 + templates/mdx/type_table_manual.mdx | 9 +++++ templates/mdx/visibility.mdx | 3 ++ templates/mdx/youtube.mdx | 1 + 30 files changed, 221 insertions(+) create mode 100644 lua/plugins/fff.lua create mode 100644 lua/plugins/supermaven.lua create mode 100644 templates/mdx/accordion.mdx create mode 100644 templates/mdx/badge.mdx create mode 100644 templates/mdx/card_group.mdx create mode 100644 templates/mdx/code_group.mdx create mode 100644 templates/mdx/color.mdx create mode 100644 templates/mdx/columns.mdx create mode 100644 templates/mdx/component_preview.mdx create mode 100644 templates/mdx/diff.mdx create mode 100644 templates/mdx/expandable.mdx create mode 100644 templates/mdx/file_tree.mdx create mode 100644 templates/mdx/frame.mdx create mode 100644 templates/mdx/frontmatter_blog.mdx create mode 100644 templates/mdx/frontmatter_changelog.mdx create mode 100644 templates/mdx/frontmatter_doc.mdx create mode 100644 templates/mdx/frontmatter_full.mdx create mode 100644 templates/mdx/github_info.mdx create mode 100644 templates/mdx/icon.mdx create mode 100644 templates/mdx/panel.mdx create mode 100644 templates/mdx/prompt.mdx create mode 100644 templates/mdx/steps.mdx create mode 100644 templates/mdx/tabs.mdx create mode 100644 templates/mdx/tile.mdx create mode 100644 templates/mdx/tooltip.mdx create mode 100644 templates/mdx/tree_folders.mdx create mode 100644 templates/mdx/type_table_auto.mdx create mode 100644 templates/mdx/type_table_manual.mdx create mode 100644 templates/mdx/visibility.mdx create mode 100644 templates/mdx/youtube.mdx diff --git a/lua/plugins/fff.lua b/lua/plugins/fff.lua new file mode 100644 index 0000000..c81ad83 --- /dev/null +++ b/lua/plugins/fff.lua @@ -0,0 +1,18 @@ +--- fff.nvim: rust-backed fuzzy file finder and live grep with frecency +--- Backs the file/grep bindings in plugins/astrocore.lua. Honours +--- .gitignore plus per-repo .ignore files; the config.ignore_patterns +--- snacks filter does not apply here (snacks remains for non-file sources: +--- diagnostics, lines, LSP symbols, recent, projects, templates). +--- @module plugins.fff + +return { + "dmtrKovalenko/fff", + build = function() + -- downloads a prebuilt binary or falls back to cargo build + require("fff.download").download_or_build_binary() + end, + lazy = false, -- the plugin lazy-initialises itself + opts = { + lazy_sync = true, + }, +} diff --git a/lua/plugins/supermaven.lua b/lua/plugins/supermaven.lua new file mode 100644 index 0000000..fa032d1 --- /dev/null +++ b/lua/plugins/supermaven.lua @@ -0,0 +1,53 @@ +-- Disable supermaven in JavaScript/Python buffers whose comments contain a +-- LeetCode problem URL (solution files), and re-enable it when leaving them. +-- +-- Note: supermaven's built-in `condition` option is one-way — its BufEnter +-- listener gates the restart branch on `vim.g.SUPERMAVEN_DISABLED`, which +-- `api.stop()` itself sets, so once auto-stopped it never comes back. This +-- autocmd owns both directions instead. `vim.g.supermaven_leetcode_stopped` +-- distinguishes our auto-stop from a manual :SupermavenStop, which stays off. +local function is_leetcode_buffer() + local buf = vim.api.nvim_get_current_buf() + local ft = vim.bo[buf].filetype + local name = vim.api.nvim_buf_get_name(buf) + local comment_pat + if ft == "javascript" or ft == "javascriptreact" or name:match "%.[mc]?jsx?$" then + comment_pat = "^%s*[/*]" + elseif ft == "python" or name:match "%.py$" then + comment_pat = "^%s*[#\"']" + else + return false + end + -- The URL lives in the header comment block; scanning the top of the file is enough. + for _, line in ipairs(vim.api.nvim_buf_get_lines(buf, 0, 200, false)) do + if line:find "leetcode%.com/problems/" and line:match(comment_pat) then return true end + end + return false +end + +local function sync() + local api = require "supermaven-nvim.api" + if is_leetcode_buffer() then + if api.is_running() then + api.stop() + vim.g.supermaven_leetcode_stopped = true + end + elseif vim.g.supermaven_leetcode_stopped and not api.is_running() then + vim.g.supermaven_leetcode_stopped = nil + api.start() + end +end + +return { + "supermaven-inc/supermaven-nvim", + optional = true, + config = function(_, opts) + require("supermaven-nvim").setup(opts) + vim.api.nvim_create_autocmd("BufEnter", { + group = vim.api.nvim_create_augroup("supermaven_leetcode", { clear = true }), + desc = "Toggle supermaven off in LeetCode solution buffers", + callback = sync, + }) + sync() -- plugin loads on VeryLazy; cover the buffer we're already sitting in + end, +} diff --git a/templates/mdx/accordion.mdx b/templates/mdx/accordion.mdx new file mode 100644 index 0000000..fd2e835 --- /dev/null +++ b/templates/mdx/accordion.mdx @@ -0,0 +1,8 @@ + + + Answer. + + + Answer. + + diff --git a/templates/mdx/badge.mdx b/templates/mdx/badge.mdx new file mode 100644 index 0000000..58ddd01 --- /dev/null +++ b/templates/mdx/badge.mdx @@ -0,0 +1 @@ +{{_cursor_}} diff --git a/templates/mdx/card_group.mdx b/templates/mdx/card_group.mdx new file mode 100644 index 0000000..fd2463d --- /dev/null +++ b/templates/mdx/card_group.mdx @@ -0,0 +1,8 @@ + + + Description. + + + Description. + + diff --git a/templates/mdx/code_group.mdx b/templates/mdx/code_group.mdx new file mode 100644 index 0000000..832166e --- /dev/null +++ b/templates/mdx/code_group.mdx @@ -0,0 +1,11 @@ + + +```ts TypeScript +{{_cursor_}} +``` + +```python Python + +``` + + diff --git a/templates/mdx/color.mdx b/templates/mdx/color.mdx new file mode 100644 index 0000000..b177b9d --- /dev/null +++ b/templates/mdx/color.mdx @@ -0,0 +1,4 @@ + + + + diff --git a/templates/mdx/columns.mdx b/templates/mdx/columns.mdx new file mode 100644 index 0000000..b47080e --- /dev/null +++ b/templates/mdx/columns.mdx @@ -0,0 +1,8 @@ + + + {{_cursor_}} + + + + + diff --git a/templates/mdx/component_preview.mdx b/templates/mdx/component_preview.mdx new file mode 100644 index 0000000..b527e0c --- /dev/null +++ b/templates/mdx/component_preview.mdx @@ -0,0 +1 @@ + diff --git a/templates/mdx/diff.mdx b/templates/mdx/diff.mdx new file mode 100644 index 0000000..8c5f236 --- /dev/null +++ b/templates/mdx/diff.mdx @@ -0,0 +1,5 @@ + diff --git a/templates/mdx/expandable.mdx b/templates/mdx/expandable.mdx new file mode 100644 index 0000000..82de8cc --- /dev/null +++ b/templates/mdx/expandable.mdx @@ -0,0 +1,3 @@ + + Hidden detail. + diff --git a/templates/mdx/file_tree.mdx b/templates/mdx/file_tree.mdx new file mode 100644 index 0000000..aedac4a --- /dev/null +++ b/templates/mdx/file_tree.mdx @@ -0,0 +1,6 @@ + + +- {{_cursor_}} + - index.mdx + + diff --git a/templates/mdx/frame.mdx b/templates/mdx/frame.mdx new file mode 100644 index 0000000..d7da956 --- /dev/null +++ b/templates/mdx/frame.mdx @@ -0,0 +1,3 @@ + + + diff --git a/templates/mdx/frontmatter_blog.mdx b/templates/mdx/frontmatter_blog.mdx new file mode 100644 index 0000000..176cb2d --- /dev/null +++ b/templates/mdx/frontmatter_blog.mdx @@ -0,0 +1,8 @@ +--- +title: {{_cursor_}} +description: +type: blog +date: {{_lua:os.date("%Y-%m-%d")_}} +authors: + - {{_author_}} +--- diff --git a/templates/mdx/frontmatter_changelog.mdx b/templates/mdx/frontmatter_changelog.mdx new file mode 100644 index 0000000..65c7e62 --- /dev/null +++ b/templates/mdx/frontmatter_changelog.mdx @@ -0,0 +1,9 @@ +--- +title: {{_cursor_}} +description: +type: changelog +changelog: + version: 0.0.0 + date: {{_lua:os.date("%Y-%m-%d")_}} + category: Features +--- diff --git a/templates/mdx/frontmatter_doc.mdx b/templates/mdx/frontmatter_doc.mdx new file mode 100644 index 0000000..c64b275 --- /dev/null +++ b/templates/mdx/frontmatter_doc.mdx @@ -0,0 +1,4 @@ +--- +title: {{_cursor_}} +description: +--- diff --git a/templates/mdx/frontmatter_full.mdx b/templates/mdx/frontmatter_full.mdx new file mode 100644 index 0000000..c581e11 --- /dev/null +++ b/templates/mdx/frontmatter_full.mdx @@ -0,0 +1,23 @@ +--- +title: {{_cursor_}} +description: +type: doc +slug: +draft: false +lastModified: {{_lua:os.date("%Y-%m-%d")_}} +sidebar: + label: + order: 1 + icon: + badge: + hidden: false +seo: + title: + description: + image: + canonical: + noindex: false +search: + exclude: false + tags: [] +--- diff --git a/templates/mdx/github_info.mdx b/templates/mdx/github_info.mdx new file mode 100644 index 0000000..1417dc2 --- /dev/null +++ b/templates/mdx/github_info.mdx @@ -0,0 +1 @@ + diff --git a/templates/mdx/icon.mdx b/templates/mdx/icon.mdx new file mode 100644 index 0000000..45e8de8 --- /dev/null +++ b/templates/mdx/icon.mdx @@ -0,0 +1 @@ + diff --git a/templates/mdx/panel.mdx b/templates/mdx/panel.mdx new file mode 100644 index 0000000..5361f4e --- /dev/null +++ b/templates/mdx/panel.mdx @@ -0,0 +1,3 @@ + + Supporting detail. + diff --git a/templates/mdx/prompt.mdx b/templates/mdx/prompt.mdx new file mode 100644 index 0000000..53b3617 --- /dev/null +++ b/templates/mdx/prompt.mdx @@ -0,0 +1,3 @@ + + The prompt text copied to the clipboard. + diff --git a/templates/mdx/steps.mdx b/templates/mdx/steps.mdx new file mode 100644 index 0000000..88084a7 --- /dev/null +++ b/templates/mdx/steps.mdx @@ -0,0 +1,8 @@ + + + First step. + + + Second step. + + diff --git a/templates/mdx/tabs.mdx b/templates/mdx/tabs.mdx new file mode 100644 index 0000000..ada69a9 --- /dev/null +++ b/templates/mdx/tabs.mdx @@ -0,0 +1,8 @@ + + + First tab. + + + Second tab. + + diff --git a/templates/mdx/tile.mdx b/templates/mdx/tile.mdx new file mode 100644 index 0000000..bb96ddb --- /dev/null +++ b/templates/mdx/tile.mdx @@ -0,0 +1,3 @@ + + + diff --git a/templates/mdx/tooltip.mdx b/templates/mdx/tooltip.mdx new file mode 100644 index 0000000..782d6de --- /dev/null +++ b/templates/mdx/tooltip.mdx @@ -0,0 +1 @@ +term diff --git a/templates/mdx/tree_folders.mdx b/templates/mdx/tree_folders.mdx new file mode 100644 index 0000000..1d45fd5 --- /dev/null +++ b/templates/mdx/tree_folders.mdx @@ -0,0 +1,6 @@ + + + + + + diff --git a/templates/mdx/type_table_auto.mdx b/templates/mdx/type_table_auto.mdx new file mode 100644 index 0000000..5f9c22f --- /dev/null +++ b/templates/mdx/type_table_auto.mdx @@ -0,0 +1 @@ + diff --git a/templates/mdx/type_table_manual.mdx b/templates/mdx/type_table_manual.mdx new file mode 100644 index 0000000..2faa639 --- /dev/null +++ b/templates/mdx/type_table_manual.mdx @@ -0,0 +1,9 @@ + diff --git a/templates/mdx/visibility.mdx b/templates/mdx/visibility.mdx new file mode 100644 index 0000000..e7d5127 --- /dev/null +++ b/templates/mdx/visibility.mdx @@ -0,0 +1,3 @@ + + Audience-specific content. + diff --git a/templates/mdx/youtube.mdx b/templates/mdx/youtube.mdx new file mode 100644 index 0000000..6fdffad --- /dev/null +++ b/templates/mdx/youtube.mdx @@ -0,0 +1 @@ +