refactor(core): migrate ai files from claude to ai
This commit is contained in:
1 parent
49364f362d
commit
4524944dae
11 files changed
+149
-397
No files matched your search
@@ -7,33 +7,24 @@ return {
|
||||
"AstroNvim/astrocommunity",
|
||||
version = false, -- Use latest astrocommunity
|
||||
{ import = "astrocommunity.pack.bash" },
|
||||
{ import = "astrocommunity.pack.chezmoi" },
|
||||
{ import = "astrocommunity.pack.lua" },
|
||||
{ import = "astrocommunity.pack.markdown" },
|
||||
{ import = "astrocommunity.pack.json" },
|
||||
{ import = "astrocommunity.pack.mdx" },
|
||||
{ import = "astrocommunity.pack.go" },
|
||||
{ import = "astrocommunity.pack.golangci-lint" },
|
||||
{ import = "astrocommunity.pack.html-css" },
|
||||
-- oxlint configured manually in astrolsp.lua via nvim-lint
|
||||
{ import = "astrocommunity.pack.toml" },
|
||||
{ import = "astrocommunity.pack.templ" },
|
||||
{ import = "astrocommunity.pack.tailwindcss" },
|
||||
{ import = "astrocommunity.pack.typescript" },
|
||||
{ import = "astrocommunity.pack.yaml" },
|
||||
{ import = "astrocommunity.utility.noice-nvim" },
|
||||
{ import = "astrocommunity.git.octo-nvim" },
|
||||
{ import = "astrocommunity.bars-and-lines.bufferline-nvim" },
|
||||
{ import = "astrocommunity.code-runner.overseer-nvim" },
|
||||
{ import = "astrocommunity.completion.supermaven-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.cyberdream-nvim" },
|
||||
{ import = "astrocommunity.recipes.disable-borders" },
|
||||
{ import = "astrocommunity.recipes.picker-lsp-mappings" },
|
||||
{ import = "astrocommunity.recipes.telescope-nvim-snacks" },
|
||||
{ import = "astrocommunity.recipes.vscode-icons" },
|
||||
}
|
||||
@@ -25,23 +25,10 @@ M.patterns = {
|
||||
"*_test.go",
|
||||
|
||||
-- Configuration files
|
||||
"*config.*.js",
|
||||
"*config.js",
|
||||
"deps.mjs",
|
||||
".parcelrc",
|
||||
"worker-configuration.d.ts",
|
||||
"wrangler.jsonc",
|
||||
"biome*",
|
||||
".cz.toml",
|
||||
".editorconfig",
|
||||
".gitpod.*",
|
||||
"cspell.*",
|
||||
|
||||
-- Documentation
|
||||
"*_query_docs.md",
|
||||
"*_tx_docs.md",
|
||||
"readme.md",
|
||||
"CLAUDE*",
|
||||
|
||||
|
||||
-- Lock files and dependencies
|
||||
"*.lock",
|
||||
@@ -65,10 +52,6 @@ M.patterns = {
|
||||
".tsbuildinfo",
|
||||
".wrangler",
|
||||
".parcel-cache",
|
||||
".aider.tags.cache.v4",
|
||||
".aider.tags.cache.v3",
|
||||
".aider.chat.history.md",
|
||||
".aider.input.history",
|
||||
".conform*",
|
||||
".null-ls_*",
|
||||
|
||||
@@ -92,7 +75,7 @@ M.patterns = {
|
||||
M.never_show = {
|
||||
-- Version control
|
||||
".git",
|
||||
".claude",
|
||||
".ai",
|
||||
|
||||
-- Dependencies
|
||||
"node_modules",
|
||||
@@ -177,7 +160,6 @@ M.never_show_patterns = {
|
||||
".parcel-cache",
|
||||
"*.icns",
|
||||
"*.ico",
|
||||
".aider.tags.cache.v4",
|
||||
"*.iml",
|
||||
"Icon?",
|
||||
"iCloud~",
|
||||
|
||||
@@ -12,6 +12,7 @@ require("lazy").setup({
|
||||
},
|
||||
{ import = "community" },
|
||||
{ import = "plugins" },
|
||||
{ import = "plugins.local" },
|
||||
} --[[@as LazySpec]], {
|
||||
install = { colorscheme = { "cyberdream" } },
|
||||
ui = { backdrop = 100 },
|
||||
|
||||
+7
-136
@@ -314,120 +314,22 @@ return {
|
||||
},
|
||||
["<C-f>gc"] = {
|
||||
function()
|
||||
local claude_dir = vim.fn.getcwd() .. "/.claude"
|
||||
local ai_dir = vim.fn.getcwd() .. "/.ai"
|
||||
-- Check if directory exists
|
||||
if vim.fn.isdirectory(claude_dir) == 0 then
|
||||
vim.notify("No .claude directory found in current project", vim.log.levels.WARN)
|
||||
if vim.fn.isdirectory(ai_dir) == 0 then
|
||||
vim.notify("No .ai directory found in current project", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
-- Use files picker to find Claude files
|
||||
-- Use files picker to find AI files
|
||||
require("snacks").picker.files {
|
||||
cwd = claude_dir,
|
||||
cwd = ai_dir,
|
||||
transform = file_filter,
|
||||
}
|
||||
end,
|
||||
desc = "Find Claude files",
|
||||
desc = "Find AI files",
|
||||
},
|
||||
["<C-f>p"] = { desc = "Find Package files" },
|
||||
["<C-f>pc"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/code/github.com/sonr-io/sonr/packages/cli" },
|
||||
exclude = { "packages/cli/dist" },
|
||||
ft = { "ts", "tsx", "js" },
|
||||
}
|
||||
end,
|
||||
desc = "Find @sonr.io/cli files",
|
||||
},
|
||||
["<C-f>pe"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/code/github.com/sonr-io/sonr/packages/es" },
|
||||
exclude = { "packages/es/dist" },
|
||||
ft = { "ts", "tsx", "js" },
|
||||
}
|
||||
end,
|
||||
desc = "Find @sonr.io/es files",
|
||||
},
|
||||
["<C-f>pp"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/code/github.com/sonr-io/sonr/packages/pkl" },
|
||||
exclude = { "packages/pkl/dist" },
|
||||
ft = { "ts", "tsx", "js" },
|
||||
}
|
||||
end,
|
||||
desc = "Find @sonr.io/es files",
|
||||
},
|
||||
["<C-f>ps"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/code/github.com/sonr-io/sonr/packages/sdk" },
|
||||
exclude = { "packages/sdk/dist" },
|
||||
ft = { "ts", "tsx", "js" },
|
||||
}
|
||||
end,
|
||||
desc = "Find @sonr.io/sdk files",
|
||||
},
|
||||
["<C-f>pu"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/code/github.com/sonr-io/sonr/packages/ui" },
|
||||
exclude = { "packages/ui/dist" },
|
||||
ft = { "ts", "tsx", "js" },
|
||||
}
|
||||
end,
|
||||
desc = "Find @sonr.io/ui files",
|
||||
},
|
||||
["<C-f>m"] = { desc = "Find Module files" },
|
||||
["<C-f>me"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = {
|
||||
"/home/prad/code/github.com/sonr-io/sonr/proto/dex",
|
||||
"/home/prad/code/github.com/sonr-io/sonr/x/dex",
|
||||
},
|
||||
ft = { "go", "md", "proto" },
|
||||
}
|
||||
end,
|
||||
desc = "Find x/dex files",
|
||||
},
|
||||
["<C-f>mi"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = {
|
||||
"/home/prad/code/github.com/sonr-io/sonr/proto/did",
|
||||
"/home/prad/code/github.com/sonr-io/sonr/x/did",
|
||||
},
|
||||
ft = { "go", "md", "proto" },
|
||||
}
|
||||
end,
|
||||
desc = "Find x/did files",
|
||||
},
|
||||
["<C-f>md"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = {
|
||||
"/home/prad/code/github.com/sonr-io/sonr/proto/dwn",
|
||||
"/home/prad/code/github.com/sonr-io/sonr/x/dwn",
|
||||
},
|
||||
ft = { "go", "md", "proto" },
|
||||
}
|
||||
end,
|
||||
desc = "Find x/dwn files",
|
||||
},
|
||||
["<C-f>ms"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = {
|
||||
"/home/prad/code/github.com/sonr-io/sonr/proto/svc",
|
||||
"/home/prad/code/github.com/sonr-io/sonr/x/svc",
|
||||
},
|
||||
ft = { "go", "md", "proto" },
|
||||
}
|
||||
end,
|
||||
desc = "Find x/svc files",
|
||||
},
|
||||
["<C-f>g"] = {
|
||||
desc = "Find by Group",
|
||||
},
|
||||
@@ -480,38 +382,7 @@ return {
|
||||
end,
|
||||
desc = "Find Package.json files",
|
||||
},
|
||||
["<C-f>."] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/.local/share/chezmoi" },
|
||||
}
|
||||
end,
|
||||
desc = "Find dotfiles",
|
||||
},
|
||||
["<C-f>c."] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/.local/share/chezmoi" },
|
||||
}
|
||||
end,
|
||||
desc = "Find chezmoi config files",
|
||||
},
|
||||
["<C-f>cn"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/code/github.com/prnk28/nvim" },
|
||||
}
|
||||
end,
|
||||
desc = "Find nvim files",
|
||||
},
|
||||
["<C-f>cs"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/.local/share/chezmoi/dot_local/share/services" },
|
||||
}
|
||||
end,
|
||||
desc = "Find Service files",
|
||||
},
|
||||
|
||||
["<C-j><C-j>"] = { function() terminals.scratch_toggle() end, desc = "Open Scratch Terminal" },
|
||||
-- AI/Assistant mappings (Avante)
|
||||
["<C-a>"] = { nil, desc = "Avante AI" },
|
||||
|
||||
@@ -275,10 +275,11 @@ return {
|
||||
enable = true,
|
||||
url = "https://www.schemastore.org/api/json/catalog.json",
|
||||
},
|
||||
schemas = {
|
||||
["https://json.schemastore.org/github-workflow.json"] = ".github/workflows/*.yml",
|
||||
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = "docker-compose*.yml",
|
||||
},
|
||||
schemas = {
|
||||
["https://json.schemastore.org/github-workflow.json"] = ".github/workflows/*.yml",
|
||||
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] =
|
||||
"docker-compose*.yml",
|
||||
},
|
||||
validate = true,
|
||||
hover = true,
|
||||
completion = true,
|
||||
@@ -670,19 +671,6 @@ return {
|
||||
},
|
||||
|
||||
-- ============================================================================
|
||||
-- Diagnostics UI
|
||||
-- ============================================================================
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
modes = {
|
||||
lsp = {
|
||||
win = { position = "right" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Inline linting hints
|
||||
{
|
||||
|
||||
+1
-33
@@ -13,39 +13,7 @@ return {
|
||||
GitChange = "",
|
||||
GitDelete = "",
|
||||
},
|
||||
-- modify variables used by heirline but not defined in the setup call directly
|
||||
status = {
|
||||
-- define the separators between each section
|
||||
separators = {
|
||||
left = { "", "" }, -- separator for the left side of the statusline
|
||||
right = { "", "" }, -- separator for the right side of the statusline
|
||||
tab = { "", "" },
|
||||
},
|
||||
-- add new colors that can be used by heirline
|
||||
colors = function(hl)
|
||||
local get_hlgroup = require("astroui").get_hlgroup
|
||||
-- use helper function to get highlight group properties
|
||||
local comment_fg = get_hlgroup("Comment").fg
|
||||
hl.git_branch_fg = comment_fg
|
||||
hl.git_added = comment_fg
|
||||
hl.git_changed = comment_fg
|
||||
hl.git_removed = comment_fg
|
||||
hl.blank_bg = get_hlgroup("Folded").fg
|
||||
hl.file_info_bg = get_hlgroup("Visual").bg
|
||||
hl.nav_icon_bg = get_hlgroup("String").fg
|
||||
hl.nav_fg = hl.nav_icon_bg
|
||||
hl.folder_icon_bg = get_hlgroup("Error").fg
|
||||
return hl
|
||||
end,
|
||||
attributes = {
|
||||
mode = { bold = true },
|
||||
},
|
||||
icon_highlights = {
|
||||
file_icon = {
|
||||
statusline = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
+8
-24
@@ -4,9 +4,8 @@ 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",
|
||||
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'
|
||||
@@ -16,25 +15,11 @@ return {
|
||||
-- this file can contain specific instructions for your project
|
||||
instructions_file = "avante.md",
|
||||
-- for example
|
||||
provider = "claude",
|
||||
providers = {
|
||||
claude = {
|
||||
endpoint = "https://api.anthropic.com",
|
||||
model = "claude-sonnet-4-20250514",
|
||||
timeout = 30000, -- Timeout in milliseconds
|
||||
extra_request_body = {
|
||||
temperature = 0.75,
|
||||
max_tokens = 20480,
|
||||
},
|
||||
},
|
||||
moonshot = {
|
||||
endpoint = "https://api.moonshot.ai/v1",
|
||||
model = "kimi-k2-0711-preview",
|
||||
timeout = 30000, -- Timeout in milliseconds
|
||||
extra_request_body = {
|
||||
temperature = 0.75,
|
||||
max_tokens = 32768,
|
||||
},
|
||||
provider = "opencode",
|
||||
acp_providers = {
|
||||
["opencode"] = {
|
||||
command = "opencode",
|
||||
args = { "acp" },
|
||||
},
|
||||
},
|
||||
-- Keybindings for navigation within Avante windows
|
||||
@@ -73,7 +58,7 @@ return {
|
||||
windows = {
|
||||
position = "right", -- the position of the sidebar
|
||||
wrap = true, -- similar to vim.o.wrap
|
||||
width = 30, -- default % based on available width
|
||||
width = 26, -- default % based on available width
|
||||
sidebar_header = {
|
||||
align = "center", -- left, center, right for title
|
||||
rounded = true,
|
||||
@@ -91,7 +76,6 @@ return {
|
||||
"stevearc/dressing.nvim", -- for input provider dressing
|
||||
"folke/snacks.nvim", -- for input provider snacks
|
||||
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
|
||||
"zbirenbaum/copilot.lua", -- for providers='copilot'
|
||||
{
|
||||
-- support for image pasting
|
||||
"HakonHarnes/img-clip.nvim",
|
||||
|
||||
@@ -95,8 +95,13 @@ return {
|
||||
opts = {
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
direction = "horizontal",
|
||||
open_on_start = false,
|
||||
use_shell = false,
|
||||
auto_scroll = true,
|
||||
close_on_exit = false,
|
||||
direction = "tab",
|
||||
quit_on_exit = "success",
|
||||
open_on_start = true,
|
||||
hidden = true,
|
||||
},
|
||||
templates = {
|
||||
"builtin",
|
||||
@@ -181,6 +186,75 @@ return {
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- Register Devbox template for Overseer
|
||||
overseer.register_template {
|
||||
name = "devbox",
|
||||
params = {
|
||||
script = {
|
||||
type = "string",
|
||||
optional = false,
|
||||
desc = "The devbox script to run",
|
||||
},
|
||||
},
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
use_shell = true,
|
||||
auto_scroll = true,
|
||||
close_on_exit = true,
|
||||
direction = "tab",
|
||||
quit_on_exit = "success",
|
||||
open_on_start = true,
|
||||
hidden = true,
|
||||
},
|
||||
condition = {
|
||||
callback = function()
|
||||
if vim.fn.executable "git" == 0 then return false, "git not found" end
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if vim.v.shell_error ~= 0 or not git_root or git_root == "" then return false, "Not in a git repository" end
|
||||
local devbox_file = git_root .. "/devbox.json"
|
||||
if vim.fn.filereadable(devbox_file) == 0 then return false, "No devbox.json found in git root" end
|
||||
if vim.fn.executable "devbox" == 0 then return false, "devbox command not found" end
|
||||
return true
|
||||
end,
|
||||
},
|
||||
generator = function(_, cb)
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if vim.v.shell_error ~= 0 or not git_root or git_root == "" then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
local devbox_file = git_root .. "/devbox.json"
|
||||
|
||||
local file = io.open(devbox_file, "r")
|
||||
if not file then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
local content = file:read "*all"
|
||||
file:close()
|
||||
local ok, data = pcall(vim.json.decode, content)
|
||||
if not ok or not data then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
|
||||
local tasks = {}
|
||||
if data.shell and data.shell.scripts then
|
||||
for script_name, _ in pairs(data.shell.scripts) do
|
||||
table.insert(tasks, {
|
||||
name = "devbox run " .. script_name,
|
||||
builder = function() return { cmd = { "devbox" }, args = { "run", script_name }, cwd = git_root } end,
|
||||
})
|
||||
end
|
||||
end
|
||||
table.insert(tasks, {
|
||||
name = "devbox shell",
|
||||
builder = function() return { cmd = { "devbox" }, args = { "shell" }, cwd = git_root } end,
|
||||
})
|
||||
cb(tasks)
|
||||
end,
|
||||
}
|
||||
end,
|
||||
},
|
||||
-- Seamless navigation between build errors
|
||||
|
||||
+27
-52
@@ -28,55 +28,7 @@ return {
|
||||
-- Get all hide patterns from shared module
|
||||
local hide_patterns = ignore_patterns.get_all_patterns()
|
||||
|
||||
-- Setup LSP file operations integration
|
||||
local events = require "neo-tree.events"
|
||||
|
||||
return {
|
||||
-- LSP file operation event handlers for refactoring support
|
||||
event_handlers = {
|
||||
{
|
||||
event = events.BEFORE_FILE_ADD,
|
||||
handler = function(args) require("astrolsp.file_operations").willCreateFiles(args) end,
|
||||
},
|
||||
{
|
||||
event = events.FILE_ADDED,
|
||||
handler = function(args) require("astrolsp.file_operations").didCreateFiles(args) end,
|
||||
},
|
||||
{
|
||||
event = events.BEFORE_FILE_DELETE,
|
||||
handler = function(args) require("astrolsp.file_operations").willDeleteFiles(args) end,
|
||||
},
|
||||
{
|
||||
event = events.FILE_DELETED,
|
||||
handler = function(args) require("astrolsp.file_operations").didDeleteFiles(args) end,
|
||||
},
|
||||
{
|
||||
event = events.BEFORE_FILE_MOVE,
|
||||
handler = function(args)
|
||||
require("astrolsp.file_operations").willRenameFiles { from = args.source, to = args.destination }
|
||||
end,
|
||||
},
|
||||
{
|
||||
event = events.BEFORE_FILE_RENAME,
|
||||
handler = function(args)
|
||||
require("astrolsp.file_operations").willRenameFiles { from = args.source, to = args.destination }
|
||||
end,
|
||||
},
|
||||
{
|
||||
event = events.FILE_MOVED,
|
||||
handler = function(args)
|
||||
require("astrolsp.file_operations").didRenameFiles { from = args.source, to = args.destination }
|
||||
require("snacks").rename.on_rename_file(args.source, args.destination)
|
||||
end,
|
||||
},
|
||||
{
|
||||
event = events.FILE_RENAMED,
|
||||
handler = function(args)
|
||||
require("astrolsp.file_operations").didRenameFiles { from = args.source, to = args.destination }
|
||||
require("snacks").rename.on_rename_file(args.source, args.destination)
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
popup_border_style = "rounded",
|
||||
enable_git_status = true,
|
||||
@@ -109,9 +61,11 @@ return {
|
||||
["/"] = "fuzzy_finder",
|
||||
["f"] = "filter_on_submit",
|
||||
["<c-x>"] = "clear_filter",
|
||||
["<CR>"] = "open_and_close_neotree",
|
||||
["<S-CR>"] = "open",
|
||||
-- Git keybindings from astrocore
|
||||
["<CR>"] = "open_and_close_neotree",
|
||||
["<S-CR>"] = "open",
|
||||
-- Avante integration
|
||||
["<C-a>"] = "avante_add_files",
|
||||
-- Git keybindings from astrocore
|
||||
["<C-g>o"] = function() vim.cmd "!gh repo view --web" end,
|
||||
["<C-g>h"] = function()
|
||||
require("snacks").terminal("gh dash", {
|
||||
@@ -131,7 +85,6 @@ return {
|
||||
["<C-g>b"] = function() require("snacks").picker.git_branches() end,
|
||||
-- Terminal keybindings from astrocore
|
||||
["<C-t>m"] = terminals.mk_toggle,
|
||||
["<C-t>j"] = terminals.lazyjournal_toggle,
|
||||
["<C-t>l"] = function()
|
||||
require("snacks").terminal("lazydocker", {
|
||||
hidden = true,
|
||||
@@ -269,6 +222,28 @@ return {
|
||||
-- Filesystem specific settings
|
||||
filesystem = {
|
||||
commands = {
|
||||
-- Avante integration: Add files to avante selected files
|
||||
avante_add_files = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local filepath = node:get_id()
|
||||
local relative_path = require('avante.utils').relative_path(filepath)
|
||||
|
||||
local sidebar = require('avante').get()
|
||||
|
||||
local open = sidebar:is_open()
|
||||
-- ensure avante sidebar is open
|
||||
if not open then
|
||||
require('avante.api').ask()
|
||||
sidebar = require('avante').get()
|
||||
end
|
||||
|
||||
sidebar.file_selector:add_selected_file(relative_path)
|
||||
|
||||
-- remove neo tree buffer
|
||||
if not open then
|
||||
sidebar.file_selector:remove_selected_file('neo-tree filesystem [1]')
|
||||
end
|
||||
end,
|
||||
-- Refresh patterns when changing directories
|
||||
refresh_patterns = function(state)
|
||||
-- Re-read patterns when navigating
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--- Supermaven - Fast AI code completion
|
||||
--- @module plugins.supermaven
|
||||
return {
|
||||
"supermaven-inc/supermaven-nvim",
|
||||
config = function()
|
||||
require("supermaven-nvim").setup({
|
||||
keymaps = {
|
||||
accept_suggestion = "<Tab>",
|
||||
clear_suggestion = "<C-]>",
|
||||
accept_word = "<C-j>",
|
||||
},
|
||||
ignore_filetypes = { "cpp" },
|
||||
color = {
|
||||
suggestion_color = "#ffffff",
|
||||
cterm = 244,
|
||||
},
|
||||
log_level = "info", -- set to "off" to disable logging completely
|
||||
disable_inline_completion = false, -- disables inline completion for use with cmp
|
||||
disable_keymaps = false, -- disables built in keymaps for more manual control
|
||||
})
|
||||
end,
|
||||
}
|
||||
-104
@@ -36,111 +36,7 @@ vim.api.nvim_create_autocmd("VimResume", {
|
||||
desc = "Check for file changes after Screen reattach/resume",
|
||||
})
|
||||
|
||||
-- Overseer setup and template (optional)
|
||||
local ok_overseer, overseer = pcall(require, "overseer")
|
||||
if ok_overseer then
|
||||
overseer.setup {
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
use_shell = false,
|
||||
auto_scroll = true,
|
||||
close_on_exit = false,
|
||||
direction = "tab",
|
||||
quit_on_exit = "success",
|
||||
open_on_start = true,
|
||||
hidden = true,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
-- ToggleTerm setup (optional)
|
||||
local ok_toggleterm, toggleterm = pcall(require, "toggleterm")
|
||||
if ok_toggleterm then
|
||||
toggleterm.setup {
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 15
|
||||
elseif term.direction == "vertical" then
|
||||
return math.floor(vim.o.columns * 0.35)
|
||||
else
|
||||
return 20
|
||||
end
|
||||
end,
|
||||
shade_terminals = false,
|
||||
start_in_insert = true,
|
||||
}
|
||||
end
|
||||
|
||||
-- Register Devbox template for Overseer (if available)
|
||||
if ok_overseer then
|
||||
overseer.register_template {
|
||||
name = "devbox",
|
||||
params = {
|
||||
script = {
|
||||
type = "string",
|
||||
optional = false,
|
||||
desc = "The devbox script to run",
|
||||
},
|
||||
},
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
use_shell = true,
|
||||
auto_scroll = true,
|
||||
close_on_exit = true,
|
||||
direction = "tab",
|
||||
quit_on_exit = "success",
|
||||
open_on_start = true,
|
||||
hidden = true,
|
||||
},
|
||||
condition = {
|
||||
callback = function()
|
||||
if vim.fn.executable "git" == 0 then return false, "git not found" end
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if vim.v.shell_error ~= 0 or not git_root or git_root == "" then return false, "Not in a git repository" end
|
||||
local devbox_file = git_root .. "/devbox.json"
|
||||
if vim.fn.filereadable(devbox_file) == 0 then return false, "No devbox.json found in git root" end
|
||||
if vim.fn.executable "devbox" == 0 then return false, "devbox command not found" end
|
||||
return true
|
||||
end,
|
||||
},
|
||||
generator = function(_, cb)
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if vim.v.shell_error ~= 0 or not git_root or git_root == "" then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
local devbox_file = git_root .. "/devbox.json"
|
||||
|
||||
local file = io.open(devbox_file, "r")
|
||||
if not file then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
local content = file:read "*all"
|
||||
file:close()
|
||||
local ok, data = pcall(vim.json.decode, content)
|
||||
if not ok or not data then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
|
||||
local tasks = {}
|
||||
if data.shell and data.shell.scripts then
|
||||
for script_name, _ in pairs(data.shell.scripts) do
|
||||
table.insert(tasks, {
|
||||
name = "devbox run " .. script_name,
|
||||
builder = function() return { cmd = { "devbox" }, args = { "run", script_name }, cwd = git_root } end,
|
||||
})
|
||||
end
|
||||
end
|
||||
table.insert(tasks, {
|
||||
name = "devbox shell",
|
||||
builder = function() return { cmd = { "devbox" }, args = { "shell" }, cwd = git_root } end,
|
||||
})
|
||||
cb(tasks)
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
require("cyberdream").setup {
|
||||
variant = "default", -- use "light" for the light variant. Also accepts "auto" to set dark or light colors based on the current value of `vim.o.background`
|
||||
|
||||
Reference in new issue
Block a user