I have an external command which accepts a SQL. I want to execute it within vim while editing SQL. I found two ways but both are not very satisfying.
:w !<cmd>
This passes the content of the current buffer to<cmd>
and outputs the result. However, because the result is shown in vim command line area, if the result is long I cannot scroll up/down the result.:%! <cmd>
This replaces the current buffer content with the cmd output, this is not what I want because I want to preserve the SQL.
If I can see the output in a new horizontal split buffer, it would be very nice. Is there any way to do so?