godbout / kindaVim.docs

Ultimate Vim Mode for macOS
https://kindavim.app
614 stars 4 forks source link

Feature request: please provide multiple ways to enter normal mode #208

Open lubiksss opened 8 months ago

lubiksss commented 8 months ago

hi i'm kindavim user, and i really thanks to your kindavim

i have a request i want to enter normal mode using multiple ways especially i'm korean i want to enter normal mode with

  1. press jk sequence
  2. press ㅓㅏ sequence

i mean not only korean character sequence, i just want i have multiple sequence way to enter normal mode thanks to your kindavim, have a nice day

godbout commented 8 months ago

it's kinda of tricky because kV does provide multiple ways to enter Normal Mode: escape, a hotkey, or a sequence. i feel if one wants more sequences or hotkeys, then one should use tools that are done for that, like Karabiner-Elements or Hammerspoon.

i'll provide some examples of Hammerspoon later where you can just start kV with different sequences.

godbout commented 8 months ago

but for the time being i would highly recommend you to check out those two tools cited above:

KE should be preferred tho as it's a low level keyboard driver, so it's gonna be instant.

godbout commented 8 months ago

e.g.: https://karabiner-elements.pqrs.org/docs/json/typical-complex-modifications-examples/#change-right_shift-x2-to-mission_control

you could use this example to map any two-keys sequence to calling the hotkey for kV hehe

godbout commented 8 months ago

so for example, after a quick investigation:

{:main [

        {
                :des   "press j and l simultaneously to control command spacebar"
                :rules [[[:j :l] :!CTspacebar]]
        },
        {
                :des   "press d and h simultaneously to control command spacebar"
                :rules [[[:d :h] :!CTspacebar]]
        }

]}

this as a Goku config for Karabiner makes pressing jl and also dh together being mapped to control command spacebar, which could be the hotkey to enter Normal Mode in kV.

currently the keys have to be pressed together, but there should be ways to do a sequence. i'll research more but you should too 😂️😂️😂️

lubiksss commented 8 months ago

Thank you for your very kind reply. you have already helped me a lot.

godbout commented 8 months ago

i'm reopening coz i haven't finished playing with this yet 😂️😂️😂️

godbout commented 8 months ago

almost there. jk and df both activating control command spacebar. but currently it prints ddouble j and double d. once i get this fixedd then you'll have what you needd.

{:main [

        {
                :des "jk to control command spacebar"
                :rules [
                        [:k :!CTspacebar [:j-pressed]]
                        [
                                :j :j nil
                                {
                                        :alone [:j ["j-pressed" 1]]
                                        :delayed {:invoked ["j-pressed" 0] :canceled ["j-pressed" 0]}
                                }
                        ]
                ]
        },
        {
                :des "df to control command spacebar"
                :rules [
                        [:f :!CTspacebar [:d-pressed]]
                        [
                                :d :d nil
                                {
                                        :alone [:d ["d-pressed" 1]]
                                        :delayed {:invoked ["d-pressed" 0] :canceled ["d-pressed" 0]}
                                }
                        ]
                ]
        }

]}
godbout commented 8 months ago

second j and d not printed:

{:main [

        {
                :des "jk to control command spacebar"
                :rules [
                        [:k :!CTspacebar [:j-pressed]]
                        [
                                :j nil nil
                                {
                                        :alone [:j ["j-pressed" 1]]
                                        :delayed {:invoked ["j-pressed" 0] :canceled ["j-pressed" 0]}
                                }
                        ]
                ]
        },
        {
                :des "df to control command spacebar"
                :rules [
                        [:f :!CTspacebar [:d-pressed]]
                        [
                                :d nil nil
                                {
                                        :alone [:d ["d-pressed" 1]]
                                        :delayed {:invoked ["d-pressed" 0] :canceled ["d-pressed" 0]}
                                }
                        ]
                ]
        }

]}

but maybe now you need the first to get removed also when you enter Normal Mode? 🤔️