Home  >  Q&A  >  body text

nvim - How to customize vim mode and key-map in this mode?

the problem we are facing:

When using the gitgutter plug-in, you can jump between multiple modifications through the following commands

- GitGutterNextHunk
- GitGutterPrevHunk
- GitGutterPreviewHunk

If you make a mapping for each command <leader>j/k/p or \j/k/p..., there are other plug-ins for these mappings I need to use it, but the shortcut keys are not enough.
But if \gj, \gk, \gp are too slow to operate.

INSPIRED

i3wm can customize mode and key mapping under mode.


Can the effect like the title be achieved using vim? Can you give me some ideas for implementation?

仅有的幸福仅有的幸福2712 days ago659

reply all(1)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-16 16:37:44

    For this rarely used plug-in function, I find it redundant to create a shortcut key. You'd better want a custom mode

    I tried i3wm once, but I’m not familiar with it. I think the so-called modes of the window manager can be switched between each other

    But Vim’s mode has a central point: Normal

    According to your idea, switch to custom mode, jump to where you want to go, then Esc to switch back to Normal mode, and then enter Insert mode. Are you tired?

    Besides, have you read the instructions for the GitGutter plug-in?

    Hunks

    You can jump between hunks:

    • jump to next hunk (change): ]c

    • jump to previous hunk (change): [c.

    https://github.com/airblade/v...

    reply
    0
  • Cancelreply