I use different versions of scheme (Gambit-C and Guile) and I have written a syntax file for (most of) Gambit-C's keywords. However I only want to use it when I am using files for Gambit-C.
Sourcing it from my vimrc does not work as the scheme syntax is sourced after my vimrc and If I source it using -s < scriptin > or -c < cmd >, it only works for the first file opened and I have to source it for each extra file/argument.
I saw this solution which solved my problem partially, but I do not really want vim to use the Gambit-C syntax for every scheme file. I also tried adding
if exists("b:is_gambit") || exists("is_gambit")
"syntax extensions
....."
endif
and using it like was shown in the chicken scheme vim help but that did not work and then I realized that it did not seem to work for chicken scheme either (i.e. Setting "let b:is_chicken" in the ".vim/ftplugin/scheme.vim" file does not add chickens syntax to scheme)!!
Am I doing something wrong with the variables "(let b:is_chicken)" and (let b:is_gambit) or is there another way to make it work for selected scheme files eg making .vimrc source a file after all the files have loaded?
UPDATE: It turns out that for some reason, ".vim/ftplugin/scheme.vim" was not getting sourced and the variable "b:is_chicken was not set (this can be checked using ":scriptnames" or "echo b:is_chicken"). I then put "let b:is_chicken" in ".vim/syntax/scheme.vim" and the chicken scheme syntax worked. This does not distinguish between different scheme files though.