Next edit suggestion
nes-demo-new.mp4
Please note that it is currently in a very early stage of development. Features may be incomplete, bugs are likely to occur and breaking changes may occur frequently. Use with caution.
curlin yourPATHgithub/copilot.vimorzbirenbaum/copilot.lua: we don't depend on them directly, but you should sign in firstnvim-lua/plenary.nvim
lazy.nvim for example:
{
'Xuyuanp/nes.nvim',
event = 'VeryLazy',
dependencies = {
'nvim-lua/plenary.nvim',
},
opts = {},
}
no configuration currently.
This plugin provide three functions:
get_suggestion(bufnr): to fetch the next edit suggestionapply_suggestion(bufnr, opts): apply the fetched suggestion. option fieldsjump boolean: auto jump to the end of the suggestion after applytrigger boolean: auto trigger new suggestion
clear_suggestion(bufnr)
Map these functions to your favorite keybindings. My keybindings are:
-- lazy config
keys = {
{
'<A-i>',
function()
require('nes').get_suggestion()
end,
mode = 'i',
desc = '[Nes] get suggestion',
},
{
'<A-n>',
function()
require('nes').apply_suggestion(0, { jump = true, trigger = true })
end,
mode = 'i',
desc = '[Nes] apply suggestion',
},
},
NesAdd: highlight the added lines(default: link to 'DiffAdd')NesDeletehighlight the deleted lines(default: link to 'DiffDelete')NesApplyhighlight the added lines after applied(default: link to 'DiffText'). You can disable this by passing optjump = {hl_timeout = 0}toapply_suggestionfunction.
- multiple suggestions support
- auto trigger