title: How do I check if I've been run in read-only mode (-R) in vimrc
body: <p>In my .vimrc, I'd like to be able to check if I've been run either by <code>vim -R</code> or <code>view</code>. If so, I plan to either disable or delay some plugins from loading to speed up the times when I quickly want to look at a file.</p>
  
  <p><code>:args</code> and <code>argv()</code> only seem to show me which files I wanted to edit, not all the command line flags.</p>
  
  <p>Checking <code>if &amp;readonly</code> almost works. If I have this:</p>
  
  <pre><code>if &amp;readonly
      echo "read only"
  else
      echo "not read only"
  endif
  </code></pre>
  
  <p>Then I get <code>read only</code> echoed when I execute <code>view</code> or <code>vim -R</code>, but if I do either <code>view ~/.vimrc</code> or <code>vim -R ~/.vimrc</code> then I get <code>not read only</code>. Very strange.</p>
  
  <p>Thanks!</p>