【发布时间】:2020-11-14 16:57:17
【问题描述】:
我想用以下键创建键绑定:shift、ctrl、alt、cmd,但不知道如何将它们插入到配置文件中:
我知道 Ctrl 表示为 C,我可以写:ctrl+p 为 <C-p>,但你会怎么写:
alt+p ?
shift+p ?
cmd+p?
【问题讨论】:
标签: vim configuration key-bindings neovim
我想用以下键创建键绑定:shift、ctrl、alt、cmd,但不知道如何将它们插入到配置文件中:
我知道 Ctrl 表示为 C,我可以写:ctrl+p 为 <C-p>,但你会怎么写:
alt+p ?
shift+p ?
cmd+p?
【问题讨论】:
标签: vim configuration key-bindings neovim
查看:h shift 的帮助文件。基本上它会导致:
<S-...> shift-key shift <S-
<C-...> control-key control ctrl <C-
<M-...> alt-key or meta-key meta alt <M-
<A-...> same as <M-...> <A-
<D-...> command-key (Macintosh only) <D-
【讨论】:
在 Vim 中,运行::help key-notations
这将为您提供映射时将使用的不同键的所有缩写(符号)的列表。
例如,运行上述命令后,您会发现 alt 被标记为:<M-...>,因此对于 alt+p,您将使用:<M-p>
【讨论】: