Saturday, April 14, 2012

Re: Look up key binding for command

Marcin Szamotulski schrieb am 14.04.2012 um 13:56 (+0100):

> Note vim normal commands are done internally by vim and not by
> a :map command. So for example you will not find CTRL-W_CTRL-N
> (:help CTRL-W_CTRL-N) in any map though it behaves like :new
> command.

I see.

> Usually, the help file is written in such a way that ex-command
> is written together with the corresponding normal command, like
> in: ":help :new" and ":help CTRL-W_CTRL-N".

I see.

> However, there are many maps defined by plugins and that's why
> all the :map commands are useful (knowing the key, e.g. :map
> <F10>). I wrote a plugin to search in right or left side of a
> map:
> http://www.vim.org/scripts/script.php?script_id=3767

Works fine. I can see that you're also using :redir and :map and
its brethren to get the mapping. As far as I can see, the current
release only searches the right-hand side of the mapping, though.

One observation:

if len(found_maps) > 0
echo join(found_maps, "\n")
else
echohl WarningMsg
echo "No such map"
echohl Normal
endif

Maybe "No matches found" would be a more suitable message here.

> You can also use :helpgrep command to grep in the docs (consult
> ":help :helpgrep")

Thanks. All very helpful.

Michael

--
You received this message from the "vim_use" 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

No comments: