仅转换三个外部词

Som*_*ody 2 emacs

如何在具有最少击键次数的emacs中将"foo"和"bar"转换为"foo和bar"?

输入:

foo and bar
Run Code Online (Sandbox Code Playgroud)

输出:

bar and foo
Run Code Online (Sandbox Code Playgroud)

Jua*_*cho 6

其他方式:

数字前缀0到M-t将转换在标记之后结束的单词,并在单词后面结束单词.

所以,如果^是标记并且|是点:

f^oo and ba|r
Run Code Online (Sandbox Code Playgroud)

按下后会变成M-0 M-t:

|bar and ^foo
Run Code Online (Sandbox Code Playgroud)

因此,在您的示例中,如果您正在键入foo and bar|,则键序列可以是C-space M-3 M-b M-0 M-t(在行尾设置标记,将3个单词设置为foo,转置这些单词).