The extension was created after discussing with @occivink about the controversial mappings and the word movements in general, and I would like to collect your feelings about the following interpretation of word movements.
I made a clojure text-object plugin whose element selection works kind of like this, and I mapped
w to it. It messes me up when I want to select whitespace at the beginning of a line when the cursor is in the whitespace, though, so I’m not completely happy with it. My current work-around is to use
W, which works most of the time. I’m not sure how to resolve this.
The plugin is https://github.com/eraserhd/select-nrepl .
How about mapping e to
map global normal e '"_/\s+<ret>' map global normal E '"_?\s+<ret>' map global normal <a-e> '"_<a-/>\s+<ret>' map global normal <a-E> '"_<a-?>\s+<ret>'
It’s kinda weird. I like how it ignores whitespaces and selects words only, and I think it will be handy for prose, but I’m not sure if it will actually be useful in coding, as I don’t often use word movements at all, and search is my only friend. I’ll use it for next several days and report again.
I didn’t knew I needed this until I tried it. It works incredibly good but I still have some bad habits of using
E to avoid whitespace selection.
I still find a bit weird the double selection feature (pressing back to select before the selection start) instead of going back, but it might just be my muscle memory
@xyuusha I added a command to skip words.
Apart from that, I’m open to experiment new changes.
when pressing w while in the middle of the word, whole word is selected. Doesn’t work with W. Is it intended?
Other than that this is far better than default behavior for word movement.
Yep. word-movement is a superset of Alt + i, w. When the action is satisfied, it moves to the next word. W extends, and honors the selection set.
Select a word with w or Alt + w and use W to extend.
I like this idea and plugin. Though I would suggest to add cursor flip feature to W and B before extending next word. For example when word is selected with w cursor is at right side of the selection, then if I decided to extend its left side, I press B but instead of extending to the next word, in my opinion it’s better to flip the cursor first so it is visually obvious which direction next extension will go. But if cursor is already matching the direction side, for example cursor on the left and B pressed there is no need to flip cursor first. I hope it’s clear what I mean. Also it will be useful in one character extension cases.