Suppose I have the following code:
let s:user_config=fnamemodify('user.vim', ':p')
echom 'file found: ' . s:user_config
if filereadable(s:user_config)
source s:user_config
else
echom s:user_config . 'was not found'
endif
If I run this, I get:
file found: /home/ninrod/vim_test/user.vim
Error detected while processing /home/ninrod/vim_test/test.vim:
line 4:
E484: Can't open file s:user_config
Press ENTER or type command to continue
on the echo line, the variable s:user_config
was correctly interpolated. How do I tell vim to interpolate the s:user_config
on the source line?