Fóruns: ヘルプ (Thread #46282)

bindkey: How to map Alt key (2022-07-28 02:25 by maxgyver83 #90679)

Hello everybody,

I could manage to map `vi-edit-and-accept` to Ctrl-v in emacs mode:

bindkey --emacs '\^V' vi-edit-and-accept

But actually I would like to bind it to Alt-v. How can I achieve this? I have tried so far:

bindkey --emacs '\^[V' vi-edit-and-accept
bindkey --emacs '^[V' vi-edit-and-accept
bindkey --emacs '^[v' vi-edit-and-accept
bindkey --emacs '\^\[V' vi-edit-and-accept

Best regards,
Max

Responder a #90679×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: bindkey: How to map Alt key (2022-07-28 02:50 by maxgyver83 #90681)

> But actually I would like to bind it to Alt-v. How can I achieve this? I have tried so far:
>
> bindkey --emacs '\^[V' vi-edit-and-accept
> bindkey --emacs '^[V' vi-edit-and-accept
> bindkey --emacs '^[v' vi-edit-and-accept
> bindkey --emacs '\^\[V' vi-edit-and-accept

Sorry for bothering you. After thinking again, I found it:

bindkey --emacs '\^[v' vi-edit-and-accept

I think the rule of thumb is: Use backslash plus what you get when you type Ctrl-v and then the key combo you want to use.

(It seems to be the same in bash: For key combos with Ctrl you use capital letters, for key combos with Alt you use minor letters.)
Responder a #90679

Responder a #90681×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login