Highlight changed text after Undo / Redo operations. Purely lua / nvim api implementation, no external dependencies needed.
Using Lazy:
{
'tzachar/highlight-undo.nvim',
config = function()
require('highlight-undo').setup({
...
})
end
},
You can setup highlight-undo
as follows:
require('highlight-undo').setup({
hlgroup = 'HighlightUndo',
duration = 300,
})
Specify the highlighting group to use.
By default, highlight-undo
will use the HighlightUndo
highlight
group, which it defines upon startup. If the group is already defined
elsewhere in your config then it will not be overwritten. You can also
use any other group you desire.
The duration (in milliseconds) highligh changes. Default is 300.
highlight-undo
will remap the u
and <C-r>
keys (for undo and redo) and
hijack the calls. By utilizing nvim_buf_attach to get indications for changes in the
buffer, we can achieve very low overhead.