I use custom Colemak-based keyboard layout with a lot of national symbols added in (like ą, č, ę, š, ų, ū etc.).
In vi normal mode, it's natural to use keys k n e i or n e i o for cursor movements, so I usually remap a lot of keys in vim. And then it makes sense to use all the national symbols in normal mode for various actions as you do not use them to type any text there anyway. Therefore, I usually remap o and O (insert-line-below & insert-line-above) in vim to š and Š on my keyboard.
I tried to remap these keys in lem, and Š (capital) works perfectly well:
(define-key lem-vi-mode:*command-keymap* "Š" 'lem-vi-mode/commands:vi-open-adove) ; typo in command name
But remaping to š (lowercase) with this:
(define-key lem-vi-mode:*command-keymap* "š" 'lem-vi-mode/commands:vi-open-below) ; š is read as Shit-Tab
gives an error Key not found: Shift Tab
This is because the definition of Shift Tab in src/key.lisp shadows the š character (U+0161) (decimal 353):
(setf (key-to-character (make-key :shift t :sym "Tab")) (code-char 353))
It works OK with some symbols (e.g. ų):
(define-key lem-vi-mode:*command-keymap* "ų" 'lem-vi-mode/commands:vi-open-below)
But similar error happens with others (e.g. č):
(define-key lem-vi-mode:*command-keymap* "č" 'lem-vi-mode/commands:vi-open-below)
Error: Key not found: F5
I think the Shift state and other states should be tracked differently in lem code to avoid these problems.
I use custom Colemak-based keyboard layout with a lot of national symbols added in (like ą, č, ę, š, ų, ū etc.).
In vi normal mode, it's natural to use keys
k n e iorn e i ofor cursor movements, so I usually remap a lot of keys in vim. And then it makes sense to use all the national symbols in normal mode for various actions as you do not use them to type any text there anyway. Therefore, I usually remapoandO(insert-line-below & insert-line-above) in vim tošandŠon my keyboard.I tried to remap these keys in lem, and
Š(capital) works perfectly well:(define-key lem-vi-mode:*command-keymap* "Š" 'lem-vi-mode/commands:vi-open-adove) ; typo in command nameBut remaping to š (lowercase) with this:
(define-key lem-vi-mode:*command-keymap* "š" 'lem-vi-mode/commands:vi-open-below) ; š is read as Shit-Tabgives an error
Key not found: Shift TabThis is because the definition of Shift Tab in src/key.lisp shadows the
šcharacter (U+0161) (decimal 353):(setf (key-to-character (make-key :shift t :sym "Tab")) (code-char 353))It works OK with some symbols (e.g.
ų):(define-key lem-vi-mode:*command-keymap* "ų" 'lem-vi-mode/commands:vi-open-below)But similar error happens with others (e.g.
č):(define-key lem-vi-mode:*command-keymap* "č" 'lem-vi-mode/commands:vi-open-below)Error:
Key not found: F5I think the Shift state and other states should be tracked differently in lem code to avoid these problems.