kana / vim-arpeggio

Vim plugin: Mappings for simultaneously pressed keys
http://www.vim.org/scripts/script.php?script_id=2425
271 stars 18 forks source link

Feature: <sequence> option #28

Open BertrandSim opened 4 years ago

BertrandSim commented 4 years ago

Hi Kana, I am wondering if it would be possible to map only an Arpeggio sequence, and not a chord. That is, the map happens only if keys are hit in a specified order, in quick succession.

For example, in insert mode, if I hit 'dm', a mapping occurs, but if I hit 'md', no mapping occurs. ie.

  :Arpeggioinoremap <seq> dm \[ \]<Left><Left>
  " dm  ->  \[ ... \]
  " md  ->  md

I browsed through your code, and I think it can be achieved by bypassing the generation of permutations (see s:permutations in s:do_map)

However, I'm not sure if using <seq> would be the best way to do this, as it may be confused with the other options such as <buffer>, etc..

What are your thoughts on these?