adding an event listener to local buffer: :au CursorHold echo 'hold' event groups: :augroup uncompress : au! : au BufEnter *.gz %!gunzip :augroup END :au TextChanged call ch_sendexpr(channel, 'changed') :au TextChangedI call ch_sendexpr(channel, 'changed_i') ":au TextChanged call ch_sendexpr(channel, ['changed', 'x': col('.'), 'y': line('.')]) :au TextChanged call ch_sendexpr(channel, ['changed', getpos('.')]) :au TextChangedI call ch_sendexpr(channel, 'changed_i') pseudocode for TextChanged diffing: " not enough, maybe marks? start_pos = min(last_pos, now_pos) end_pos = max(last_pos, now_pos)