Typing a / should not move curosr to end of line
Opened this issue · 2 comments
It's impossible to type a /
char in the prompt when all you need is a literal /
. For example:
Why am I showing high disk i/o when running this code?
Screencast.From.2024-12-20.21-40-10.mp4
Expected behavior
Is it possible to make it so that when you type /
or some other autocomplete char, it doesn't force the cursor to the end of the line, allowing you to continue typing?
I believe #
has the same issue.
I believe this is the issue behind the following warning in the README:
If you are on neovim < 0.11.0, you also might want to add noinsert and popup to your completeopt to make the chat completion behave well.
There are three easy-ish ways to work around this yourself:
- Upgrade to NeoVim 0.11.0
- Make the changes recommended above globally (though this will change how completion works everywhere).
- Use a
config
function that looks something like this to automatically set these options only in Copilot buffers. (If you want one of these options to remain enabled everywhere, you'll have to change this code accordingly.)
config = function(_, opts)
require("CopilotChat").setup(opts)
vim.api.nvim_create_autocmd('BufEnter', {
pattern = "copilot-*",
callback = function()
vim.opt.completeopt = vim.opt.completeopt + "noinsert" + "noselect"
end
})
vim.api.nvim_create_autocmd('BufLeave', {
pattern = "copilot-*",
callback = function()
vim.opt.completeopt = vim.opt.completeopt - "noinsert" - "noselect"
end
})
end,
It would definitely be nice if the plugin automatically did this for you when using 0.10.0 though. I can't imagine anyone actually wanting the current behavior.