title: Scripting Vim with find -exec
body: <p>I have a little Vim script which does a multi-line search and replace:</p>
  
  <pre><code>vim -c 's/^ *&lt;hi a=\"26\"&gt;\nHello/&lt;td height=\"26\"&gt;\r&lt;\/table&gt;\r&lt;bla \/&gt;' \
      -c 'w!' -c 'q' test.html
  </code></pre>
  
  <p>That works. However, when I put that in a find -exec to do this recursively in the directory:</p>
  
  <pre><code>find . -iname 'test.html' -exec \
      vim -c 's/^ *&lt;hi a=\"26\"&gt;\nHello/&lt;td height=\"26\"&gt;\r&lt;\/table&gt;\r&lt;bla \/&gt;' \
      -c 'w!' -c 'q' \
  {} \;
  </code></pre>
  
  <p>test.html remains unchanged, and Vim gives me this error:</p>
  
  <pre><code>Pattern not found:
    ^ *&lt;hi a=\"26\"&gt;\nHello
  in ./test.html
  </code></pre>
  
  <p>This is really strange because that is the correct regex, and I can search for it manually in Vim with success.</p>
  
  <p>Can you see any obvious errors with my find syntax?</p>