Source

aurum / test / maps-record-undo.in

:set undolevels&vim
:cd `=g:curtest."repo"`
:function GetFirstLastLine(file)
:  let r=readfile(a:file, 'b')
:  let lastempty=empty(get(r, -1, 1))
:  if len(r)>4+lastempty
:    call remove(r, 2, -3-lastempty)
:  endif
:  return r
:endfunction
:command -nargs=1 -bar RZ   :call WriteFile([<q-args>]+getline(1, '$'))
:command -nargs=1 -bar RZC  :RZ <args> | bwipeout!
:command -nargs=1 -bar WG   :call WriteFile(tr(glob(<q-args>, 1), "\n", ' '))
:command -nargs=1 -bar WF   :call WriteFile(<q-args>.':'.string(GetFirstLastLine(<q-args>)))
:command -nargs=1 -bar WGF  :WG * | WF <args>
:command -nargs=* -bar WGFs :WG * | for file in [<f-args>] | execute 'WF' file | endfor
:W{{{1 no fullundo
:AuRecord
uAi:RZC{{{2 Add
ui:RZ{{{2 Undo
i:RZC{{{2 Redo
jAi:RZC{{{2 Add
2ui:RZ{{{2 2 Undo
2i:RZC{{{2 2 Redo
X
:W{{{1 fullundo
:let g:aurum_fullundo=1
:AuRecord
u:0/^-A
OAbcdef,A:W{{{2 Edit
:WGF addeddef
u:W{{{2 Undo
:WGF addeddef
:W{{{2 Redo
:WGF addeddef
:0/^-M
OAhijkl,A:W{{{2 Edit 2
:WGF nohglinesrev.lst
2u:W{{{2 2 Undo
:WGFs addeddef nohglinesrev.lst
2:W{{{2 2 Redo
:WGFs addeddef nohglinesrev.lst