vis icon indicating copy to clipboard operation
vis copied to clipboard

An event for when an edition happens in the file

Open bzbug opened this issue 5 years ago • 0 comments

Trying to implement vim-like `. behaviour (jumps to last edited place):

-- jump to last edit place on backtick (`)

vis.events.subscribe(vis.events.INPUT, function(key)
	vis:feedkeys('<vis-mark>z<vis-selections-save>')
end)

vis:map(vis.modes.NORMAL, '`', '<vis-mark>z<vis-selections-restore>')

Works fine for editions made in INSERT mode, but doesn't work for REPLACE or r operator. Also doesn't work for deletion. Any adequate way to track all edits in a file? And, btw, maybe new mark traking last edits like in vim?

bzbug avatar Dec 11 '20 19:12 bzbug