Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the output of `:map` into a buffer

Tags:

vim

I'd like to get the output of an argumentless :map call so that I can use vim's search functionality to look for mappings.

I found about :redir, which redirects the output of ex commands into a variable, register, or file, but it doesn't seem to work for map, which must be outputting the mappings in some different way from what, for example :echo 'hello world' does.

like image 471
PSkocik Avatar asked Jan 31 '15 12:01

PSkocik


1 Answers

You can use :redir for that. Here's a oneliner that uses the default register:

:redir @" | silent map | redir END | new | put!
like image 173
Ingo Karkat Avatar answered Nov 15 '22 08:11

Ingo Karkat