Closed 7m0E7TRWiyc7eJlETAgDR-rp6HLJf2yvSnJLuQL closed 3 years ago
Not directly.
But you could always ggyG
to yank the whole file, :split filename
to open that one, GP
to paste it at the end, and w
to write it?
I worked out a way to do it, although I have no idea why it works as I didn't see it in the documentation, but:
:+.> cat >> filename
I'm sure someone can explain it to me, but for what ever reason, it works on any line I choose except for the first one. The :.> cat >>
was found in a different comment here, but adding the + is what made it work for me.
Hm, that ought to append the current line to the file. +.
will just keep the current selection, and > cat >> filename
will pipe (the lines of) the current selection to the cat >> filename
command, which will append this.
What should be the working thing (if you don't mind cat
) is :,> cat >> filename
. ,
means the entire file.
The explanation of @ninewise is correct.
Is there a way of duplicating vim for an append write:
:w >> filename