TLDR: This is sorta like a mix of VIM normal mode & ParEdit
I want to do the following. Pressing Ctrl-S puts CodeMirror into an alternative mode, where
h → go to left sibling
l → goto right sibling
j → go down in syntax tree
k → go up in syntax tree
… → other keys for navigating via syntaxTree nodes
Ctrl-S → go back to regular CodeMirror editing
So basically Ctrl-S toggles between two modes: regular codemirror editing mode and special ast-navigating mode.
What is the right layer to do this ?
EDIT: I already have the functions for navigating the syntax tree. What I need help on is defining this keymap / injecting it into CodeMirror.