Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat newlines like other whitespace in word motions #13031

Open
knuesel opened this issue Mar 6, 2025 · 0 comments
Open

Treat newlines like other whitespace in word motions #13031

knuesel opened this issue Mar 6, 2025 · 0 comments
Labels
C-enhancement Category: Improvements

Comments

@knuesel
Copy link

knuesel commented Mar 6, 2025

Newlines seem to be treated like words in commands like those bound to b, w, e. Wouldn't it be preferrable to treat them like whitespace? It seems more intuitive to me, and also more useful.

For example when the cursor is on | in the following example

wo|rd

word

pressing w doesn't select until the start of the next word as expected, but stops at the end of the word. Why? I would logically press e if I wanted to do that...

Another example where it bit me:

f(

  x)

I wanted to remove the spaces and newlines to obtain f(x). I thought with the cursor after ( I would just do wd but that only removes the whitespace before x, leaving the newlines untouched.

Treating newlines as whitespace would also improve consistency with commands such as extend_next_word_start and delete_word_forward: in the second example for example extend_new_word_start + d could do the job (but this command also stops at the word end in the first example; it could also make sense to change that).

@knuesel knuesel added the C-enhancement Category: Improvements label Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

1 participant