I want to run a system command from vim (:help :!
), and I want to pass the contents of a string variable as stdin for that command.
I already know I can pass lines from the current buffer as stdin (see :help :w_c
). But I don't want to modify the current buffer, and I don't want to make a new buffer.
I know I can write the string to a temporary file, then pipe that file as input and delete it. Right now, that's the best solution I know for my application. But it would be cleaner to avoid creating the file in the first place.
Can it be done?