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