oni icon indicating copy to clipboard operation
oni copied to clipboard

Remap j h k l r etc.

Open hadronized opened this issue 8 years ago • 5 comments

Hey,

I’d like to remap the default keys, but I cannot do it with the Oni.input.bind or Oni.input.unbind functions… Any idea?

hadronized avatar Apr 19 '18 10:04 hadronized

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot avatar Apr 19 '18 10:04 oni-bot

@phaazon I think the best to do such fundamental change would be init.vim.

badosu avatar Apr 19 '18 10:04 badosu

Yeah, it works if I use the init.vim, but I wondered if I could go “all oni way”.

hadronized avatar Apr 19 '18 11:04 hadronized

Ah I hope we can get to this point soon! But yes, unfortunately at the moment Oni.input.bind is limited - you could do something like:

    const { editors } = oni
    const isNormalMode = () => editors.activeEditor.mode === "normal"
    oni.input.bind("j", () => editors.activeEditor.neovim.input("k"), isNormalMode, /* dont override for insert/command mode */)

But it's a little clunky and it still wouldn't handle some scenarios correctly (like quickopen / menu open) - so I'd recommend going with what @badosu suggested and using the init.vim for now, as that's the best bet.

I hope that we can improve our input model such that you could fully configure it this way in the future, though.

bryphe avatar Apr 20 '18 02:04 bryphe

Ok, that’s all good to me; thanks!

hadronized avatar Apr 20 '18 12:04 hadronized