title: Vim: Checking for blank lines below to keep the cursor position at the center
body: <p>When I start with a new program, the cursor eventually gets to the bottom of the screen. I want it to remain at the center, I managed this with following in vimrc file.</p>
  
  <pre><code>autocmd InsertEnter * :set scrolloff=9999
  autocmd InsertLeave * :set scrolloff=0
  </code></pre>
  
  <p>But when I make small changes in the code, the cursor jumps to the middle of the screen which is a bit annoying. I would like to know, how to check conditions for next blank lines(say 5), before vim executes the above commands i.e <code>set scrolloff</code>. I could start with 5 blank lines at the bottom while writing new code.</p>