I am using astronvim. Installed copilot and set hotkey ctrl+l. Here is the code itself, lua on top, plugin below. mappings.lua file
return {
n = {
["b"] = { "<Plug>Sneak_S", desc = "Sneak back" },
["<M-l>"] = { ":wa<CR>", desc = "close all" },
["<leader>;"] = { ":vsplit<CR>", desc = "split" },
["<S-l>"] = {
function() require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end,
desc = "Next buffer",
},
["<S-h>"] = {
function() require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end,
desc = "Previous buffer",
},
},
i = {
["<C-l>"] = { "copilot#Accept('\\<CR>')", desc = "copilot expand", silent = true, expr = true, script = true },
},
}
-- imap <silent><script><expr> <C-J> copilot#Accept("\<CR>")
-- let g:copilot_no_tab_map = v:true
So, the expand works, only two non-printable characters <80>@7
appear at the end
Thanks in advance for your help.