With autotrigger enabled, accept suggestion and move to a new line? #109
-
With auto trigger enabled, it would seem natural to be able to move to a new line after accepting a suggestion, because it won't suggest a new line until enter a newline manually. So you have to do |
Beta Was this translation helpful? Give feedback.
Answered by
MunifTanjim
Jan 23, 2023
Replies: 1 comment 1 reply
-
You can make your custom accept keymap for that: require("copilot").setup({
-- ...
suggestion = {
keymap = {
accept = false, -- disable default accept keymap
-- ...
},
-- ...
},
-- ...
})
vim.keymap.set("i", "<M-l>", function ()
require("copilot.suggestion").accept()
-- extra newline
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<CR>", true, false, true), "n", false)
end, {
desc = "[copilot] accept suggestion",
silent = true,
})
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
MunifTanjim
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can make your custom accept keymap for that: