I'm using kitty to run terminal nvim on macOS. I want to use D- (command-key) mappings inside nvim. Because terminals, for reasons I don't understand, don't simply pass command-key chords through to the underlying nvim, this requires a workaround. This is what I currently use in kitty.conf:
map cmd+left send_text all :call feedkeys("\<D-LEFT>")\r
map cmd+right send_text all :call feedkeys("\<D-RIGHT>")\r
map cmd+up send_text all :call feedkeys("\<D-UP>")\r
map cmd+down send_text all :call feedkeys("\<D-DOWN>")\r
...
This works in normal mode, but not in insert mode due to the colon. Nvim provides the <Cmd>
pseudokey (:help <Cmd>
) to replace the :
for writing mode-agnostic command mappings within Vim. But kitty doesn't know anything about <Cmd>
. However, if <Cmd>
is just a stand-in for some bytes, I could just specify these bytes directly in kitty.conf
.
How can I get the bytes represented by <Cmd>
? Or is there another solution?
:echo "\<Cmd>"
echo "\<Cmd>"
and it gives me<80><fd>h
. I thought<80>
and<fd>
were hex representations (which is what I need), but then I triedlet @+ = "\<Cmd>"
, pasted the results into a buffer, and didga
for each character that showed up. The hex was completely different-- there were three characters with 0xc4, 0x02dd, and 0x68. Do you know why these are different and what I should use as the hex rep from kitty?:let a="\<Cmd>"|put =a
and doga
on each resulting char, I receive exactly0x80 0xfd 0x67