Ported over from and improved for best integration with Neovim ecosystem https://code.infektor.net/config/vim/src/branch/master/autoload/build.vim