Neovim remapping issue.
Greetings,
Oni Version: 0.3.6 Neovim Version (Linux only): Operating System: All supported platforms.
Issue: I'm a Bepo keymap user, so in my Neovim configuration, I remapped hjkl to its bepo keymap version ctsr . tsr are working just fine. However, I have an issue with c. It moves on the left as expected but it also comes with a 'delay'. When I push c to move to the left, the cursor moves to the left 1s after. I'm suspecting there is already a keymap set by Oni but I was unable to disable it. I used oni.input.unbindAll() but it didn't change anything.
Expected behavior: No having a delay when I hit a remapped a key.
Actual behavior: Have a 1s delay when I hit c to move to the left.
Steps to reproduce: In your Neovim configuration file, add the following:
noremap c h
noremap t j
noremap s k
noremap r l
Open a buffer and hit c to move to the left to experience the 1s delay before the cursor move to the right direction.
Thanks for your time.
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.
Have you tried this in a normal neovim instance? I expect its more to do with the plugins/neovim side rather than Oni, but someone who knows the nvim input side may want to jump in.
From my understanding, this is due to there being lots of other actions on c so it waits to know what you mean. Pressing c could be move left, or it could be part of ciw or cw etcetcetc. To get around that, there is a default timeout len nvim/vim waits before assuming you mean just c. You can test that by setting a smaller timeout len with set timeoutlen XXX.
I'm not sure what the best practise is here for this sort of thing. Setting a low timeoutlen would be a hassle and cause you more issues for typing sequences of letters, so maybe the thing to do is make sure you've also rebound every other action that conflicts? I can see a few BEPO plugins for that, but obviously can't say anything about their quality.
Thanks for taking the time to respond.
I'm using neovim in the terminal for almost two years now, and I can assure you I don't have that behaviour (I spend all my day and night on neovim). I also tried on different GUI-based neovim applications and didn't experience that behaviour either.
Is it possible that one of my plugins can affect Oni internals? You seem to imply it's impossible. Is there something I can do that would showcase that behaviour on a log or something similar?
Thanks for your help.
Its possible that the Oni default config comes with a plugin that is causing this issue, so its added something that you don't use, and is causing the conflict I mentioned.
Ie, we bundle vim-surround and some others that I know add c bindings.
Have you disabled the Oni default config with "oni.useDefaultConfig": false, in your config file (that goes in the export const configuration = { bit)? May also be worth doing :map c, to see if there is any other bindings that Oni has added that I'm forgetting about.
If it is the default config, I'd leave it disable since you sound like you have your own init.vim and it can cause some conflicts. It can be found over at the bottom of https://github.com/onivim/oni/wiki/How-To:-Minimal-Oni-Configuration, in case you want to check it over/integrate it.
If its not....then we can look at debugging it a bit more, but if you've got oni.input.unbindAll() then it shouldn't be being picked up by Oni, and instead its Neovim that is doing the processing. (unbinding in Oni just tells Oni to ignore the bind and let nvim deal with it).
Thanks @CrossR!
I add "oni.useDefaultConfig": false and everything worked properly. Thank you again.