refactor(core): remove Avante and Nap plugins
This commit is contained in:
1 parent
c298e5598e
commit
2df7760de0
7 files changed
+138
-270
No files matched your search
@@ -17,17 +17,11 @@ return {
|
||||
{ import = "astrocommunity.pack.toml" },
|
||||
{ import = "astrocommunity.pack.typescript" },
|
||||
{ import = "astrocommunity.pack.yaml" },
|
||||
{ import = "astrocommunity.git.octo-nvim" },
|
||||
{ import = "astrocommunity.bars-and-lines.bufferline-nvim" },
|
||||
{ import = "astrocommunity.code-runner.overseer-nvim" },
|
||||
{ import = "astrocommunity.completion.blink-cmp" },
|
||||
{ import = "astrocommunity.editing-support.auto-save-nvim" },
|
||||
{ import = "astrocommunity.editing-support.conform-nvim" },
|
||||
{ import = "astrocommunity.lsp.inc-rename-nvim" },
|
||||
{ import = "astrocommunity.lsp.nvim-lsp-file-operations" },
|
||||
{ import = "astrocommunity.colorscheme.bamboo-nvim" },
|
||||
{ import = "astrocommunity.colorscheme.cyberdream-nvim" },
|
||||
{ import = "astrocommunity.colorscheme.gruvbox-baby" },
|
||||
{ import = "astrocommunity.colorscheme.kanagawa-nvim" },
|
||||
{ import = "astrocommunity.colorscheme.kanagawa-paper-nvim" },
|
||||
}
|
||||
@@ -76,6 +76,34 @@ function M.setup()
|
||||
end,
|
||||
}
|
||||
|
||||
-- Opencode Terminal Tab
|
||||
|
||||
-- Opencode Terminal Tab (persistent)
|
||||
local opencode = Terminal:new {
|
||||
cmd = "opencode",
|
||||
hidden = true,
|
||||
direction = "tab",
|
||||
close_on_exit = false,
|
||||
count = 99, -- fixed ID so toggleterm never creates a duplicate
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
term.bufnr,
|
||||
"t",
|
||||
"<C-a><C-a>",
|
||||
"<cmd>tabprevious<CR>",
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
term.bufnr,
|
||||
"n",
|
||||
"<C-a><C-a>",
|
||||
"<cmd>tabprevious<CR>",
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
end,
|
||||
}
|
||||
-- Scratch terminal
|
||||
local scratch = Terminal:new {
|
||||
cmd = "zsh",
|
||||
@@ -93,6 +121,23 @@ function M.setup()
|
||||
M.lazydocker_toggle = function() lazydocker:toggle() end
|
||||
M.smartCommit_toggle = function() smartCommit:toggle() end
|
||||
M.scratch_toggle = function() scratch:toggle() end
|
||||
M.opencode_toggle = function()
|
||||
if not opencode:is_open() then
|
||||
opencode:open()
|
||||
elseif opencode:is_focused() then
|
||||
vim.cmd "tabprevious"
|
||||
else
|
||||
-- Find and switch to the opencode tab
|
||||
local bufnr = opencode.bufnr
|
||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||
if vim.api.nvim_win_get_buf(win) == bufnr then
|
||||
vim.api.nvim_set_current_win(win)
|
||||
vim.cmd "startinsert!"
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -12,7 +12,6 @@ require("lazy").setup({
|
||||
},
|
||||
{ import = "community" },
|
||||
{ import = "plugins" },
|
||||
{ import = "plugins.local" },
|
||||
} --[[@as LazySpec]], {
|
||||
install = { colorscheme = { "cyberdream" } },
|
||||
ui = { backdrop = 100 },
|
||||
|
||||
@@ -390,15 +390,7 @@ return {
|
||||
|
||||
["<C-j><C-j>"] = { function() terminals.scratch_toggle() end, desc = "Open Scratch Terminal" },
|
||||
-- AI/Assistant mappings (Avante)
|
||||
["<C-a>"] = { nil, desc = "Avante AI" },
|
||||
["<C-a><C-a>"] = { "<cmd>AvanteToggle<cr>", desc = "Toggle Avante" },
|
||||
["<C-a>a"] = { "<cmd>AvanteAsk<cr>", desc = "Ask Avante" },
|
||||
["<C-a>e"] = { "<cmd>AvanteEdit<cr>", desc = "Edit with Avante" },
|
||||
["<C-a>r"] = { "<cmd>AvanteRefresh<cr>", desc = "Refresh Avante" },
|
||||
["<C-a>f"] = { "<cmd>AvanteFocus<cr>", desc = "Focus Avante" },
|
||||
["<C-a>c"] = { "<cmd>AvanteChat<cr>", desc = "Avante Chat" },
|
||||
["<C-a>s"] = { "<cmd>AvanteSwitchProvider<cr>", desc = "Switch Provider" },
|
||||
["<C-a>C"] = { "<cmd>AvanteClear<cr>", desc = "Clear Avante" },
|
||||
["<C-a><C-a>"] = { terminals.opencode_toggle, desc = "Toggle OpenCode" },
|
||||
-- UI Toggles with Snacks
|
||||
["<leader>u"] = { desc = "UI Toggles" },
|
||||
["<leader>ud"] = {
|
||||
@@ -540,6 +532,7 @@ return {
|
||||
},
|
||||
},
|
||||
t = {
|
||||
["<C-a><C-a>"] = { terminals.opencode_toggle, desc = "Toggle OpenCode" },
|
||||
["<C-t><C-t>"] = { terminals.mk_toggle, desc = "Taskfile Toggle" },
|
||||
["<C-e>"] = { "<Cmd>Neotree toggle<CR>", desc = "Open Explorer" },
|
||||
-- Paste from system clipboard
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
--- Avante.nvim - AI pair programming assistant
|
||||
--- @module plugins.avante
|
||||
return {
|
||||
"yetone/avante.nvim",
|
||||
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
|
||||
-- ⚠️ must add this setting! ! !
|
||||
build = vim.fn.has "win32" ~= 0 and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false"
|
||||
or "make",
|
||||
event = "VeryLazy",
|
||||
version = false, -- Never set this value to "*"! Never!
|
||||
---@module 'avante'
|
||||
---@type avante.Config
|
||||
opts = {
|
||||
-- add any opts here
|
||||
-- this file can contain specific instructions for your project
|
||||
instructions_file = "avante.md",
|
||||
-- for example
|
||||
provider = "opencode",
|
||||
acp_providers = {
|
||||
["opencode"] = {
|
||||
command = "opencode",
|
||||
args = { "acp" },
|
||||
},
|
||||
},
|
||||
-- Keybindings for navigation within Avante windows
|
||||
mappings = {
|
||||
--- @class AvanteConflictMappings
|
||||
diff = {
|
||||
ours = "co",
|
||||
theirs = "ct",
|
||||
all_theirs = "ca",
|
||||
both = "cb",
|
||||
cursor = "cc",
|
||||
next = "]x",
|
||||
prev = "[x",
|
||||
},
|
||||
suggestion = {
|
||||
accept = "<M-l>",
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<C-]>",
|
||||
},
|
||||
jump = {
|
||||
next = "]]",
|
||||
prev = "[[",
|
||||
},
|
||||
submit = {
|
||||
normal = "<CR>",
|
||||
insert = "<C-s>",
|
||||
},
|
||||
sidebar = {
|
||||
apply_all = "A",
|
||||
apply_cursor = "a",
|
||||
switch_windows = "<Tab>",
|
||||
reverse_switch_windows = "<S-Tab>",
|
||||
},
|
||||
},
|
||||
windows = {
|
||||
position = "right", -- the position of the sidebar
|
||||
wrap = true, -- similar to vim.o.wrap
|
||||
width = 26, -- default % based on available width
|
||||
sidebar_header = {
|
||||
align = "center", -- left, center, right for title
|
||||
rounded = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
--- The below dependencies are optional,
|
||||
"nvim-mini/mini.pick", -- for file_selector provider mini.pick
|
||||
"nvim-telescope/telescope.nvim", -- for file_selector provider telescope
|
||||
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
|
||||
"ibhagwan/fzf-lua", -- for file_selector provider fzf
|
||||
"stevearc/dressing.nvim", -- for input provider dressing
|
||||
"folke/snacks.nvim", -- for input provider snacks
|
||||
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
|
||||
{
|
||||
-- support for image pasting
|
||||
"HakonHarnes/img-clip.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- recommended settings
|
||||
default = {
|
||||
embed_image_as_base64 = false,
|
||||
prompt_for_file_name = false,
|
||||
drag_and_drop = {
|
||||
insert_mode = true,
|
||||
},
|
||||
-- required for Windows users
|
||||
use_absolute_path = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
-- Make sure to set this up properly if you have lazy=true
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
opts = {
|
||||
file_types = { "markdown", "Avante" },
|
||||
},
|
||||
ft = { "markdown", "Avante" },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
return {
|
||||
{
|
||||
"RRethy/base16-nvim",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require('base16-colorscheme').setup({
|
||||
base00 = '#0A0A0F',
|
||||
base01 = '#0A0A0F',
|
||||
base02 = '#5c6370',
|
||||
base03 = '#5c6370',
|
||||
base04 = '#abb2bf',
|
||||
base05 = '#ffffff',
|
||||
base06 = '#ffffff',
|
||||
base07 = '#ffffff',
|
||||
base08 = '#e05f68',
|
||||
base09 = '#e05f68',
|
||||
base0A = '#57e9e8',
|
||||
base0B = '#8ee086',
|
||||
base0C = '#38838d',
|
||||
base0D = '#57e9e8',
|
||||
base0E = '#2e9986',
|
||||
base0F = '#2e9986',
|
||||
})
|
||||
|
||||
vim.api.nvim_set_hl(0, 'Visual', {
|
||||
bg = '#5c6370',
|
||||
fg = '#ffffff',
|
||||
bold = true
|
||||
})
|
||||
vim.api.nvim_set_hl(0, 'Statusline', {
|
||||
bg = '#57e9e8',
|
||||
fg = '#0A0A0F',
|
||||
})
|
||||
vim.api.nvim_set_hl(0, 'LineNr', { fg = '#5c6370' })
|
||||
vim.api.nvim_set_hl(0, 'CursorLineNr', { fg = '#38838d', bold = true })
|
||||
|
||||
vim.api.nvim_set_hl(0, 'Statement', {
|
||||
fg = '#2e9986',
|
||||
bold = true
|
||||
})
|
||||
vim.api.nvim_set_hl(0, 'Keyword', { link = 'Statement' })
|
||||
vim.api.nvim_set_hl(0, 'Repeat', { link = 'Statement' })
|
||||
vim.api.nvim_set_hl(0, 'Conditional', { link = 'Statement' })
|
||||
|
||||
vim.api.nvim_set_hl(0, 'Function', {
|
||||
fg = '#57e9e8',
|
||||
bold = true
|
||||
})
|
||||
vim.api.nvim_set_hl(0, 'Macro', {
|
||||
fg = '#57e9e8',
|
||||
italic = true
|
||||
})
|
||||
vim.api.nvim_set_hl(0, '@function.macro', { link = 'Macro' })
|
||||
|
||||
vim.api.nvim_set_hl(0, 'Type', {
|
||||
fg = '#38838d',
|
||||
bold = true,
|
||||
italic = true
|
||||
})
|
||||
vim.api.nvim_set_hl(0, 'Structure', { link = 'Type' })
|
||||
|
||||
vim.api.nvim_set_hl(0, 'String', {
|
||||
fg = '#8ee086',
|
||||
italic = true
|
||||
})
|
||||
|
||||
vim.api.nvim_set_hl(0, 'Operator', { fg = '#abb2bf' })
|
||||
vim.api.nvim_set_hl(0, 'Delimiter', { fg = '#abb2bf' })
|
||||
vim.api.nvim_set_hl(0, '@punctuation.bracket', { link = 'Delimiter' })
|
||||
vim.api.nvim_set_hl(0, '@punctuation.delimiter', { link = 'Delimiter' })
|
||||
|
||||
vim.api.nvim_set_hl(0, 'Comment', {
|
||||
fg = '#5c6370',
|
||||
italic = true
|
||||
})
|
||||
|
||||
local current_file_path = vim.fn.stdpath("config") .. "/lua/plugins/dankcolors.lua"
|
||||
if not _G._matugen_theme_watcher then
|
||||
local uv = vim.uv or vim.loop
|
||||
_G._matugen_theme_watcher = uv.new_fs_event()
|
||||
_G._matugen_theme_watcher:start(current_file_path, {}, vim.schedule_wrap(function()
|
||||
local new_spec = dofile(current_file_path)
|
||||
if new_spec and new_spec[1] and new_spec[1].config then
|
||||
new_spec[1].config()
|
||||
print("Theme reload")
|
||||
end
|
||||
end))
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
--- Nap snippets integration
|
||||
--- Provides keybinding to insert nap snippets using Snacks picker
|
||||
--- @module plugins.nap
|
||||
|
||||
return {
|
||||
"AstroNvim/astrocore",
|
||||
opts = function(_, opts)
|
||||
-- Add keybinding for nap snippets picker
|
||||
opts.mappings = opts.mappings or {}
|
||||
opts.mappings.n = opts.mappings.n or {}
|
||||
|
||||
opts.mappings.n["<C-p>"] = {
|
||||
function()
|
||||
-- Get current buffer's filetype
|
||||
local filetype = vim.bo.filetype
|
||||
|
||||
-- Map filetype to common language folder names
|
||||
local filetype_map = {
|
||||
typescript = "ts",
|
||||
javascript = "js",
|
||||
typescriptreact = "tsx",
|
||||
javascriptreact = "jsx",
|
||||
python = "py",
|
||||
go = "go",
|
||||
rust = "rs",
|
||||
lua = "lua",
|
||||
vim = "vim",
|
||||
sh = "sh",
|
||||
bash = "bash",
|
||||
zsh = "zsh",
|
||||
c = "c",
|
||||
cpp = "cpp",
|
||||
java = "java",
|
||||
ruby = "rb",
|
||||
php = "php",
|
||||
html = "html",
|
||||
css = "css",
|
||||
scss = "scss",
|
||||
json = "json",
|
||||
yaml = "yaml",
|
||||
toml = "toml",
|
||||
markdown = "md",
|
||||
sql = "sql",
|
||||
proto = "proto",
|
||||
}
|
||||
|
||||
local lang = filetype_map[filetype] or filetype
|
||||
|
||||
-- Get list of snippets using nap list
|
||||
local handle = io.popen("nap list 2>/dev/null")
|
||||
if not handle then
|
||||
vim.notify("Failed to execute 'nap list' command", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
|
||||
local output = handle:read("*a")
|
||||
handle:close()
|
||||
|
||||
if not output or output == "" then
|
||||
vim.notify("No nap snippets found", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
-- Parse snippet names
|
||||
local all_snippets = {}
|
||||
for line in output:gmatch("[^\r\n]+") do
|
||||
if line and line ~= "" then
|
||||
table.insert(all_snippets, line)
|
||||
end
|
||||
end
|
||||
|
||||
if #all_snippets == 0 then
|
||||
vim.notify("No nap snippets found", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
-- Filter snippets by language/filetype
|
||||
local filtered_snippets = {}
|
||||
local snippet_prefix = lang .. "/"
|
||||
|
||||
for _, snippet in ipairs(all_snippets) do
|
||||
-- Match snippets that start with lang/ or contain .lang extension
|
||||
if snippet:match("^" .. vim.pesc(snippet_prefix))
|
||||
or snippet:match("%." .. vim.pesc(lang) .. "$")
|
||||
or snippet:match("/" .. vim.pesc(lang) .. "/")
|
||||
then
|
||||
table.insert(filtered_snippets, snippet)
|
||||
end
|
||||
end
|
||||
|
||||
-- Use filtered snippets if found, otherwise show all
|
||||
local snippets = #filtered_snippets > 0 and filtered_snippets or all_snippets
|
||||
local prompt = #filtered_snippets > 0
|
||||
and "Select " .. lang .. " snippet:"
|
||||
or "Select nap snippet (no " .. lang .. " snippets found):"
|
||||
|
||||
-- Use vim.ui.select to pick a snippet
|
||||
vim.ui.select(snippets, {
|
||||
prompt = prompt,
|
||||
format_item = function(item)
|
||||
return item
|
||||
end,
|
||||
}, function(choice)
|
||||
if not choice then return end
|
||||
|
||||
-- Get the snippet content
|
||||
local content_handle = io.popen("nap " .. vim.fn.shellescape(choice) .. " 2>/dev/null")
|
||||
if not content_handle then
|
||||
vim.notify("Failed to read snippet: " .. choice, vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
|
||||
local content = content_handle:read("*a")
|
||||
content_handle:close()
|
||||
|
||||
if not content or content == "" then
|
||||
vim.notify("Snippet is empty or not found: " .. choice, vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
-- Insert the snippet content at cursor position
|
||||
local lines = vim.split(content, "\n", { trimempty = false })
|
||||
-- Remove trailing empty line if present
|
||||
if lines[#lines] == "" then
|
||||
table.remove(lines)
|
||||
end
|
||||
|
||||
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||
local row = cursor[1]
|
||||
local col = cursor[2]
|
||||
|
||||
-- Insert the lines
|
||||
vim.api.nvim_buf_set_text(0, row - 1, col, row - 1, col, lines)
|
||||
|
||||
-- Move cursor to end of inserted text
|
||||
local new_row = row + #lines - 1
|
||||
local new_col = #lines[#lines]
|
||||
if #lines == 1 then
|
||||
new_col = col + new_col
|
||||
end
|
||||
vim.api.nvim_win_set_cursor(0, { new_row, new_col })
|
||||
|
||||
vim.notify("Inserted snippet: " .. choice, vim.log.levels.INFO)
|
||||
end)
|
||||
end,
|
||||
desc = "Insert nap snippet",
|
||||
}
|
||||
end,
|
||||
}
|
||||
Reference in new issue
Block a user