I know I can write to a file by simply doing
:w <file>. I would like to know though how can I write to a file by appending to it instead of overwriting it.
Example use case: I want to take some samples out of a log file into another file. To achieve that today I can do:
- Open the log file
- Select some lines with
- Write to a file:
- Select some more lines with
- Append to
:w !cat - >> /foo/samples
Unfortunately step 5 is long, ugly and error prone (missing a
> makes you lose data). I hope Vim has something better here.