Added a check of file name
the previous script would change the search string in the .vimrc file when editing.
solved this now.