Skip to content

Better assigment of keymaps #6

@vieitesss

Description

@vieitesss

Motivation

Right now, I am hard-coding the possible modes of the keymappings

https://github.com/vieitesss/command.nvim/blob/f33b1470dafd9fe8785aea48419508bbcf522221/lua/command/ui/keymaps/prompt.lua#L15C1-L16C85

Solution

It would be better to make a function that:

  • takes the configuration of the keymaps, like n = { '<Up>', prompt_act.history_up }.
  • gets the key, that's the mode, and can be any valid character refering to a mode nixv.
  • converts this to a valid set of options to pass as a parameter to vim.keymap.set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions