Tags: #vim
" Example 6 line file...
"
"./foo/requirements.txt
"./foo/requirements-to-freeze.txt.txt
"./bar/requirements.txt
"./bar/requirements-to-freeze.txt.txt
"./baz/requirements.txt
"./baz/requirements-to-freeze.txt.txt
"
" We want to swap each line, so it becomes...
"
"./foo/requirements-to-freeze.txt.txt
"./foo/requirements.txt
"./bar/requirements-to-freeze.txt.txt
"./bar/requirements.txt
"./baz/requirements-to-freeze.txt.txt
"./baz/requirements.txt
"
" Steps...
"
" - record macro (changes are: ddpj), qqddpjq (q starts macro recording, into q register, and end q stops the recording).
" - repeat macro a number of times that matches the number of lines we have
6@q