Ralph Shumaker wrote:
I know the vim command :%s///gc to replace throughout the file, with verification, including multiple occurrences on individual lines. But I'm not quite sure how to go about what I want.

I want to issue the command such that any lines that are not ^$$ (BOL$EOL) or ^%$ will get <br> appended *unless* the line already ends <br>$ (<br>EOL).

Ralph<br>
<br>
--------------------<br>
$
sig 1<br>
--anon<br>
%
sig 2<br>
--anon<br>
%
new sig
--anon
%
newer sig
--anon
%
newest sig
--anon

%
yet another sig

with a blank line in the middle
--anon


The command, when issued, should add <br> to the end of each of the new sigs, but not to any of the lines that already end with <br> *nor* to any of the lines containing only $ or %. The exceptions are making it overly complex in my mind. I'm not terribly familiar with regex. I use it infrequently.

One of the exceptions that could occur is a blank line in a sig (as now noted above).


I'm thinking about creating a script file called sigs that will load the sig file with vim. After I exit vim, the script will then use sed to check for <br>$ and add them wherever needed.

TIA






--
Ralph

--------------------
One day I stumbled across a case of Scotch.

As I recall, I stumbled several days thereafter.
--W.C. Fields


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to