在 Vim 中,我想回去说一句话。与“w”相反
当您使用 vim 时,您可以使用 w
逐字前进。我该如何倒退?
When you're using vim, you can move forward word by word with w
. How do I go backwards?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用
b
返回一个单词。您可能还需要查看
W
和B
来前进/后退WORD
(其中根据
:h WORD
,由一系列用空格分隔的非空白字符组成。Use
b
to go back a word.You may also want to check out
W
andB
to advance/go back aWORD
(whichconsists of a sequence of non-blank characters separated with white space, according to
:h WORD
).它有助于我将其视为:
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 wordw
to go the beginning of next worde
to go to the end of current or next wordge
to go the end of the previous wordTry
:h word-motions
for more details and how to combine them with operations.使用“b”向后移动 - 刚刚在 vi 中测试 - 工作正常。
use "b" to move back - just tested in vi - works fine.
或者,如果您使用
w
、b
、W
和B
通过跳过单词来导航行,请考虑如果使用正确,以下替代方案可以更快。或
如果您的单词由空格分隔
如果您的单词由
分隔,您可以通过空格跳过单词:f;;;;
其中 < code>; 重复上一个命令,因此您向前跳空格F;;
向后跳空格如果您的单词由标点符号分隔,而不是空格,
只需替换
带标点符号,例如.
标点符号方法对于滚动浏览效率不高,但如果您知道要跳转到哪里,通常可以到达那里一两次跳跃。
Alternatively, if you use
w
,b
,W
, andB
to navigate lines by hopping over words, consider the following alternatives which can be faster if used correctly.or
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 spacesF<space>;;
to hop backwards by spaceIf 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.