google / google/vim-maktaba

Resolve plugin[mappings] prefix value at initialization time

Open
#168 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Vim Script
Stars
588
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Plugins that provide default mappings generally configure a default mapping prefix like `=` and then take a boolean value for `plugin[mappings]` as a shortcut for that prefix. For instance

``` vim
Glaive codefmt plugin[mappings]
```

is a shortcut for

``` vim
Glaive codefmt plugin[mappings]='='
```

But in the first shortcut form the default prefix isn't introspectable (`:Glaive codefmt` shows a value of `{'mappings': 1}` instead of `{'mappings': '='}`). We should add a hook to resolve it immediately so it's introspectable.

Related: When overriding the `plugin[mappings]` value, we could immediately create new mappings at that prefix, and possibly clean up any old ones we can detect as automatically created by the plugin at the old prefix.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.