Is there any way to run an arbitrary Javascript function from a Vim normal mode mapping?
Since in normal mode, the text widget is actually disabled, adding keys to the keymap doesn’t work. The Vim.map() command doesn’t let you run arbitrary JS functions (though I tried pretty hard to fool it ).
The only way I could see to do something approximating what I wanted was to catch the ‘vim-keypress’ event and watch for “C-A-b”. But having done that, I could see no way to keep an actual mapping of C-A-b from firing, too. So that seems a little sub-optimal.
As an aside: Instead of “C-A-b” I’d rather map “C-S-b” or “C-B”, but the normalizer doesn’t let you map shifted letters. (As near as I can tell.)
Edit: removed < & >.