How to search in the Vim mapping listing?

前端 未结 3 1111
失恋的感觉
失恋的感觉 2021-02-07 12:22

Using :map provides a list of all mappings in Vim. But, I am unable to search through the list. I am surprised to see it being opened in a different type of window

3条回答
  •  一整个雨季
    2021-02-07 13:02

    Vim uses its internal pager to display the output of :map, which has pretty limited functionalities (see :h pager for more info).

    If you want to access the output of :map in a normal vim buffer, you could use :redir :

    :redir @a>    " redirect output to register a
    :map
    :redir END
    :put a        " paste the output of :map in the current buffer
    

    Note that you can redirect to a file, to a variable, etc... See :h redir for more details.

提交回复
热议问题