Tell emacs to interpret words breaking them at newline and whitespace

感情迁移 提交于 2020-01-17 12:15:25

问题


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.

来源:https://stackoverflow.com/questions/40024130/tell-emacs-to-interpret-words-breaking-them-at-newline-and-whitespace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!