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

Key Remapping hjkl ~~> jkl; Fails in multiple ways in Normal & Select mode #3367

Closed
dream-dasher opened this issue Aug 9, 2022 · 3 comments
Labels
C-bug Category: This is a bug

Comments

@dream-dasher
Copy link

Summary

[Note: I'm posting this as it indicates a bug not because I have an issue with it, specifically. I am no longer using the shifted mapping, but the fact that shifted mapping fails so inconsistently is, ofc, notable]

Remap: (hjkl~~>jkl; && ; ~~>h)
A config.toml with notes and images of same with failed remappings highlighted is attached.
The nature of the failures is not consistent.
Sometimes the hjkl behavior is retained.
Sometimes no effect is produced.
Sometimes it's for one direction and not another where as sometimes its for all directions.
And 'Visual' mode no longer highlights with direct arrow movement keys.

keys normal - with  failures noted

keys select - with failures noted

Example failing config.toml file (Note: remove the .txt at the end -- had to postpend that to get github to load it & and of course remove the description pre- config.toml)
failing_key_remapping-config.toml.txt

Reproduction Steps

Highlighted and annottated remapping images attached.
The config.toml file also attached so one can just switch that in and drive it themself.

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines
[share-helix.log](https://github.com/helix-editor/helix/files/9289445/share-helix.log)

Platform

macOS 12.5

Terminal Emulator

iTerm_2 3.4.15 && wezterm 20220624-141144-bd1b7c5d

Helix Version

helix 22.05 (27609f5)

@dream-dasher dream-dasher added the C-bug Category: This is a bug label Aug 9, 2022
@Woolworths
Copy link

While we're on the topic, I have found it impossible to remap . (the dot). It just will not map to what I set it to.

@the-mikedavis
Copy link
Member

Repeat last insert . is a separate issue: #1488

For most of these, this is a limitation of TOML. Each successive table is overwriting the last instead of being merged.

You have to use a single table for all sub-keys:

[keys.normal]
z = { k = "scroll_down", l = "scroll_up" }

Or use:

[keys.normal.z]
k = "scroll_down"
l = "scroll_up"

For the "doesn't work (doesn't select text, but does move)" ones, this is expected behavior. Use extend_* commands (extend_char_left/extend_line_down/extend_line_up/extend_char_right) instead of move_* to keep the selection as you move.

@dream-dasher
Copy link
Author

Made those changes and everything works. So this was a TOML-syntax (+ one bit of Helix-semantics) issue.
Thanks.

Very unfortunate (read: ugly) that TOML inline tables can't have new lines -- forcing single huge lines instead of readable blocks. But that's a TOML limitation apparently.

Changed, working config for reference for others that might run into similar problems:

keys normal - with changes noted

keys select - with changes noted

updated_working_key_remapping-config.toml.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants