MrPicklePinosaur / shrs

The rusty shell toolkit for hackers
https://mrpicklepinosaur.github.io/shrs/
Apache License 2.0
301 stars 24 forks source link

Slightly improved vi mode #492

Closed JarKz closed 3 months ago

JarKz commented 3 months ago

What changed?

More about the last clause

I found that no need to check current character if need to move to the last character of current or next (previous) word. Important to check next (or previous) character is the whitespace or not.

Let's see in an example. Let be the word "hello", and the cursor is pointing to last character (we need to move last character of word). As you see, checking the current character is very bad idea, because there is a way -- check next character and it's whitespace, so need to move to next word.

But, if the cursor pointing to begin or mid of the word above, then next character is non-whitespace and it's fine to move to last character of the word.