Vim - 在多行中删除直到(包含)字符 [英] Vim - delete until (inclusive) character in multiple lines
本文介绍了Vim - 在多行中删除直到(包含)字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个代码:
def foo(c: Char) = c match {
case 'a': 'B'
}
我的光标在 =
之后的空格上.我想删除所有内容,包括 }
.我该怎么做?
My cursor is on the space after =
. I want to delete everything until, including, the }
. How can I do that?
我可以在光标位于第一行的任何位置的地方做同样的事情吗?块中的任何位置(并将光标放在 =
之后)?
Can I do the same where the cursor is anywhere on the first line? Anywhere in the block (and place the cursor after the =
)?
推荐答案
d/}/e
完成工作.
d/}
删除 until }
但添加 /e
标志将光标移动到最后一个匹配的字符,有效地删除光标和 }
之间的所有内容,包括.
d/}
deletes until the }
but adding the /e
flag moves the cursor on the last char of the match, effectively deleting everything between the cursor and the }
, inclusive.
使用视觉选择也可以,以稍微更直观的方式:
Using visual selection works too, in a slightly more intuitive way:
v/}<CR>d
这篇关于Vim - 在多行中删除直到(包含)字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文