#Vim, 39, 34 keystrokes
Vim, 39, 34 keystrokes
:se ri
Y:s/./<C-r>"/g
<C-o>qqgJC<C-r>"<esc>gJ@qq@q
5 bytes saved thanks to @Lynn!
Here is a gif of it happening live: (Note that this gif is of a previous version since I haven't had time to re-record it yet).
And here is an explanation of how it works:
:se ri "Turn 'reverse indent' on.
Y "Yank this line
:s/./<C-r>"/g "Replace every character on this line with the register
"We just yanked followed by a newline
<C-o> "Jump to our previous location
qq "Start recording in register 'q'
gJ "Join these two lines
C "Delete this line, and enter insert mode
<C-r>"<esc> "Paste the line we just deleted backwards
gJ "Join these two lines
@q "Call macro 'q'. This will run until we hit the bottom of the buffer.
q "Stop recording.
@q "Start our recursive macro
On a side note, Y
grabs an extra newline, which is usually an obnoxious feature. This is probably the first ever time that it has actually saved several bytes!