To delete (and cut) the current line in vi or vim, use the following command in normal mode:
dd
This command deletes the entire current line and places it in the unnamed
register, so you can paste it elsewhere using the p
command
. This is the standard way to "cut" a line in vi/vim, as deleting with dd
both removes the line and makes it available for pasting.