-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added Langmap Feature #8541
Added Langmap Feature #8541
Conversation
It would be nice to also support the from:to syntax specified in
Also being able to pull the setting from Thanks for making this PR, been wanting this feature for a while! Hopefully it gets approved soon.. |
It's completely compliant with how vim parses langmap, including the "from to" syntax. I also believe it should already work with .vimrc but let me test that when I'm back home in a few days. |
Hmm, my colemak from:to langmap doesn't seem to work here, but works fine in vim: If I convert it to the other format however, it works fine: |
Will check the bug, thanks for reporting! |
I've identified and fixed the issue with parsing, but I'm yet to check if my code already works with .vimrc @ryan-mooore |
All works beautifully for me now 👍 |
Is there any hope on getting this merged? @J-Fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind adding a few test cases?
Done. One annoyance I'm not happy with yet is the need for 14eba0bd. Basically, Vim handles registers separetly from other
As is right now, there is no way to distinguish mappings like If instead something like (Side note: Why does recording a macro use |
Yeah adding
I'm not sure, only thing that really comes to mind is it may be a hacky way to ensure |
@J-Fields I changed the code accordingly. I ended up having to introduce With the current setup, all tests are passing, and the branch is up-to-date with upstream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks a lot!
What this PR does / why we need it
This pull request implements the langmap feature of Vim. It's an essential accessibility feature for people who use an alternate keyboard layout like Dvorak, Colemak, or a layout specific to a language like Greek or Russian.
It works by specifying the map under
vscode.langmap
in Code's JSON settings.Example langmap for Greek:
Example langmap for Dvorak:
You may find the exact format under
:help langmap
in Vim.Keystrokes are then remapped based on the passed langmap, unless they're to be interpreted as text. Most frequently, one would use this feature to at least remap the movement keys to be at the physical positions of the "hjkl" keys on the keyboard, whilst still being able to type with one's chosen layout.
Which issue(s) this PR fixes
Feature Request #2217
Special notes for your reviewer
I have made sure to keep the changes to working code minimal. Additionally, no remapping is called if the passed langmap is an empty string (default value). That way, no unexpected behaviour or performance penalty should be introduced, unless you actively override the default value in your settings.
Furthermore, I'm willing to write unit tests for this feature in the future.