As always, it all depends on whether you
use a decent text editor. With the magic of "
insert mode", even
complex editing tasks like adding
parameters become
easier!
For convenience, I've inserted a `!' sign to denote the location of the cursor...
printf(
"for %s\n"
" mat %s\n"
" ting %s\n"
" string %s\n"!, ← start before ','
param1,
param2,
param3,
param4);
Step 2:
Type "
newline" and the additional string; the
comma moves with the cursor, and stays one step ahead.
printf(
"for %s\n"
" mat %s\n"
" ting %s\n"
" string %s\n"
" addition %s\n"!, ← still the same comma...
param1,
param2,
param3,
param4);
Step 3:
Move to the location of the next desired change.
printf(
"for %s\n"
" mat %s\n"
" ting %s\n"
" string %s\n"
" addition %s\n",
param1,
param2,
param3,
param4!); ← but can we insert without deleting?
Step 4:
Once again, the
close bracket stays one step ahead of the cursor, so just type "comma newline
tab param5":
printf(
"for %s\n"
" mat %s\n"
" ting %s\n"
" string %s\n"
" addition %s\n",
param1,
param2,
param3,
param4,
param5!); ← no text was wasted...
It's easy enough that I edited the examples in the Netscape text editor without deleting anything.
Aren't you glad you don't use vi?