mirror of
https://github.com/harivansh-afk/nvim.git
synced 2026-04-15 13:03:45 +00:00
fx
This commit is contained in:
parent
acb7a4ea8c
commit
f828dd8ff1
1 changed files with 4 additions and 10 deletions
|
|
@ -19,17 +19,14 @@ return {
|
|||
|
||||
vim.notify(string.format("Refactoring with model '%s'...", model), vim.log.levels.INFO)
|
||||
|
||||
-- Run refactor script asynchronously in the background
|
||||
-- Using nohup to detach from nvim - continues running if nvim closes
|
||||
local log_file = vim.fn.expand("~/.ai/refactor-nvim.log")
|
||||
-- Run refactor script synchronously
|
||||
local cmd = {
|
||||
"sh", "-c",
|
||||
string.format("nohup bun %s '%s' %s >> %s 2>&1 &", refactor_script, filepath, model, log_file)
|
||||
"bun", refactor_script, filepath, model
|
||||
}
|
||||
|
||||
local job_id = vim.fn.jobstart(cmd, {
|
||||
on_exit = function(_, exit_code)
|
||||
active_jobs[job_id] = nil
|
||||
on_exit = function(j_id, exit_code)
|
||||
active_jobs[j_id] = nil
|
||||
if exit_code == 0 then
|
||||
vim.schedule(function()
|
||||
vim.cmd("checktime") -- Reload file if changed
|
||||
|
|
@ -129,9 +126,6 @@ return {
|
|||
vim.keymap.set("n", "<leader>aX", refactor_with_model("X"), {
|
||||
desc = "Refactor with Grok-4 (high)"
|
||||
})
|
||||
|
||||
print("AI Refactor keybindings loaded: <leader>a[gisoX] for different models")
|
||||
print("Use :RefactorJobs to view active jobs, :messages to view output")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue