Second draft, seems to work a little better:
save undo if we qa!
function! MyWundoQuit()
let undoseq = undotree().seq_cur
earlier 1f
let undof = escape(undofile(expand('%')),'% ')
exec wundo . undof
silent! exec u . undoseq
endfunction
autocmd BufWinLeave * call
I have a string of rows of dashes alternating with spaces,
where the number of dashes/spaces is variable
- --- ---
I want to get a List of the offsets of all the space sequences,
kind of a match() with /g (that's the best I can do to describe
it...) In the case above
Le mardi 21 juillet 2015 10:02:15 UTC+2, aubertin.sylvain a écrit :
For instance I should like to make F9 stand for papa
Following VIM Manual (by Moolenaar) I type :
:map F9 ipapaEsc (5 characters for Esc and 4 characters for F5 )
But it doesn't work. Instead of « papa « , it returns F9
Den 2015-07-28 18:02, BPJ skrev:
I have a string of rows of dashes alternating with spaces,
where the number of dashes/spaces is variable
- --- ---
I want to get a List of the offsets of all the space sequences,
kind of a match() with /g (that's the best I can do to
Here's a first draft of getting it to work:
save undo if we qa!
function! MyWundoQuit()
silent! later 9
earlier 1f
let undof = escape(undofile(expand('%')),'% ')
exec wundo . undof
endfunction
autocmd BufWinLeave * call MyWundoQuit()
I don't see a way to undo back to when