:map dotest /^STARTTEST
j:.,/ENDTEST/-1w! Xdotest
nj0:bdel Xdotest
:so! Xdotest

dotest
