gpt4 book ai didi

emacs - 仅转置三个的两个外部单词

转载 作者:行者123 更新时间:2023-12-02 08:43:06 25 4
gpt4 key购买 nike

如何在emacs中以最少的击键数调换“foo”和“bar”中的“foo”和“bar”?

输入:

foo and bar

输出:

bar and foo

最佳答案

另一种方式:

0 到 M-t 的数字前缀会将标记后的单词与点后的单词调换。

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

f^oo and ba|r

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

|bar and ^foo

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

关于emacs - 仅转置三个的两个外部单词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14870369/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com