Skip to content

feature: assign separate highlight to buffer-local keymaps #905

@chrisgrieser

Description

@chrisgrieser

Did you check the docs?

  • I have read all the which-key.nvim docs

Is your feature request related to a problem? Please describe.

While groups and keymaps are easily distinguishable by the icon for groups and simply having different highlight groups, buffer-local and global keymaps do get the same highlight group WhichKeyDesc, and are thus not distinguishable.

Showcase

(here, the first one is buffer local to markdown files)

Describe the solution you'd like

Assign a separate highlight group to buffer local keymaps.

(I'd even argue that distinguishing buffer-local and global keymaps is valuable enough, that they should by default have different colors, but that's probably a different question.)

Describe alternatives you've considered

The only two mechanisms for differentiating buffer-local keymaps from global ones are the sorting and require("which-key").show({ global = false }). While they technically work, they are rather inconvenient methods for checking if a mapping is buffer-local.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions