Get the output of `:map` into a buffer

2020-06-19 10:16发布

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.

标签: vim
1条回答
老娘就宠你
2楼-- · 2020-06-19 10:36

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

:redir @" | silent map | redir END | new | put!
查看更多
登录 后发表回答