Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom keymapping for cursor hjkl keys #69

Open
jernejFilipcic opened this issue Dec 9, 2020 · 4 comments
Open

custom keymapping for cursor hjkl keys #69

jernejFilipcic opened this issue Dec 9, 2020 · 4 comments

Comments

@jernejFilipcic
Copy link

Would it be possible to make it customizable? Some of us use jkl; or (in my case, on a foreign keyboarfd) jklč for cursors, in order to let the index finger stay on j, where it belongs.

@dbalatero
Copy link
Owner

Can you sketch out the API you'd like to see for customizing?

@jernejFilipcic
Copy link
Author

jernejFilipcic commented Dec 9, 2020 via email

@dbalatero
Copy link
Owner

Some blockers/things to think about before we could really get started:

  • Currently I use an hs.hotkey.modal to handle key presses, which has hardcoded key bindings. We'd need something else instead that can dynamic shift around the key bindings.
  • I'm not that excited to get in the business of parsing vimrc files directly
  • Neovim has Lua native config now, with APIs like vim.api.nvim_set_keymap() (example). Is it worth drawing any inspiration from it?
  • The native remap API kind of sucks - instead of noremap l k I wish it was something more sane and readable like noremap l motion-up. I understand the desires to stay closer to Vim syntax and more native, but 30 years later is this truly the best way to express key maps?
  • I have no idea what all these remap commands do and I feel like I should understand it better before just diving in and adding my own key binding system. What possible footguns might I encounter? What is nnoremap vs noremap? I seem to recall recursion being a thing with the key bindings as well. Very confusing.
# what are all these??
:no[remap]  {lhs} {rhs}		|mapmode-nvo|	*:no*  *:noremap* *:nor*
:nn[oremap] {lhs} {rhs}		|mapmode-n|	*:nn*  *:nnoremap*
:vn[oremap] {lhs} {rhs}		|mapmode-v|	*:vn*  *:vnoremap*
:xn[oremap] {lhs} {rhs}		|mapmode-x|	*:xn*  *:xnoremap*
:snor[emap] {lhs} {rhs}		|mapmode-s|	*:snor* *:snore* *:snoremap*
:ono[remap] {lhs} {rhs}		|mapmode-o|	*:ono* *:onoremap*
:no[remap]! {lhs} {rhs}		|mapmode-ic|	*:no!* *:noremap!*
:ino[remap] {lhs} {rhs}		|mapmode-i|	*:ino* *:inor* *:inoremap*
:ln[oremap] {lhs} {rhs}		|mapmode-l|	*:ln*  *:lnoremap*
:cno[remap] {lhs} {rhs}		|mapmode-c|	*:cno* *:cnor* *:cnoremap*
:tno[remap] {lhs} {rhs}		|mapmode-t|	*:tno* *:tnoremap*

This feels like a large amount of work to me, so it would be nice to have someone help do the initial thinking on all this.

@jernejFilipcic
Copy link
Author

jernejFilipcic commented Dec 9, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants