To take a look at the mappings in my current session I fired:


to list all current mappings.

The output opens in some sort of read only awkward window. It's only possible to scroll. It's not even searchable.

  • Is it possible to get the output of :map and redirect it to a normal buffer? How?
  • What is this kind of window/buffer? (I'm curious about it)

That "window" is a simplistic built-in pager similar in spirit to more or less.

See :help pager.

Here is how you get the output of a command in a more usable form:

First, redirect the output of :map to an arbitrary register:

:redir @a<CR>
:redir END

Then, put that register into a new buffer in a new window:


See :help :redir.

| improve this answer | |

The simply approach

:redir @" | silent map | redir END | new | put!
| improve this answer | |
  • Welcome to this site! Your answer has been flagged has "low quality" because of its length. To make it more useful to future readers how could explain how it differs from the accepted answer, how the | characters works, why you choose the unamed register, etc... Adding some explanations with you code is always a good thing to help other people :) – statox Apr 7 '19 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.