In emacs, whenever I want to delete a few lines of text, I just use C-k until all the text is gone. However, in vim it seems a bit more complex. I know I can do d$ to delete until the end of the line and dd to delete the entire line I'm on, but how do I delete all of the next line?
|
|
||||
|
|
|
Assumption: You want to end up at the line you started on. My answer:
Try it – it's quick! In fact, it's two keystrokes less than the currently accepted answer because:
Plus, I spent a long time using h, j, k, l to navigate in |
|||||
|
|
I strongly recommend reading this answer in stack overflow, which got over 500 upvotes: http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118 -- the answer is long, but helps to understand why vim is powerful... |
|||
|
|
You may also be interested in visual mode. Just use |
|||
|
|
|
If you want to delete a bunch of lines in a row, you can use |
|||
|