An easy way to achieve this could be to have a «control layer»
Add a new layer (let’s say layer7)
on this layer, put all the letters with the control modifer
on the base layer (layer 1) replace the control key by a Shift to layer 7 (your control layer defined above)
now you can change j and k by arrows keys, than move the j to an useless symbol because it’s used for snippet navigation, and even move Ctrl-w to avoid closing firefox tabs
As the process can be long, you can start with a 4 letters layer (z a j k?) to validate the idea, and take the time to finish the layer if it’s ok !
You could also use a fairly simple custom plugin for this. It would define an onKeyEvent() handler, which would do nothing unless a Key_J or Key_K toggle on event was received. In that case, it would search the live_keys array for a Key_LeftControl (and/or Key_RightControl, or possibly any modifier key including a control bit), and if one is found, it would change the value of event.key to Key_LeftArrow or Key_RightArrow.
Here’s a little plugin that you can add to your sketch to do this:
namespace kaleidoscope {
namespace plugin {
// Plugin that converts `ctrl`+`j` to `ctrl`+`left arrow` and `ctrl`+`l` to
// `ctrl`+`right arrow`.
class CtrlJLArrows : public Plugin {
public:
EventHandlerResult onKeyEvent(KeyEvent &event) {
// We only care about events where `j` or `l` toggles on, so return `OK`
// immediately in all other cases.
if (!keyToggledOn(event.state) ||
(event.key != Key_J && event.key != Key_L))
return EventHandlerResult::OK;
// Search `live_keys` for an active `ctrl` key.
bool ctrl_active = false;
for (Key key : live_keys.all()) {
if (key == Key_LeftControl || key == Key_RightControl) {
ctrl_active = true;
break;
}
}
// If we found an active `ctrl` key, replace the `j` or `l` with an arrow.
if (ctrl_active) {
if (event.key == Key_J) {
event.key = Key_LeftArrow;
} else {
event.key = Key_RightArrow;
}
}
return EventHandlerResult::OK;
}
};
} // namespace plugin
} // namespace kaleidoscoope
kaleidoscope::plugin::CtrlJLArrows CtrlJLArrows;
KALEIDOSCOPE_INIT_PLUGINS(CtrlJLArrows);
You would also include any other plugins that you’re using in the call to KALEIDOSCOPE_INIT_PLUGINS(), with CtrlJLArrows somewhere near the bottom of the list.