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

Support langmap function the way vim does, or fix current map (bindings) commands #899

Open
pupto-bismol opened this issue Apr 21, 2023 · 1 comment

Comments

@pupto-bismol
Copy link

I've had to remap my vim config to be able to use a different keyboard layout (colemak) with it, but the way vifm handles remapping is not the same.

  1. It doesn't handle langmap - this would be the easiest for the user, and really really helpful - in fact this would work even better than in vim, because in vim langmap causes conflicts while trying to set macros. Since vifm has no macros, it would be pretty flawless imo.
  2. If I just noremap each key individually, it doesn't respect my mappings for operator motions like vim does. For example, in vim (or neovim) I can put noremap e j in my config file, and if i do y2e it will yank 2 lines downwards. In vifm, this is not the case. I need to rebind ye explicitly AND when I do, it doesn't support numbered movements. For example at this point typing ye will still yank the current line and the line below it, but typing y5e will do nothing and not perform the expected action.

For someone who uses an alternate layout every day, this is fairly annoying, and would be even worse for people who use a different language keyboard every day and need to map even more characters than I do. It would also be useful to have something like vim's omap which could explicitly map keys in operator mode, that could work with commands like y or d plus a movement.

@xaizek
Copy link
Member

xaizek commented Apr 22, 2023

Since vifm has no macros,

At the moment. I think there are scenarious where they could be useful. Another issue is that sometimes escape sequences can be mapped directly and 'langmap' will break that, but maybe not many people need both things at the same time.

For someone who uses an alternate layout every day, this is fairly annoying

Sound like 'langmap' will enable you to use two different layouts at the same time. I thought using one should be better.

and would be even worse for people who use a different language keyboard every day and need to map even more characters than I do.

Another language is needed only in command-line mode. I think I tried using normal mode with a non-Latin layout using 'langmap' in Vim and dropped it because there were some issues.

It would also be useful to have something like vim's omap which could explicitly map keys in operator mode, that could work with commands like y or d plus a movement.

It can be done in Lua. :omap command probably wouldn't be useful for anything but renaming keys.


:noremap might not be affecting operators because there is no :ounmap. I don't really remember this though, so maybe I just didn't notice that it affects operators in Vim. This needs to be implemented at the same time. However, I agree that 'langmap' is a cleaner way of addressing this.

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

No branches or pull requests

2 participants