I would like to find a plugin, what can do the following in normal mode of vim:
- Parameter initialization
- Parameter substitution into text based on templates
Suppose we have many sql query where country_code
can change but the other conditions are always the same :
select * from customers c where c.id= ... c.country_code=36
select * from product p where p.name= ... p.country_code=36
.... several other query with ... country_code=36
So, the plugin can replace the :cc
to 36
and result can be on the clipboard, or buffer but I dont want to touch the original queries, i want to keep them as templates.
Thanks in advance.
%s/country_code=/\036
) and then simply yank the desired line? You don't even have to write your file to a temporary one you can simply do the substitution, yank your command and then quit vim without saving your file. – statox Jan 21 '18 at 18:52