In Vim, if you do not have an escape key, you may use Ctrl+C to get out of insert mode. This is particularly useful in Termux for many Android keyboards which do not have an escape key.
Ctrl-[ works in every terminal
You can already do something like:
map global insert <c-a> <esc>
...in your kakrc and then <c-a> will leave insert mode. Unfortunately it seems that <c-c> itself doesn't work, despite code to implement it, and I'm not sure why.
@MasterOfTheTiger In [Termux], I like to type ‘__jj__’ to leave insert mode.
# Type <character><character> to leave insert mode.
# ['jj', 'kk']
hook global InsertChar '[jk]' %{ try %{
execute-keys -draft "hH<a-k>%val(hook_param)%val(hook_param)<ret>d"
execute-keys <esc>
}}
In Kakoune, <c-c> is used to send SIGINT to the process group (similar to what it does by default in a shell). This is necessary so that we can kill some eventual subprocess we could be waiting on. In order to achieve that, <c-c> is treated specially, very early in input processing, as most other input is delayed until we get control back.
There is some code remaining that pretends to handle <c-c> as <esc>, but no <c-c> key stroke would ever get there, so it is not really useful. This should probably be cleaned up.
That means <c-c> is not available for mapping, and would not be a good candidate altenative for <esc>.
Other keys are easily mappable to <esc>, and I do not think we need to bless any choice with a default additional mapping.
Most helpful comment
In Kakoune,
<c-c>is used to send SIGINT to the process group (similar to what it does by default in a shell). This is necessary so that we can kill some eventual subprocess we could be waiting on. In order to achieve that,<c-c>is treated specially, very early in input processing, as most other input is delayed until we get control back.There is some code remaining that pretends to handle
<c-c>as<esc>, but no<c-c>key stroke would ever get there, so it is not really useful. This should probably be cleaned up.That means
<c-c>is not available for mapping, and would not be a good candidate altenative for<esc>.Other keys are easily mappable to
<esc>, and I do not think we need to bless any choice with a default additional mapping.