In short, I'd like to have an auto-updating menu that shows the
keyboard shortcuts for my custom-commands.  The menu should display the
command, and the keyboard shortcuts.  Even if I change the keyboard
shortcut for a command, the next time I start Vim, the menus would
change to reflect
the new keyboard shortcut.

Any ideas?

Here's a more detailed explanation:
Suppose I have a custom menu that has all my cool Vim
shortcuts & commands.

The menu looks like this:

MyMenu
FooCommand     \c
BarCommand      \a

Then, I update the key mapping for "FooCommand" to \z
I'm too lazy to update my custom menu, so I would like
Vim to auto-update my menu the next time Vim starts, so
it would display the new \z key mapping for FooCommand

FooCommand     \z
BarCommand      \a

To do this, I need to find a way to get a list of key mappings for certain
commands, so I could say something like:

exe "menu FooCommand<Tab>" . getMappingFor("FooCommand") . " :FooCommand<CR>"

I've searched the help, vim.org, and the mailing list, and haven't found a
function or script that does the above.

I've found:

hasmapto()
mapcheck()
maparg()

And none of these functions return the actual key mapping for some command.

I guess I could write a function that would parse the output of the
:map command.
Before writing such a function, I wanted to check the mailing list.

Thanks in advance,


--Nate

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to