Therefore, I was wandering if there's a common or preferred way to accoplish something like this.
The intuitive way, to me, seems pretty obvious: create a
autocmd that is triggered when the cursor moves into that window, and another one when it moves away from that windows. The two
autocmds should activate the plugin-specific mappings and revert the original mappings/functionalities respectively.
However, I can't see how the latter can be done without having to write a list of "mappings to be recovered or removed".
The motivation for this question is that I'm considering writing a small plugin to make all window-related actions (like moving them, moving across them, opening them, closing them, ...) easier to perform, as described here.