Add InplaceHandler command #22
Replies: 4 comments 7 replies
-
Sounds amazing @ziontee113 Let's do it. Could you open the PR for What do you think? @gptlang. |
Beta Was this translation helpful? Give feedback.
-
@gptlang The CopilotAgent command is just like the current CopilotChat command, but rewritten with some extra features like prompt folding and display token counts. I'll rename that command in the PRs. |
Beta Was this translation helpful? Give feedback.
-
https://discord.com/invite/Y9aSwFjV Here's the link to the Discord server |
Beta Was this translation helpful? Give feedback.
-
Hi @gptlang I've tested the This is my config if you want to take a look. local IS_DEV = false
local prompts = {
-- Code related prompts
Explain = "Please explain how the following code works.",
Review = "Please review the following code and provide suggestions for improvement.",
Tests = "Please explain how the selected code works, then generate unit tests for it.",
Refactor = "Please refactor the following code to improve its clarity and readability.",
-- Text related prompts
Summarize = "Please summarize the following text.",
Spelling = "Please correct any grammar and spelling errors in the following text.",
Wording = "Please improve the grammar and wording of the following text.",
Concise = "Please rewrite the following text to make it more concise.",
}
return {
-- Import the copilot plugin
{ import = "lazyvim.plugins.extras.coding.copilot" },
{
dir = IS_DEV and "~/Projects/research/CopilotChat.nvim" or nil,
"jellydn/CopilotChat.nvim",
-- Will be merged to main branch soon
branch = "canary",
opts = {
mode = "split",
show_help = "no",
prompts = prompts,
},
build = function()
vim.defer_fn(function()
vim.cmd("UpdateRemotePlugins")
vim.notify("CopilotChat - Updated remote plugins. Please restart Neovim.")
end, 3000)
end,
event = "VeryLazy",
keys = {
{ "<leader>cce", "<cmd>CopilotChatExplain<cr>", desc = "CopilotChat - Explain code" },
{ "<leader>cct", "<cmd>CopilotChatTests<cr>", desc = "CopilotChat - Generate tests" },
{ "<leader>ccr", "<cmd>CopilotChatReview<cr>", desc = "CopilotChat - Review code" },
{ "<leader>ccR", "<cmd>CopilotChatRefactor<cr>", desc = "CopilotChat - Refactor code" },
{ "<leader>ccs", "<cmd>CopilotChatSummarize<cr>", desc = "CopilotChat - Summarize text" },
{ "<leader>ccS", "<cmd>CopilotChatSpelling<cr>", desc = "CopilotChat - Correct spelling" },
{ "<leader>ccw", "<cmd>CopilotChatWording<cr>", desc = "CopilotChat - Improve wording" },
{ "<leader>ccc", "<cmd>CopilotChatConcise<cr>", desc = "CopilotChat - Make text concise" },
-- Those commands only available on canary branch
{
"<leader>ccv",
":CopilotChatVsplitVisual",
mode = "x",
desc = "CopilotChat - Open in vertical split",
},
{
"<leader>ccx",
":CopilotChatInPlace<cr>",
mode = "x",
desc = "CopilotChat - Run in-place code",
},
},
},
} |
Beta Was this translation helpful? Give feedback.
-
Hi @jellydn , I've been adding new features on my own to CopilotChat.nvim.
I made a ton of changes and didn't account for it to be public, so I just created a new repo, copy the core Copilot API from CopilotChat.nvim into the new repo and not fork the original project.
But now I see the original CopilotChat.nvim repo pointed to your fork, and it seems like you're gonna be quite active on the project, I think maybe we should work together actively on the same code base.
My project is currently here https://github.com/ziontee113/CopilotAgent.nvim
I plan to make this into a super agent that can handle complex coding tasks, hence the name of the derived repo.
CopilotAgent
andCopilotAgentVisual
is basically like the originalCopilotChat
, but re-written with some new features.InplaceHandler
purpose is to prompt copilot and replace code in place, likeChatGPT.nvim
using popup windows.I also created new PopUp / Layout modules to handle such tasks like
nui.nvim
, but in Python.Here's how I'm using it:
I'm still very inexperienced with collaborating with other people. If you want to we could join forces and make a great plugin together.
Please let me know what you think. Thank you very much.
Beta Was this translation helpful? Give feedback.
All reactions