You can use
\r to represent a newline in
:%s,source /PATH/TO/OLD/ENV.sh,source /PATH/TO/NEW/ENV1.sh\rsource /PATH/TO/NEW/ENV2.sh/,
Note that in substitute patterns
\n means NULL byte, not newline. This is inconsistent and confusing (I'm not sure what the reason for it is, it's a vi quirk you'll just have to remember)
, instead of
/ to avoid having to escape all the
/s in the path; see What does it mean to replace slashes (/) by exclamation marks (!) in a substitute command?
You can use the
:tabdo commands to run any command on multiple buffers, windows, or tabs. For example:
:bufdo :%s,source /PATH/TO/OLD/ENV.sh,source /PATH/TO/NEW/ENV1.sh\rsource /PATH/TO/NEW/ENV2.sh,
Which should do what you want.