Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

[Feature]: per-mode implementations for commands #215

@mrjones2014

Description

@mrjones2014

Similar Issues

  • Before filing, I have searched for similar issues.

Description

I have a command defined like this in my config:

{
  ':Comment',
  function()
    local keys = 'gcc'
    if require('legendary.toolbox').is_visual_mode() then
      keys = 'gc'
    end

    vim.api.nvim_feedkeys(keys, 't', true)
  end,
  description = 'Toggle comment',
}

What I'd like to be able to do is a similar syntax to keymaps:

{
  ':Comment',
  {
    n = 'gc',
    v = 'gcc',
  },
  description = 'Toggle comment',
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions