From cf91dfb61e42c606322cbb30f6e821aaf78ffb39 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 14 Dec 2022 02:09:20 +0100 Subject: [PATCH] vim notes --- vim_research/notes.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 vim_research/notes.txt diff --git a/vim_research/notes.txt b/vim_research/notes.txt new file mode 100644 index 0000000..b5bd1bf --- /dev/null +++ b/vim_research/notes.txt @@ -0,0 +1,26 @@ + +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) + +