chrisgrieser / nvim-spider

Use the w, e, b motions like a spider. Move by subwords and skip insignificant punctuation.
MIT License
617 stars 13 forks source link

Feature Request: Allow option for empty lines to be a significant punctuation (especially for change) #16

Closed mech-a closed 1 year ago

mech-a commented 1 year ago

Feature Requested

Let's consider the case that we want to change a word in a phrase that isn't ended by significant punctuation and there are new lines after that. If we change a word, it will go to the next significant punctuation, which ends up being a completely new line. See the linked video example. I think this is a significant issue considering that it can delete a lot of space unexpectedly.

I think that making an option for empty lines being a significant punctuation is a decent solution to this, but I wanted to start a conversation to see what might be the best. Maybe one solution is seeing if there is a way that we can customize the behavior of Spider-w/e/b/ge such that when we are moving without any commands, it skips over new lines, but chained in commands it doesn't?

Relevant Screenshot

https://github.com/chrisgrieser/nvim-spider/assets/11798509/02fc4d5b-24d8-4715-8943-656ac5059d24

Checklist

mech-a commented 1 year ago

Nevermind -- I saw your note on operator-pending mode and how ce could be used as a drop-in. I figure that that's the best path forward.