If I have a vim session with two splits, when I execute a
:! command, the result is shown in the entire window. Is it possible to have the output shown just on the active split?
You can use this command :
:new | 0read ! command
This will open up a new split and puts the output of the command in this split (though not in the currently active split as you mentioned).
new - creates new split
read - to get the command output
command - actual command
You can make a command to do just this:
- Open a new split (or tab)
- Run a command and show the results in that split (or tab)
The command would be something like this:
.vimrc you can write this:
" execute a command and show its output in a split window command! -nargs=* -complete=shellcmd Rsplit execute "new | r! <args>" " execute a command and show its output in a new tab command! -nargs=* -complete=shellcmd Rtab execute "tabnew | r! <args>"
You can find how to make your own commands with
That won't be possible. You'll have to split your screen with another tool like tmux (IIRC), screen, ...
If you don't need to interact with the program executed, you can however import its results directly in any window (in the vim sense
:h windows) you wish with