[SOLVED] How would I pipe data into neovim and make it open with a filename?

Hey!
How would I go about piping some text into neovim and make it open in a buffer with a filename (currently it opens without a filename).

I’ve read the man page and I’ve searched the internet for a bit, but I just can’t seem to figure it out. I’ve tried things like:

echo test | nvim test.txt
echo test | nvim -- test.txt
echo test | nvim - -- test.txt

, but none of them work as I want them too (they open with test inside them, but it says [No Name] instead of test.txt on the bottom).

Any idea of how I can achieve this functionality?

You can try echo test | nvim - +'file test.txt'.

Note the quoting.

It works! Thank you!