In Vim I am trying to paste a few lines:
PROC SQL;
CONNECT TO DB2(DSN=test);
CREATE TABLE test AS SELECT *
FROM CONNECTION TO DB2 (
above every line starting with “select”
and
);
quit;
below every line that ends with “FOR FETCH ONLY”
Is there a way to use the paste buffer? Like
%s/^select/(a!)\rselect/
so that it once I type the command it opens a paste buffer like the a! command, and uses that as the substitute?
Thanks,
Dan
If you have the
PROC SQLblock in register a and thequit;block in register b, then you can simply do the following.:g finds all lines that match the given pattern and then runs the specified ex command on those lines. In this case, you want to use :put to paste the contents of the specified registers.