The following function performs the necessary editing operations to "transpose" the contents of the current buffer.
fu!T() let[m,n,@s]=[0,line('$'),"lDG:pu\r``j@s"] g/^/let m=max([m,col('$')]) exe'%norm!'.m."A \e".m.'|D' sil1norm!@s exe'%norm!'.n.'gJ' endf
Below is its single line version,
let[m,n,@s]=[0,line('$'),"lDG:pu\r``j@s"]|exe'g/^/let m=max([m,col("$")])'|exe'%norm!'.m."A \e".m.'|D'|exe'sil1norm!@s'|exe'%norm!'.n.'gJ'
ib. Sep 06 2018-11-11T00: 00Z
source share