Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've seen lots of ways to redirect input from stdin to VI, but I'd like to redirect VI to save to a pipe rather than a file. For example, I'd like to pipe VI's entire pipe buffer to another text editing program, such as kate. Is this possible?

share|improve this question

I'm not sure about plain vi. But in Vim, you can write a buffer (or portions of a buffer) to an arbitrary external command via stdin, like :w !my_external_command

The help does not mention this being a Vim-specific command, so it may also be available in vi. If you're actually using Vim after all and not just vi, then see :help :w_c for details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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