I would like to write whole buffer into standard output (/dev/stdout
) instead of the file and the following command works as expected while editing the file:
:w >> /dev/stdout
Hint: Press Control+L to refresh the screen.
But it doesn't work as expected when I'm trying to do the same from the command line (non-interactively), in example:
$ echo This is example. | vim - '+:w >> /dev/stdout' '+:q!'
Vim: Reading from stdin...
The same with :w !tee
, :x! /dev/stdout
, :%print
and similar.
Before quit, it's saying: [Device] 1L, 17C appended
.
Is there any way of forcing vim to write the standard input into standard output in the middle of a pipe? Maybe it's somehow buffered?
vim
for file parsing instead ofsed
(e.g. mass repeated complex changes to multiple large files). The example doesn't do anything to keep it simple and not making potential duplicate of another post.