开发者

In Vim, how do I delete everything within the double quotes?

开发者 https://www.devze.com 2023-02-02 17:05 出处:网络
Assuming I\'m inside the quotes already.开发者_高级运维Try the following sequence, which can be thought of as \"d\"elete, \"i\"nside, quotes, so:

Assuming I'm inside the quotes already.开发者_高级运维


Try the following sequence, which can be thought of as "d"elete, "i"nside, quotes, so: di"


The following sentence drops everything inside the quotes while being in normal mode:

di"

where:

  • d is for delete
  • i is for "inner", just inside the following marker.
  • " is for specifying that you will delete inside the quotes.

Note that it is not needed to be inside the quotes when you call it, the own command looks for the first occurence of text inside quotes in the current line and deletes it, so you can save some key strokes.

Additionally, if you are interested in deleting the quotes too, then apply the following command (a means "and around it")

da"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号