4

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?

2
  • 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. Commented Mar 7, 2017 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? Commented Mar 7, 2017 at 19:22

1 Answer 1

2

try

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> 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.