CodeMirror allows for some customization, via javascript calls for both the global context and for some modes, at least the vim mode.
I am not aware of a place where I can add user-specific code that would be called at the correct times to configure CodeMirror. Am I missing something?
If there currently is no such capability, I'll start a proposal over in the Features category.
I was wondering this myself the other day, I made a comment on github (which i won't link, its an old, closed PR that is a bit out of date) with the following:
Alternatively, and this might just be me speaking from pure naïvety, would be to expose the Codemirror config options as an "advanced" section within Joplin with the ability to activate or set certain CM flags to override the default behaviour. The benefit with that could be that it is purely handled by the users as "use at your own risk" type option like the CSS styling with no guarantee that it will remain stable or that the features are necessarily compatible.