In a script, I have the following not working code:
set eval(rules[formatoption])=value
where rules is a dictionary and formatoption and value are a variable. I want to make Vim read the variable name from rules[formatoption] and set it to value. How can I make Vim set a variable this way? I think there should be a function like setvar(name, value)or something similar, that sets name(string) to value. That line of code would save me from writing about 30 lines of code in a 70 lines script.
:exec &nu==&rnu? "se nu!" : "se rnu!"