Tell emacs to interpret words breaking them at new

2019-09-16 09:43发布

问题:

I would like to tell emacs to break "words" when there is a whitespace or a newline (the one used in forward-word).

If I use forward-word on this (the cursor is in the capital letter or with a _)

_aaaa} {bbbb

then I get

aaaa} {bbbb_

Since I dislike this behaviour I tried remapping M-f with forward-whitespace. In the above case the cursors places between the two brackets, as I want, but in a case like this

_aaaa-bbbb

the cursor goes here after a forward-whitespace

aaaa-bbbb_

so if I want to go to the beginning of the word bbbb I have to use forward-word.

How can I tell emacs to break "words" all the whitespace (a block of whitespace should be interpreted as a single whitespace, just like forward-whitespace does), and also to break words when changing line?

For the moment I use M-f for forward-word and M-F for forward-whitespace, but this is awkward.

Thank you in advance.