Re: How do I ensure a line is present only once?
- Ron Aaron <v-ronaar@...> writes:
>Hi all --This works for me:
>I'm running into a small problem with some scripts. I want to make sure a
>certain line is present in a buffer only once.
" line 1 will not match:
%s/== linetomatch ==/==!@#$!@$==/e
" if we changed pos, the line existed
if line(".") != 1
" revert change
" put new line
$ put='== linetomatch =='