i played again with vi-like input mode (i.e. control mode vs. edit mode), the motivation is to reduce the need to use modifier keys like shift/ctrl/alt which i find myself stretch my fingers in order to press those, too many times.
i have encountered few obstacles:
- when switching to control mode, keystrokes need to not alter the edited text. i have workaround lack of support in such feature by using showInputPanel to open an input panel, so all keystrokes are sent to it rather than the edited text.
- i found that i need a callback from sublime each time a keybind is triggered
- to be able to exit the control mode before the keybinded-action takes place (else, the user is still with my special keybinding, which is not good).
- to be able to exit or clear the control mode after the keybinded-action already finished.
- to be able to print the key stokes of the user, including the actual keys used to trigger the action
not related to this special mode, i have thought of the following:
- it could also be nice if sublime could export the keybindings it knows, so i can get this list with a function.
- it would be nice if sublime would show key strokes sequence which match a keybinding, as i type them, for example on the status bar. so if i bind x,1,2 i will see as i press:
x -see-on-status-bar-> x
x1 -see-on-status-bar-> x,1
x12 x -see-on-status-bar-> x,1,2 and trigger keybinded action
or
x -see-on-status-bar-> x
xy -see-on-status-bar-> <nothing to show>
i guess i can implement this feature if the above API (2) was exposed.
anyway, there is a real issue here, when i bind sequences that overlap shorter sequences, the shorter become unpractical to use. need to think ho to solve this, the VIM way is some kind of timer (which has its drawbacks - lag on response for the shorter keybindings), but maybe there are better ways.