tldr: The title pretty much summarizes the entirety of the question
I am trying to make my configuration more adaptable to different machines so that I can use git to keep them in sync between my personal windows, linux, and work machines.
right now my
init.vim passes absolute literal paths to the source key word and it works fine, but say I want to do something like this...
let prefix = $HOME . '/AppData/Local/nvim'
let prefix = $HOME . '/.config/nvim'
source prefix . '/vim-plug/plugins.vim'
This doesn't work because the
source keyword interprets everything literally. So how can I make it expand the variables?
Here are some things i've tried
source exec expand(prefix) . '/rest/of/path'
source <exec> expand(prefix) . '/rest/of/path'
source <exec> prefix . '/rest/of/path'
exec source prefix . '/rest/of/path'
and many other variations
As I have been unsuccessful in finding an answer in a search engine, I've resorted to guessing different variations of this which is tedious and unproductive. So does anyone know how to make this work?