I'd like to set a mapping to loop through a list of colorschemes in MacVim.
Ideally, I'd have an array of color schemes like this:
let s:schemes = ['zellner','ron','morning','murphy','peachpuff','torte']
And in a function set the colorscheme to an index of this array:
colorscheme s:schemes[s:schemeindex]
However this above line does not work. Why?
Instead, I use a workaround which works fine:
function SwitchScheme()
if s:schemeindex == 0
colorscheme zellner
s:schemeindex = 1
elseif s:schemeindex == 1
colorscheme ron
s:schemeindex = 2
...
endif
endfunction
My question is, is there a cleaner way to do this? I'd like to pass a variable to the colorscheme setter function but this doesn't seem to be working.
Are these scheme names constants and if so how do you assign them to a variable?
Many thanks.