如何查看vim中特定键的映射?

Sag*_*ain 1 mapping vim

我想知道<leader>a在我的 vim 中映射了什么。有没有命令可以知道这一点?

Lie*_*ers 5

使用:map <leader>a来获得具有特定前缀的所有映射的列表。

:h :map

        List all key mappings for the modes where the map
        command applies.  Note that ":map" and ":map!" are
        used most often, because they include the other modes.
Run Code Online (Sandbox Code Playgroud)

  • 不要因为 get `:verbose` 会告诉你上次定义映射的位置。例如`:verbose map &lt;leader&gt;a`。参见`:h :map-verbose`。您还可以提供一种模式来缩小结果范围。例如,对于普通模式,请执行`:verbose nmap &lt;leader&gt;a`。如需更多帮助,请参阅`:h map-listing`。 (4认同)