Git Product home page Git Product logo

Comments (2)

s-cassidy avatar s-cassidy commented on July 21, 2024

To add to this, dw/cw also doesn't work on the last word in the file.

Seems like dw/cw in this plugin is looking ahead for a space followed by another character. If we are at the last word of line, it ends up finding this on the next line (not expected). If we are at the last word of the file, it can't find this at all so doesn't do anything (not expected).

I like the idea of this plugin but can't really use it until this is fixed.

from nvim-spider.

chrisgrieser avatar chrisgrieser commented on July 21, 2024

The default vim behavior when entering cw on a word in sentence is to preserve the post space which allows you to type a word and not have to add a space. This is in contrast to the dw command that deletes the post word space to make that word seem like it was never there.

Yeah, vim's original web motions work quite inconsistent in this regard. I deliberately not implemented the same for this plugin, since with subword motions and punctuation skipping, you get a lot of other unexpected before if you introduce vim's behavior here. Same thing for dw and cw not working at the end of a file: When you are at the last word of a file, there literally is not next word, so not doing anything is actually the intended behavior.

In my view, original vim actually taught many people a bad habit here of treating cw differently, when people should actually be using ce instead. If you really want to, you can map cw to ce though, which should get you your desired behavior.

I added some info on this to the docs though.

ciw does work as expected

that's cause this plugin does not change the iw text object at all ;)

from nvim-spider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.