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

Can't map commands to special accented keys #4241

Closed
pem-imre opened this issue Oct 13, 2022 · 8 comments
Closed

Can't map commands to special accented keys #4241

pem-imre opened this issue Oct 13, 2022 · 8 comments

Comments

@pem-imre
Copy link

pem-imre commented Oct 13, 2022

Thanks for this great editor!

My problem is, that I use a Hungarian keyboard on which some of the default keymappings are cumbersome. For example ; is hard to press, so I want to remap it to é (which is the same position as ; in English keyboards). Unfortunately I was unable to do this mapping.

[keys.normal]
é = "collapse_selection" # Produce error "unexpected character found `\u{e9}` at line..."
"é" = "collapse_selection" # No error, but neither é or ; collapses the selection

I don't know if this is a bug, or there is a way to get this working. I found no info about accented key mapping around here or in the documentation.

@CptPotato
Copy link
Contributor

Could this be an issue with your terminal emulator?

On my setup (Windows 10, wezterm) I can successfully bind é using the binding with double quotes as you suggested. Note that I don't have an é key but instead used the ´ dead key + e. I'm not sure if this makes a difference.

Can you provide some more information about your setup? (i.e. OS, helix version, terminal emulator)

@pem-imre
Copy link
Author

I run Helix in tmux in WSL2 in Windows Terminal on Widows 10. I am new to Helix (captured by the speed and good defaults). The key é is working in my terminal, as I can type it without a problem. The character set of config.toml is utf-8.

I looked at the source code, and think it might be a limitaion of toml::de::from_str. Will test.

@CptPotato
Copy link
Contributor

Hmm this is odd. Do you have a rust development environment set up by chance?
If that's the case you could try cloning crossterm and running the event-read example to see what input crossterm detects when you enter é (i.e. cargo r --example event-read).

Also just to be sure, which version of helix are you using hx -V?

@mountainfloating
Copy link

So im having the same issue. And its described here Im on a german keyboard and would like to map pressing ö twice to {. The toml spec doesnt allow special characters in fields without parenthesis. Is it actually possible to do this in helix?

@mountainfloating
Copy link

Okay so the solution is to put the special keys in the configuration in parenthesis like this:
'ö' = { 'ö' = "somecommand"}
i think it should be described in the docs. Its discouraged to do it like this for normal characters in the toml spec.

@woojiq
Copy link
Contributor

woojiq commented Jan 19, 2023

I think this can be closed as the author doesn't responding to help.

@gabydd
Copy link
Member

gabydd commented Jan 19, 2023

I think this is solved, but we may want to add the solution to the documentation as suggested to fully solve this issue

@pascalkuthe
Copy link
Member

I added an appropriate entry to the FAQ. Also since #5656 toml error messages are improved so this should be more discoverable now

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

6 participants