在VIM中的光标之后,如何删除多炭?

发布于 2025-02-08 06:01:05 字数 98 浏览 2 评论 0原文

我想在光标之后删除5个字符。我该怎么做?

就像 c 5 w 更改5个单词,我如何更改5个字符?

I want to delete, say, 5 characters after cursor. How can I do it?

Just like c5w change 5 words, how can I change 5 characters?

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

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

发布评论

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

评论(1

一抹淡然 2025-02-15 06:01:05

看来您不仅要删除,还要求更改和其他东西。

关键是 w 是单词向前移动的文本对象,而 l 是按字符向前移动的对象,因此

  • c 5 l 更改以下5个字符(根据评论,您可以将其缩短为 5 s
  • ) d 5 l 删除以下5个字符,您可以将其缩短到 5 x x

类似地,就像 b 是向后词一样, h 是字符向后,因此您可以做 c 5 d 5 h

It looks like you're not just asking for removal, but also changing, and other stuff.

The point is that w is the text object that moves forward by words, whereas l is what moves forward by character, so

  • c5l changes the following 5 characters, (as per the comment, you can shorten this to 5s)
  • d5l deletes the following 5 characters, which you can shorten to 5x

Similarly, just like b is words backward, h is characters backward, so you can do c5h and d5h, for instance.

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