在 Vim 中,如何删除引号之间的所有内容,包括引号? [英] In Vim, how can I delete everything between quotes including the quotes?

查看:104
本文介绍了在 Vim 中,如何删除引号之间的所有内容,包括引号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,在下面:

在引号内测试删除"

光标在delete里面,如何删除引号内的文字并包含引号,离开:

在引号内进行测试

解决方案

您可以使用以下顺序:

da"

请记住,这仅适用于一行,并且会删除最后一个引号后的所有尾随空格.

编辑

正如@James 在下面的评论中所指出的,您还可以使用 di" 序列(delete inside)删除引号内的字符而不删除引用.

您还可以将其与 ci"(内部更改)一起使用以删除字符并切换到插入模式,从而轻松替换引号内的文本.

For example, in the following:

Testing "deleting" within quotes

With the cursor inside of deleting, how can I delete the text within the quotes and include the quotes, leaving:

Testing within quotes

解决方案

You can use the following sequence:

da"

Keep in mind this only works on a single line, and will remove any trailing spaces after the last quote.

Edit

As pointed out by @James in the comments below, you can also use the di" sequence (delete inside) to delete the characters within the quotes without deleting the quotes.

You can also use this with ci" (change inside) to remove the characters and switch to insert mode, allowing you to easily replace text within quotes.

这篇关于在 Vim 中,如何删除引号之间的所有内容,包括引号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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