I have a Perl test script. I a) use Vimux to show the output of the script in a new pane. Once the script is done with its output, I want to b) immediately hide the pane in preparation for c) pulling up the output of the test script (saved in a file) in a new buffer where I can see it nicely syntaxed highlighted with vim just how I like it.

Here is the vim code for for parts a) and b) of my task:

nnoremap <F7> :w<CR>:call VimuxRunCommand("prove --normalize -v -j 10 -a test.tgz " . bufname('%'))<CR><bar> :silent !tmux kill-pane -a -t 0<CR>

The problem is that the pane closes immediately before anything gets output to it. I want to wait for my prove command to finish executing before I run the next vim command. Is there a way to do this?

  • You can use sleep command to wait. Instead of :call, you can store the value returned bt the VimuxRunCommand and evaluate it with a true/false criteria and close it.
    – SibiCoder
    Mar 7 '17 at 19:02
  • So let's say I sleep for 5 seconds but the script runs 10 seconds. There's no way to make that work, right?
    – StevieD
    Mar 7 '17 at 19:22


nnoremap <F7> :w <bar>
  \ call VimuxRunCommand("prove --normalize -v -j 10 -a test.tgz " . bufname('%')) <bar>
  \ echo 'press any key' <bar>
  \ call getchar() <bar>
  \ silent !tmux kill-pane -a -t 0<CR>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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