2

I'm using vim-rubytest to execute tests from within MacVim.

This prints output in vim's command output window. The problems are that this output is not scrollable or disappears after i switch to editor.

Is it possible to send this output to separate tab/window in Vim?

Sathish
  • 20,660
  • 24
  • 63
  • 71

2 Answers2

1

I don't use vim-rubytest plugin but looking at the documentation it seems to me that by default vim-rubytest will put the contents into the quickfix list. To open the quickfix window issue the following command:

:copen

You can navigate the quickfix list via :cnext and :cprevious.

I belive the quickfix approach to be the preferred way, but to answer you question you can redirect the output into a register and then paste into a new buffer.

:redir @"

Then execute <leader>T. watch it all go by. Then end the redirection and create a new buffer with the contents inside.

:redir END
:new|pu|0d_

For more help see

:h quickfix
:h :cnext
:h :redir
:h :new
:h :put
:h :delete
Peter Rincker
  • 43,539
  • 9
  • 74
  • 101
  • The output is not in quickfix! – Sathish Feb 08 '13 at 19:15
  • @Sathish, are you sure? The README [claims](https://github.com/janx/vim-rubytest/blob/master/README#L24) that the plugin explicitly uses the quickfix window. – romainl Feb 08 '13 at 20:11
  • The default is to print output in terminal. In order to use quickfix the README suggests using `let g:rubytest_in_quickfix = 1` – Dan Bradbury Oct 15 '14 at 16:54
0

The default on vim-rubytest is for let g:rubytest_in_quickfix = 0 this will execute everything on the terminal and echo the results.

In order to "open in a new window" you should set

let g:rubytest_in_quickfix = 1 and then the output will be run and applied to the quickfix. This will open up a separate quickfix window that you can use see all the failures and allow you to jump to the file.

There is an issue with the usage of quickfix that I have filed on github (Reference) that doesn't allow you to open the first error. In the issue I posted a possible fix and have my own fork with it applied + some other minor adjustments to make using quickfix more ideal in my own TDD workflow.

Dan Bradbury
  • 2,071
  • 2
  • 21
  • 27