Skip to content

Add MapHelp command #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add MapHelp command #35

wants to merge 1 commit into from

Conversation

idbrii
Copy link
Contributor

@idbrii idbrii commented Jan 9, 2018

MapHelp makes it easier to lookup what a command does. Most of the time,
it returns whatever you've mapped the input key sequence to, but if it's
built-in it shows vimdoc for the map (instead of an error like :map).

It optionally uses Verbose and seems like a relevant addition to scriptease,
so I thought I'd propose and see what you thought.

Useful whenever you know you use something a lot, but can't remember
where it comes from.

Also includes a bang variant to use :Verbose instead of verbose.

Passing no modes will search all modes unlike :map or maparg(). This is
the most useful use case. You can pass a mode to pinpoint entries in
vimdoc or for Verbose.

MapHelp makes it easier to lookup what a command does. Most of the time,
it returns whatever you've mapped the input key sequence to, but if it's
built-in it shows vimdoc for the map (instead of an error like :map).

Useful whenever you know you use something a lot, but can't remember
where it comes from.

Also includes a bang variant to use :Verbose instead of verbose.

Passing no modes will search all modes unlike :map or maparg(). This is
the most useful use case. You can pass a mode to pinpoint entries in
vimdoc or for Verbose.
@tpope
Copy link
Owner

tpope commented Jan 25, 2018

I like this idea. My first instinct is to double down on the :help aspect and invoke :help on the underlying map (presumably a <Plug> map) rather than dumping raw :verbose output.

@tpope
Copy link
Owner

tpope commented Jan 25, 2018

I should add that for my own plugins, I am terrible about documenting <Plug> maps, but this is a strong incentive to change that. In the case that no topic is found, we could include the relevant filename in an expanded error message: E159: Sorry no help for <Plug>whatever (/path/to/plugin/whatever.vim).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants