【问题标题】:Vim, How to create key bindings to: shift, ctrl, alt, cmd keys?Vim,如何创建键绑定到:shift、ctrl、alt、cmd 键?
【发布时间】: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


    【解决方案1】:

    查看: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-
    

    【讨论】:

      【解决方案2】:

      在 Vim 中,运行::help key-notations

      这将为您提供映射时将使用的不同键的所有缩写(符号)的列表。

      例如,运行上述命令后,您会发现 alt 被标记为:&lt;M-...&gt;,因此对于 alt+p,您将使用:&lt;M-p&gt;

      【讨论】:

        猜你喜欢
        • 2012-08-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-06-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-06-11
        相关资源
        最近更新 更多