On 2022-04-21, Ernie Rael wrote:
> On 4/21/22 1:24 PM, Bram Moolenaar wrote:

> >I suppose that if you want to know "what was that mapping I put in for
> >that command" and don't even know where you defined it, it can be hard
> >to find.
> There can be default mappings as well. Does anyone set up multiple
> mappings to same command?

I depends what you mean by a "command".  I have different LHSs that
map to a call to the same function, but with different arguments.

I also have a couple of different mappings in my vimrc to the
identical RHSs because I couldn't decide which key sequence I was
going to like better.

I imagine there are cases, too, where a user creates their own
mapping to plugin command that they like better than the plugin's
default mapping to that command.

> >You can use :filter:
> >     :filter NextCommand map
> >
> >But you have to redirect the output and process it, which can be tricky
> >for special keys.

FWIW, you don't have to redirect the output if you use execute(),
e.g.,

    :let x = execute("filter NextCommand map")

And, you can use :verbose to find where a mapping was defined, e.g.,

    :let x = execute("verbose filter NextCommand map")

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220421220933.GA3071%40phoenix.

Raspunde prin e-mail lui