-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
vim: Allow left/right (h/l) motions to change lines + up/down (k/j) to move the cursor to the start/end #25663
Conversation
We require contributors to sign our Contributor License Agreement, and we don't have @asqarslanov on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
I discovered a small bug in the implementation. When the parameter While not a huge problem, this makes the implementation incomplete. I’ll try to tackle down this problem, but, I guess, I will also need some help since the |
@asqarslanov Thanks for this! For For |
Thank you for the reply! Setting As for Having been a Vim user for more than two years, I still find myself pressing these keys at the top/bottom line to move the cursor—it’s simply the first thing that comes to my mind—and it’s just annoying when the editor doesn’t do the thing. For example, I may try to go to the beginning of a file by first pressing |
Makes sense. I think it'd be better to teach your fingers Want to send a PR to the docs page for the wrapping behavior of h/l ? |
Unfortunate that the PR was aborted, but I understand this is done to not make the editor a mixture of everyone’s whims. I hope, the plugin system will be powerful enough to implement this as an extension. About the docs, yes, I think, I could do that. To make things more intuitive, what do you think about renaming (aliasing) the |
Sounds fine to me (you can use the |
Closes #25510.
This pull request adds two config options:
"vim.boundary_movements.left_right"
("off" | "on"
)"vim.boundary_movements.up_down"
("off" | "on"
)They allow to toggle “wrapping” of the left/right and up/down motions in Vim mode (details in the discussion).
Potentially, this feature may be exapnded to only allow wrappings for the arrow/letter keys. That’s the reason why I chose to use strings (
"off"
,"on"
) instead of booleans.The changes are not breaking, so users aren’t required to modify their configuration files.
This is my first real open-source PR, so the implementation may not be the cleanest, but it works. I’ll be glad to hear feedback on how to improve code quality.
Also, I’m not a native English speaker, so the naming of the config options (and variables in the code) may not be accurate, I’m open to suggestions.