This might be quite challenging, but I would like to achieve the following behavior. Imagine that I have two mappings that overlap:
- dcb := delete comment block := delete comment block (all adjacent comment lines)
- dcl := delete comment line := delete comment line
if I type in normal mode 'dc' and the timeout expires, I would like to provide help showing the different options. I have all the mappings documented so it would be easy to write a program that filters out what the verb is and what the text object is, but as I'm not very experienced with vimscript the challenging part for me is:
- Triggering the function when timeoutlen expires
- Retrieving the input command:
- If I could get that the user input was 'dc' then I easy parse my documentation and provide the information.
Less challenging (still challenging for me but definitely possible as this is very common in many plugins:
- Presenting the different options to the user and letting them choose
- Executing the final command
Any ideas or guidance on how to achieve this would be very much appreciated.