title: Set runtimepath, adding a directory from an expression in vim?
body: <p>Inn <code>~/script.vim</code>, I have:</p>
  
  <pre><code>set runtimepath+=string(substitute(expand("%:p"), 'script\.vim', '', 'g'))
  </code></pre>
  
  <p>I have an alias in <code>.bashrc</code>:</p>
  
  <pre><code>alias vimscript="vim -S ~/script.vim"
  </code></pre>
  
  <p>Running <code>string(substitute(expand("%:p"), 'script\.vim', '', 'g'))</code> works as intended. </p>
  
  <p>The problem is when using it in the set runtimepath expression, it doesn't work when I call <code>vimscript</code> in terminal which calls <code>script.vim</code>. When I run <code>set rtp</code> in vim after being called by vimscript to check the runtimepath, the desired appended string isn't showed (but the other ones are there).</p>