 So, how do you delete in Vim? This is something that many of you have been waiting over a week for me to tell you. So with no further ado, let's dive in to D. A lot of you have been asking, where the heck are you? What happened to this thing? It's been a week. And yes, I'm very sorry. All of that is true. So I left for a weekend trip and I very diligently recorded D and E beforehand and I was really proud of myself. I was going to upload them. I was going to feel really amazing and then come back and just do the next ones. Unfortunately, ScreenFlow did not record this screen. And so it was just kind of like me talking over nothing happening. It was just really boring. So I ended up trashing those and then when we got back, I forgot that we had painters coming to do this room, which as you can see no longer has the swatches and it's all white and crisp now. And then my whole family got the flu and actually my son now has pneumonia. So it's just been total mayhem here. I've actually been, there's a bed right here. I've been sleeping in the office because I didn't want to get my wife sick. She ended up getting sick anyway. Anyway, it's been chaos. It's been absolutely terrible. I've just been sleeping and drinking coconut water and watching terrible television. Anyway, that brings us to D, why we're here today. I thank you for your patience and I'm very, very glad that I still have enough Excedrin left to be able to be slightly cognizant to record today's lesson. So let's open our editor. In Vim, our quick brown file and as a recap, this file just has five lines with the same sentence on it. The reason that is, is because I want you to have some orientation around when we delete things and how that affects the document. So first and foremost, D like C is a command that requires a motion. So if we hit D, nothing's going to happen right away. We need to give it a motion and we can use our arrow keys to do that. So we can hit right and that's going to delete just what's under the cursor. I'm going to hit undo to undo that. If I go here, put my cursor right on the other side of that period, I can hit D for delete and go left and it's going to delete what's right behind the cursor. So in this case, that period again, undo, we can hit D and down, which will delete the line that we're on and the line below it. You don't do conversely, we can hit D up and delete the current line and the line above it. Now you might be thinking like this is extremely similar to C and you're very right. The commands are almost identical with the exception that C is a deletion that leaves you in insert mode. It's actually two commands. This is just delete and the benefit of this is that it leaves me in command mode. So if I were to do C here, so I'm going to do what we covered yesterday, but do a capital C to delete through to the end of this line. Now I'm in insert mode, in insert mode, right? And so if I want to do the next command, so I can text, write text, which is great, but if I want to do the next command, I have to escape and then you to undo. Now if I do a capital D, which does the same thing, but without the insert, now I am just in command mode still. So I can't type, but I can just hit undo immediately without having to escape out first. So that's the biggest difference between D and C. To cover a few more things, you might be wondering, how do I delete only one line? Well, you hit D, D, which will delete just the line that we're on, U to undo. And as I just illustrated, you can do capital D to delete from the cursor on to the end of the line. This also works with visual selection mode. So if I hit V, which we've not covered in depth yet, that puts me into visual, visual selection mode. And with visual selection mode, I can make a visual selection and hit delete D to delete just that selection. Now this does put it into a register. All of these commands, all of these D commands will take whatever we deleted and put it into a register, which means that instead of undoing this particular change, I can use uppercase P to paste what is in the register. Now we're going to cover all of that kind of stuff, but I just wanted you to know kind of what that all means when we go into the help documentation for D. And we see this little mark marking right here. So we have D and motion, which we covered. We have double D, which we covered, capital D, which we covered, and the visual selection D, which we covered, which has some alternates. But this little doohickey here means that the text that is deleted will get kept in a register for pasting later on. I want to show you one last thing, which requires me to open up a different file. I'm going to open up the Lipsum text file, and this has two paragraphs of text. Now what I want to show you is this. If I hit D, D, you might expect that this line would be removed. Unfortunately, this whole paragraph is technically one line. There's no line breaks. So if I hit D, D, that is all going to go away. That also includes if I hit D down, etc. So explore that it may be a little counterintuitive at times with large blocks of text without line breaks, but just play with it and you'll get the hang of it. That is it for today's lesson. I really do appreciate your patience waiting so long to get it. And I do promise that I'm going to be on a more regular schedule now that the office is back to normal. And I am kind of coming back into regular health. I'll put some links to other videos and the playlist either around or in the description. And I hope that you can take what you learned today and race in hell.