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

cw #69

Open
1wsx10 opened this issue Jul 7, 2022 · 6 comments
Open

cw #69

1wsx10 opened this issue Jul 7, 2022 · 6 comments

Comments

@1wsx10
Copy link

1wsx10 commented Jul 7, 2022

ok so there are two things i have noticed.

thing 1:

 asdf_
^ cursor

cw here will change up to the underscore. default vim cw will change up to the a (it goes up to the word, not to the end of the word)

thing 2:
vims special case for cw (see https://old.reddit.com/r/vim/comments/26nut8/why_does_cw_work_like_ce/)
it would be nice if there was an option for the more canonical version of cw
eg:

asdf (
 ^ cursor

dw here would delete to the (
cw deletes up to (not including) the space, so it's like ce

@chaoren
Copy link
Owner

chaoren commented Jul 7, 2022

I fixed this a while back. Try updating the plugin?

@chaoren
Copy link
Owner

chaoren commented Jul 7, 2022

Oh, the cursor is on the space before the a in the first case. Yes, that looks like a bug.

I can't reproduce the second case.

@1wsx10
Copy link
Author

1wsx10 commented Jul 7, 2022

2 is more of a feature request. i'll probably have a look at making a PR at some point.

@1wsx10
Copy link
Author

1wsx10 commented Jul 7, 2022

to be clear, what i explained in 2 is also default vim behavior for cw, but it's not consistent with dw or vw or yw etc and it's redundant because ce does the same thing. its just a little annoying when you actually want to change up to the next word, you end up having to do dwi or ct( or something.

@chaoren
Copy link
Owner

chaoren commented Jul 7, 2022

Yes, I know. I specifically reproduced the behavior of cw because people asked for it, so it should be there. You probably have an oudated version of the plugin if that behavior is not happening for you.

@tuurep
Copy link

tuurep commented Jul 27, 2024

It would be elegant if the cpoptions preference for this would be respected

In Vim, this is

set cpoptions-=z

(note: lowercase)

But in NeoVim, it's

set cpoptions-=_

Docs:

Vim: https://vimhelp.org/options.txt.html#cpo-z
NeoVim: https://neovim.io/doc/user/options.html#cpo-_

Oh yes also, I reproduced your "Thing 1". I'm interested in this issue as a whole.

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

3 participants