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

Make Vim movement to end of line configurable #17782

Closed
wants to merge 2 commits into from

Conversation

svelterust
Copy link

Release Notes:

  • Add ability to configure Vim movement when moving to the right

Copy link

cla-bot bot commented Sep 13, 2024

We require contributors to sign our Contributor License Agreement, and we don't have @knarkzel 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'.

@svelterust
Copy link
Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 13, 2024
Copy link

cla-bot bot commented Sep 13, 2024

The cla-bot has been summoned, and re-checked this pull request!

@svelterust
Copy link
Author

I want to make it possible to configure normal mode and visual mode movement:

  • "vim_normal_include_newline": boolean
  • "vim_visual_include_newline": boolean

If it's true, it uses clip_ignoring_line_ends, otherwise clip_point. How can I do that?

@svelterust
Copy link
Author

Same with mouse

@SomeoneToIgnore
Copy link
Contributor

There's been a need to do similar things for #16848 and we ended up with defining fields in the actions to modify this behavior.

This is the 2nd case in out Vim support where line ends matter, so maybe we can still do a similar thing.
If there's an entire class of things to change, maybe we can consider adding it into global settings, but would be good to know first.

@svelterust
Copy link
Author

It's following I have noticed:

  • Mouse clicking on end of line doesn't go to newline, annoying.
  • Right doesn't go to newline in normal mode. In visual mode it does, so when deleting the newline is included (annoying).
  • End of line doesn't go to newline in normal mode. In visual mode it does, so when deleting the newline is included (annoying)

@svelterust
Copy link
Author

Essentially it's something that should be configurable, like "include_newline" on per command basis. Then this can be modified for normal mode and visual mode.

@ConradIrwin
Copy link
Member

@knarkzel I think if we want to do this we should just have a setting on the vim crate for allow_cursor_beyond_line_end which defaults to false. If that setting is set, we would always return false from

pub fn clip_at_line_ends(&self) -> bool {
.

That said, I am nervous about this because while I don't like the existing clip_at_line_ends stuff, it does replicate what vim does (and I don't want to test new features with this setting enabled, so it will likely have strange edge-cases).

Why do you want to be able to do this?

@ConradIrwin ConradIrwin self-assigned this Sep 17, 2024
@maxdeviant maxdeviant changed the title TODO: Make Vim movement to end of line configurable Make Vim movement to end of line configurable Sep 17, 2024
@ConradIrwin
Copy link
Member

Closing this for now, but let me know if you're still interested in this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants