title: Vim autocmd based on file contents
body: <p>I'm trying to set up Vim to detect when a .tex file contains the command '\usepackage{sagemath}', and run a command accordingly. I've gotten to </p>
  
  <pre><code>:au BufReadPost,BufWritePost *.tex TTarget sagepdf
  </code></pre>
  
  <p>but that will fire for all .tex files, which isn't what I want.</p>