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

Ctrl + Left/Right Arrow Keys should jump entire words #7683

Closed
PotatoesFall opened this issue Jul 19, 2023 · 4 comments
Closed

Ctrl + Left/Right Arrow Keys should jump entire words #7683

PotatoesFall opened this issue Jul 19, 2023 · 4 comments
Labels
C-enhancement Category: Improvements

Comments

@PotatoesFall
Copy link
Contributor

Description

When in normal, insert or selection mode, using arrow keys moves the cursor.

Holding Ctrl while using the left/right arrow keys does nothing, instead the cursor should move entire words, similar to the behavior in prompts: https://github.com/helix-editor/helix/blob/master/helix-term/src/ui/prompt.rs#L509

Why is this useful

different keyboard layouts make arrow keys preferable

Generally, navigation is done using hjkl or whatever the user has mapped. However, I (and maybe others) are often switching between keyboard layouts and have the arrow keys conveniently accessible on a second layer, making it easier to navigate using arrow keys, rather than switching keymap constantly.

only useful in insert mode

In normal or selection mode, this would not be an improvement, since b, e, w etc. are around. However in insert mode this feature proves useful as we need to switch to normal mode to navigate, then back into insert mode, when we could simply use the arrow keys (for small movements)

similar to most other text fields

As much as we might like to, we are not using helix all day. We have to use forms on websites, other text editors, etc. Ctrl + left/right arrow almost always moves entire words. In other words, most people already have this in their muscle memory.

@PotatoesFall PotatoesFall added the C-enhancement Category: Improvements label Jul 19, 2023
@PotatoesFall
Copy link
Contributor Author

PotatoesFall commented Jul 19, 2023

I'm happy to code this myself if people like the idea but I'm not sure where to start. I was able to find where this happens in prompts but not in the editor itself.|

Edit: found it. will make a PR to go along with this.

@pascalkuthe
Copy link
Member

the bindings were purposefully removed in #3671 and even though we added back arrow movements we purposefully did not add the ctrl-based keybindings back when that PR was partially reverted see #3915 (comment).

If you want to use these bindings you can add the bindings back yourself in your config. However, movement in insert is generally not intended

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2023
@PotatoesFall
Copy link
Contributor Author

PotatoesFall commented Jul 19, 2023

Thanks for the quick response!

The reasoning there makes a lot of sense actually. Sorry to bring it up if it's already been discussed, I didn't find it in my initial search.

One small thing remains, rebinding this key works fine, but when used in insert mode it creates a selection which doesn't make sense. I can make another issue and maybe even a fix. (or I'll just live with it, not sure)

@gabydd
Copy link
Member

gabydd commented Jul 19, 2023

Almost all commands make selections and that's by design if you don't want the selection you can add a "collapse_selection" to the custom command

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

No branches or pull requests

3 participants