Kungsgeten / ryo-modal

Roll your own modal mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

auto switch ryo-mode from normal mode

driftcrow opened this issue · comments

ryo-mode designed so clever, some tricks like :exit :then is very useful. but these features only works in ryo-mode. can ryo add a mechanism for auto switch from normal mode to roy-mode and support same features for normal binding,pseudo code like:

    (roy-keys
       ( "C-f"   scroll-up  :roy t)   ;; bind for normal mode then auto enter roy mode
       ("C-c p"  :keymap projectile-command-map :roy t) 
      )

   (roy-mode-keys
      ("C-f" scroll-up :exit t)
      ("f"  scroll-up))

practice maybe difficult, just an idea for switch seamless.

Hi! Sorry for taking so long before answering. I've added a function named ryo-modal-command-then-ryo which first runs a command, and then goes into ryo-modal-mode. So you could do (ryo-modal-command-then-ryo "C-f" #'scroll-up). It doesn't support keywords at the moment, but you can specify the keymap it should apply to. I haven't tried it with prefix commands.