command mode

The vim “delete line” command

vim delete FAQ: How do I delete a line in vim? (Also, how do I delete multiple lines in vim?)

To delete the current line in your vim editor, use this command:

dd

You can use this same command to delete multiple lines in vim. Just precede the command by the number of lines you want to delete. For instance, to delete five lines in vim, use this command:

vim modes - the three modes of vi/vim

The vi editor can be a little difficult to learn, so I've been writing some vi tutorials here recently. One of the first things to know about vi is that it typically functions in three different modes:

  1. Command mode
  2. Insert mode
  3. Last line mode

Here's a quick description of each vi mode.