Created
November 11, 2012 10:28
-
-
Save dahu/4054442 to your computer and use it in GitHub Desktop.
RotateBuffer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! RotateBuffer() | |
let rb=[] | |
for x in range(max(map(getline(1, '$'), 'len(v:val)'))) | |
call add(rb, []) | |
for y in range(line('$')) | |
call add(rb[x], ' ') | |
endfor | |
endfor | |
let y = 0 | |
for line in getline(1,'$') | |
let x = 0 | |
for c in split(line, '\zs') | |
let rb[x][y] = c | |
let x += 1 | |
endfor | |
let y += 1 | |
endfor | |
%d | |
for l in rb | |
call append(1, join(l, '')) | |
endfor | |
0d | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment