I'd like to write content of the file into separate files each for each line.
For example:
Lorem
ipsum
dolor
sit
amet
consectetur
adipiscing
elit
I'd like to write 1st line into line1.txt
, 2nd into line2.txt
, etc.
I've tried this command:
:. w line1.txt
which works for the current line, however this doesn't work:
:. w line\=line('.').txt
even though it would save only a single line.
How can I write a file for each line dynamically based on the current line number?