If I run:
:w !node
It will take my current buffer and send it to stdin and run the code in node.
If I run:
:redir @+ | echo "bob" | redir END
It ends up on the system clipboard.
But if I want to copy the output to the clipboard, by running:
:redir @+ | w !node | redir END
It seems the input from the current buffer does not reach node, and that it tries to run redir as a command from bash for some reason.
:redir @+ | w !node | redir END
/bin/bash: redir: command not found
events.js:141
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at exports._errnoException (util.js:907:11)
at WriteWrap.afterWrite (net.js:790:14)
shell returned 127
Is there some other way to do this?