vimium-c
vimium-c copied to clipboard
How to map jj/jk as escape key when in insert mode?
I tried multiple formats none of them worked.
mapKey
No you can't. Vimium C's InsertMode can only exit on a single key.
If you mean a plain insert mode auto entered when an input box is focused, then mapKey <any_key> <esc>
will make Vimium C exit insert mode on the key.
If you mean the command named enterInsertMode
, then it support a parameter of key
to exit on a "neither-letter-nor-number" key, like <c-a>
or <f1>
:
map i enterInsertMode key="<c-i>"
If you mean a plain insert mode auto entered when an input box is focused, then
mapKey <any_key> <esc>
will make Vimium C exit insert mode on the key.
is it possible to bind several keys/combos to exit insert mode for the mapping ?
No. enterInsertMode
's key
can only be one (composed) key. But there're some other commands to simulate it.
- the below code means
c
and a followingd
will make Vimium C exit from disabled mode
map i openUrl url="vimium://status/disable/^%20c"
mapKey c <v-c>
mapKey <c:i> <v-c> # work around an issue in v1.99.3 that `mapKey c <v-c>` doesn't work in insert mode
map <v-c>d openUrl url="vimium://status/reset"
- you may replace
d
with other sequences of keys. -
<v-c>
is just a inner name and can be renamed into anything looking like<v-***>
-
c
is only an example, and it will prevent you from typingc
characters in an input box; so a better "first key" can be a composed key (like<a-a>
) or F1-F12 .
If you want to trigger key sequences in a "plain" insert mode (not from enterInsertMode
, but entered when an input box is focused), then this is just enough:
mapKey <c:i> <v-c>
map <v-c>d dispatchEvent esc