在 Vim 中,我想回去说一句话。与“w”相反

发布于 2025-01-03 16:06:40 字数 51 浏览 2 评论 0原文

当您使用 vim 时,您可以使用 w 逐字前进。我该如何倒退?

When you're using vim, you can move forward word by word with w. How do I go backwards?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

妥活 2025-01-10 16:06:40

使用 b 返回一个单词。

您可能还需要查看 WB 来前进/后退 WORD(其中
根据:h WORD,由一系列用空格分隔的非空白字符组成。

Use b to go back a word.

You may also want to check out W and B to advance/go back a WORD (which
consists of a sequence of non-blank characters separated with white space, according to :h WORD).

一抹苦笑 2025-01-10 16:06:40

它有助于我将其视为:

b 转到当前或上一个单词的开头

w 转到下一个单词的开头

e转到当前或下一个单词的末尾

ge 转到上一个单词的末尾

尝试使用 :h word-motions 了解更多详细信息以及如何将它们与操作结合起来。

It helps for me to think of it as:

b to go to beginning of current or previous word

w to go the beginning of next word

e to go to the end of current or next word

ge to go the end of the previous word

Try :h word-motions for more details and how to combine them with operations.

蒲公英的约定 2025-01-10 16:06:40

使用“b”向后移动 - 刚刚在 vi 中测试 - 工作正常。

use "b" to move back - just tested in vi - works fine.

灯下孤影 2025-01-10 16:06:40

或者,如果您使用 wbWB 通过跳过单词来导航行,请考虑如果使用正确,以下替代方案可以更快。

f<char>    # jump to next occurrence of <char> to right (inclusive)

F<char>    # jump back to next occurrence of <char> to left (inclusive)

如果您的单词由空格分隔

如果您的单词由 分隔,您可以通过空格跳过单词:

f;;;; 其中 < code>; 重复上一个命令,因此您向前跳空格

F;; 向后跳空格

如果您的单词由标点符号分隔,而不是空格,

只需替换 带标点符号,例如 .

标点符号方法对于滚动浏览效率不高,但如果您知道要跳转到哪里,通常可以到达那里一两次跳跃。

Alternatively, if you use w, b, W, and B to navigate lines by hopping over words, consider the following alternatives which can be faster if used correctly.

f<char>    # jump to next occurrence of <char> to right (inclusive)

or

F<char>    # jump back to next occurrence of <char> to left (inclusive)

If your words are separated by spaces

If your words are separated by <space> you can hop over words by spaces:

f<space>;;;; where ; repeats the previous command, so you hop forward by spaces

F<space>;; to hop backwards by space

If your words are separated by punctuation and not spaces

just replace <char> with punctuation, for example .

The punctuation method is not efficient for scrolling through, but if you know where you want to jump, it can usually get there in a jump or two.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文