What should i do when i delete a line in vi?

It's what i'm doing right now

  1. Open up the terminal alt + ctrl + t
  2. vi a.txt
  3. I move my cursor to the line which I wan to delete, then what key-combination is should use to delete line in vi editor ?
Best Answer


Pressing dd will remove that line (actually it will cut it). So you can paste it via p .