Is it possible to define mappings that only get active when a certain
spelllang is set?
E.g. I want to set the following mapping, but only if I use
inoremap oe ö
You can use a conditionnal mapping:
inoremap <expr> oe ( &spelllang == "de" ) ? "ö" : "oe"
<expr> specified Vim knows that when it sees
oe as an input it should execute the rest of the mapping as a vimscript expression and map
oe to the result of this expression.
Here the expression is a conditionnal operator: if
&spelllang == "de" is true then return
ö otherwise return