I have an SQL file that I have to work on from the command line.
-- Query 1 select 1; -- Query 2 select * from metadata;
I've marked line
4Gma) and line
5Gmb), then execute
:'a,'b w !mysql -u root db \| less to view the contents. I've mapped this snippet to
F5 so that I can simply reset marks
b and press
F5 to see the result. This works fine.
What I want to do now is insert the results of the query into the document, much like what
:r !cmd provides. I know I can replace
r !cmd, but
%s is replaced with the filename, and I only want to execute the SQL query in the current range.
Is this possible, and if so, how?