Skip to content

cw #69

Open
Open

Description

@1wsx10

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

Activity

  1. chaoren commented on Jul 7, 2022

    @chaoren
    Owner

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

  2. chaoren commented on Jul 7, 2022

    @chaoren
    Owner

    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.

  3. 1wsx10 commented on Jul 7, 2022

    @1wsx10
    Author

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

  4. 1wsx10 commented on Jul 7, 2022

    @1wsx10
    Author

    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.

  5. chaoren commented on Jul 7, 2022

    @chaoren
    Owner

    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.

  6. tuurep commented on Jul 27, 2024

    @tuurep

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions