Adding a clue vs mapping to ’<Nop>’ #1964
-
Contributing guidelines
Module(s)mini.clue QuestionSuppose I’ve added Up until now, I've been adding that menu by adding a As far as I can tell, I can get the same effect by mapping Either way, when I type Is that correct? Is there some additional benefit to adding a clue vs mapping the keys to |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The main goal of 'mini.clue' is to show all available sequences of keys that actually do something, usually via available mappings. To be more useful for nested mappings, after only small common part is typed 'mini.clue' also shows something to indicate that there are more keys under particular keys. For example, if there are There doesn't have to be anything extra done for it to be shown, especially no need to create a Does this make sense? |
Beta Was this translation helpful? Give feedback.
-
It makes sense. And it shows that I omitted an important part of my question: I know that the clue adds a description to the mapping group. I'm wondering whether there are any important differences between using a clue to add the description and using a As far as I can tell, once I’ve set up clues = {
{ mode = 'n', keys = '<Leader>f', desc = '+find' },
} I can get the same effect by creating a mapping to name the group. That is, mapping from vim.keymap.set('n', '<Leader>f', '<Nop>', { desc = '+find' } ) Adding the group descriptions via mappings has a nice benefit that I can name the groups in the same place where I define all of the mappings that have actions. Like this: vim.keymap.set('n', '<Leader>f', '<Nop>', { desc = '+find' } )
vim.keymap.set('n', '<Leader>ff', '<Cmd>Pick files<CR>', { desc = 'find files' } ) If I use a clue to add the description, I define the mappings in one place, and the clues in another (the mini.clue config). I can use either a clue or a What I don’t know: Are there important differences between the two mechanisms? |
Beta Was this translation helpful? Give feedback.
The main goal of 'mini.clue' is to show all available sequences of keys that actually do something, usually via available mappings.
To be more useful for nested mappings, after only small common part is typed 'mini.clue' also shows something to indicate that there are more keys under particular keys. For example, if there are
<Leader>ff
and<Leader>fh
mappings, after pressing<Leader>
there should be an entry for keyf
indicating that those two mappings are available. Those entries are generally refered to as "group next key".There doesn't have to be anything extra done for it to be shown, especially no need to create a
<Nop>
mapping. But if you want to adjust the description of this gro…