I'm familiar with the "dd" and "d{motion}" commands, but can't find "dap" in vim's help.txt. What does "dap" do in normal mode and why? (Alternatively, how can I find out this sort of thing for myself?)
|
"dap" does not actually delete everything. For example, try putting this into your buffer:
Then put your cursor on either '2' and type "dap". It'll leave the '1's and '3's. This is because "dap" deletes a paragraph. In fact, that's actually the mnemonic: "(D)elete (A) (P)aragraph". You can see it in the help under
This is called a "text object". You can read about these under: Either way, the basic idea of text-objects is that you are defining the boundaries of an object and then apply commands to that whole object even when you're in the middle of it. For example, I'm sure you know you can use
If you type
You had the basic idea down! Checking the help is always a good start. In this case, you could have realized that |
|||
|
|