Remap j h k l r etc.
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?
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.
@phaazon I think the best to do such fundamental change would be init.vim.
Yeah, it works if I use the init.vim, but I wondered if I could go “all oni way”.
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.
Ok, that’s all good to me; thanks!