onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.36k stars 301 forks source link

Rebind regular hjkl motions for moving around globally in Oni's UI #2742

Open lobre opened 5 years ago

lobre commented 5 years ago

Oni Version: 0.3.9 Neovim Version (Linux only): v0.4.0-dev Operating System: Ubuntu 18.04

Issue: As a bepo user, I have the normal hjkl remapped in my neovim configuration with ctsr. This implies everything related to motion from cursor moves to window moves. With Oni, I struggle to adapt the settings for keeping a smooth experience as a non regular keyboard layout user. No problems to far with the editor thanks to the "oni.loadInitVim": true.

But for moving around Oni windows, I can't find a way to remap everything.

I currently have

    // Move about splits easier.
    oni.input.bind("<a-c>", () =>
        oni.editors.activeEditor.neovim.command(`call OniNextWindow('h')<CR>`)
    )
    oni.input.bind("<a-t>", () =>
        oni.editors.activeEditor.neovim.command(`call OniNextWindow('j')<CR>`)
    )
    oni.input.bind("<a-s>", () =>
        oni.editors.activeEditor.neovim.command(`call OniNextWindow('k')<CR>`)
    )
    oni.input.bind("<a-r>", () =>
       oni.editors.activeEditor.neovim.command(`call OniNextWindow('l')<CR>`)
    )

This help a bit to move from the editor to the explorer and then to the sidebar but I can't move from the explorer down to the achievements and to the search with "t". I still need to use "j". And secondly, I cannot figure out how to remap keys in the explorer. I would like to use "ts" instead of "jk" for moving the cursor up and down.

I started reading the code and the API but did not find a simple way of doing that.

Maybe I am missing something?

Expected behavior: Being able to move globally within the Oni UI with other keybindings that hjkl.

Actual behavior: I currently have to mix between my custom bindings and default bindings.

Steps to reproduce: Just use the above keybindings. And here is a part of my configuration.

"oni.useDefaultConfig": true,
"oni.loadInitVim": true,

Thanks a lot, the project is otherwise amazing and I would love using it on a daily basis if I manage to make it home!

oni-bot[bot] commented 5 years ago

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.