capture - run a shell command, capturing its output in the [Output] buffer


In .vilerc:

    perl "use capture"

In [x]vile:




and then provide the command to run at the ensuing prompt.


The capture package provides a drop-in replacement (almost) for vile's capture-command command.

It provides additional functionality, however. Rather than waiting for the command to finish before displaying the buffer, this version will update the [Output] buffer as the results of the command become available thus permitting the user to perform other editing tasks while the command is running.

Also, unlike its builtin cousin, will preserve all of the commands that have been run in the [Output] buffer, setting the current position to the first line of the new output after the command has completed. This allows the error finder to operate on the newly read in lines. The error finder may also be used before the command has completed, but the user must position the cursor manually for this to work.

When capturing a slow or long running command, look at the cursor position prior to adding new output from the command. If the position is near the end of the buffer, the cursor will be repositioned to be at the end of the new text added to the buffer. Otherwise, the cursor will be left alone. This allows the user to either watch the output or browse the buffer whichever is desired.


There is no way to interrupt a command once started.


Kevin Buettner