vim - 如何删除一大块文本而不计算行数? [英] vim - How to delete a large block of text without counting the lines?

查看:37
本文介绍了vim - 如何删除一大块文本而不计算行数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 vim 中,我经常发现自己删除(或复制)大块文本.可以计算文本的行数并说(例如)50dd 删除 50 行.

In vim, I often find myself deleting (or copying) large blocks of text. One can count the lines of text and say (for example) 50dd to delete 50 lines.

但是如何在不知道要删除多少行的情况下删除这一大块文本呢?

But how would one delete this large block of text without having to know how many lines to delete?

推荐答案

我不是 vim 大师,但我在这种情况下使用的是视觉模式".在命令模式下,键入 V(大写).然后向上/向下移动以突出显示要删除的块(所有常用的移动命令都有效).然后用 xd 删除它.

I'm no vim guru, but what I use in this circumstance is "visual mode". In command mode, type V (capital). Then move up/down to highlight the block you want deleted (all the usual movement commands work). Then remove it with x or d.

这篇关于vim - 如何删除一大块文本而不计算行数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆