0

If I issue the following command:

ls sb.ovpn | xargs vim

The classic vim opens the sb.ovpn file.

However if I do the same but with neovim:

ls sb.ovpn | xargs nvim -

That does not work as I expected, opens a new file instead (without dash does not work either). ¿Why? ¿Is that the expected behavior of nvim?

2

1 Answer 1

2

This is a (side?)effect of the changes from nvim v0.2.2 -> v0.3. Nvim did switch the default behaviour for text that is piped into it via stdin. Before it was used as commands (unless - was given as an argument), now it is used as text in the initial buffer (even without the -).

Your file argument should be there just as the next buffer in the internal argument list of neovim. Try :ls inside neovim.

You can verify that this behaviour is new with neovim v0.3 when you download the appimage for v0.2.2 and try the same with that.

EDIT: I confirmed that for version 0.3.1 it works as expected, you get file in the first buffer. You can download v0.3.1 from the release page. (thanks @jamessan for mentioning)

3
  • There was no 0.2.3 release. :) 0.3.1 has the fix.
    – jamessan
    Jul 19, 2018 at 16:47
  • @jamessan I have a nvim.appimage which reports v0.2.3-1-gd6f9d1df0 for --version. I don't remember where I got it.
    – Lucas
    Jul 19, 2018 at 17:52
  • 2
    That's a nightly build, not an official release. Initially, the release after 0.2.2 was going to be 0.2.3, but then it was decided to change to 0.3.0.
    – jamessan
    Jul 19, 2018 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.