Deleting within special characters
A few characters are normally intended to “capture” things. For example: ", (), {}, and [] are typically intended to delimit something. In written language, quotes are used to capture what a person is saying, and parentheses are used to insert additional information into text. If you’re a software engineer, you will have also seen {} and [] used to capture chunks of code.
Vim understands these constructs. In Vim parlance, we have text objects representing the content that is grouped by certain characters. We can perform operations on them.
This is when most people start to glimpse at the true power of Vim, so hold on to your hats!
We can use di" in normal mode to delete everything inside quotes. We can similarly use di(, di{, and di[ to delete everything inside parentheses, braces, and square brackets respectively. Note that you have to be inside the quotes/parentheses/etc for these commands to work. The mnemonic here is “delete inside something”
The editor has some examples of these text constructs — work through the checklist below to try each command.