feat(plugins): add fff fuzzy finder and supermaven LeetCode toggle plugins
This commit is contained in:
1 parent
8f49f66837
commit
779e081d80
30 files changed
+221
No files matched your search
@@ -0,0 +1,18 @@
|
||||
--- fff.nvim: rust-backed fuzzy file finder and live grep with frecency
|
||||
--- Backs the <C-f> 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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<Accordion>
|
||||
<AccordionItem title="{{_cursor_}}">
|
||||
Answer.
|
||||
</AccordionItem>
|
||||
<AccordionItem title="">
|
||||
Answer.
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
@@ -0,0 +1 @@
|
||||
<Badge variant="accent">{{_cursor_}}</Badge>
|
||||
@@ -0,0 +1,8 @@
|
||||
<CardGroup cols={2}>
|
||||
<Card title="{{_cursor_}}" href="" icon="">
|
||||
Description.
|
||||
</Card>
|
||||
<Card title="" href="" icon="">
|
||||
Description.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -0,0 +1,11 @@
|
||||
<CodeGroup>
|
||||
|
||||
```ts TypeScript
|
||||
{{_cursor_}}
|
||||
```
|
||||
|
||||
```python Python
|
||||
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
@@ -0,0 +1,4 @@
|
||||
<Color variant="compact">
|
||||
<Color.Item name="{{_cursor_}}" value="#3B82F6" />
|
||||
<Color.Item name="" value={{ light: "#FFFFFF", dark: "#0A0A0A" }} />
|
||||
</Color>
|
||||
@@ -0,0 +1,8 @@
|
||||
<Columns cols={2}>
|
||||
<Column>
|
||||
{{_cursor_}}
|
||||
</Column>
|
||||
<Column>
|
||||
|
||||
</Column>
|
||||
</Columns>
|
||||
@@ -0,0 +1 @@
|
||||
<Component path="{{_cursor_}}" />
|
||||
@@ -0,0 +1,5 @@
|
||||
<Diff
|
||||
lang="{{_cursor_}}"
|
||||
old={`before`}
|
||||
new={`after`}
|
||||
/>
|
||||
@@ -0,0 +1,3 @@
|
||||
<Expandable title="{{_cursor_}}">
|
||||
Hidden detail.
|
||||
</Expandable>
|
||||
@@ -0,0 +1,6 @@
|
||||
<FileTree>
|
||||
|
||||
- {{_cursor_}}
|
||||
- index.mdx
|
||||
|
||||
</FileTree>
|
||||
@@ -0,0 +1,3 @@
|
||||
<Frame caption="{{_cursor_}}" hint="">
|
||||
<img src="" alt="" />
|
||||
</Frame>
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: {{_cursor_}}
|
||||
description:
|
||||
type: blog
|
||||
date: {{_lua:os.date("%Y-%m-%d")_}}
|
||||
authors:
|
||||
- {{_author_}}
|
||||
---
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
title: {{_cursor_}}
|
||||
description:
|
||||
type: changelog
|
||||
changelog:
|
||||
version: 0.0.0
|
||||
date: {{_lua:os.date("%Y-%m-%d")_}}
|
||||
category: Features
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: {{_cursor_}}
|
||||
description:
|
||||
---
|
||||
@@ -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: []
|
||||
---
|
||||
@@ -0,0 +1 @@
|
||||
<GithubInfo owner="{{_cursor_}}" repo="" />
|
||||
@@ -0,0 +1 @@
|
||||
<Icon icon="{{_cursor_}}" size={16} />
|
||||
@@ -0,0 +1,3 @@
|
||||
<Panel title="{{_cursor_}}">
|
||||
Supporting detail.
|
||||
</Panel>
|
||||
@@ -0,0 +1,3 @@
|
||||
<Prompt description="{{_cursor_}}" actions={["copy"]}>
|
||||
The prompt text copied to the clipboard.
|
||||
</Prompt>
|
||||
@@ -0,0 +1,8 @@
|
||||
<Steps>
|
||||
<Step title="{{_cursor_}}">
|
||||
First step.
|
||||
</Step>
|
||||
<Step title="">
|
||||
Second step.
|
||||
</Step>
|
||||
</Steps>
|
||||
@@ -0,0 +1,8 @@
|
||||
<Tabs>
|
||||
<Tab title="{{_cursor_}}">
|
||||
First tab.
|
||||
</Tab>
|
||||
<Tab title="">
|
||||
Second tab.
|
||||
</Tab>
|
||||
</Tabs>
|
||||
@@ -0,0 +1,3 @@
|
||||
<Tile title="{{_cursor_}}" description="" href="">
|
||||
<Icon icon="rocket" size={28} />
|
||||
</Tile>
|
||||
@@ -0,0 +1 @@
|
||||
<Tooltip tip="{{_cursor_}}" headline="" cta="" href="">term</Tooltip>
|
||||
@@ -0,0 +1,6 @@
|
||||
<Tree>
|
||||
<Tree.Folder name="{{_cursor_}}" defaultOpen>
|
||||
<Tree.File name="index.ts" />
|
||||
</Tree.Folder>
|
||||
<Tree.File name="" />
|
||||
</Tree>
|
||||
@@ -0,0 +1 @@
|
||||
<AutoTypeTable path="{{_cursor_}}" name="" />
|
||||
@@ -0,0 +1,9 @@
|
||||
<TypeTable
|
||||
type={{
|
||||
{{_cursor_}}: {
|
||||
type: "string",
|
||||
required: true,
|
||||
description: "",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
@@ -0,0 +1,3 @@
|
||||
<Visibility for="{{_cursor_}}">
|
||||
Audience-specific content.
|
||||
</Visibility>
|
||||
@@ -0,0 +1 @@
|
||||
<YouTube id="{{_cursor_}}" title="" />
|
||||
Reference in new issue
Block a user