2

I run my tests file like such:

:!bundle exec rspec my_file_spec.rb

When I run that command it displays my test results in another window and I get "Press ENTER or type command to continue" to return back to vim. That's all working.

What I'd like to do though is get back to that previous output once I've left it. Is that at all possible?

I don't see it in my list of buffers and I really don't need to keep the output in a separate window/split.

1 Answer 1

2

The output from the :! command is printed directly to the terminal (or GVIM's built-in emulator); it is not saved. To do that, you could redirect into an external file with tee:

:!bundle exec rspec my_file_spec.rb | tee a.out
:split a.out

Or, you directly open a scratch buffer and :read in the command's output:

:new +setl\ buftype=nofile | 0read !bundle exec rspec my_file_spec.rb

The downside of this is that you only see the output once the external command concludes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.