Bicycle-riding Dog
Bicycle-riding Dog

Reputation: 65

(Gvim) How to delete a certain pattern which is embraced by certain characters

I like to delete all characters embraced by "[" and "]" including these embracing characters. How can I do that?

Upvotes: 3

Views: 455

Answers (2)

bilo
bilo

Reputation: 71

Perhaps use a find and replace like this:

:%s/\[.*\]//g

Upvotes: 1

hobbs
hobbs

Reputation: 239861

Believe it or not, da[. Read :help text-objects to find out why, and what other kinds of regions you can use in this way (some other useful ones are aw for a word, and ap for a paragraph).

Upvotes: 8

Related Questions