Command Mode i Switch to Insert mode :x Exit, saving changes :q Exit as long as there have been no changes Insert Mode ESC Switch to Command mode :%d Select all and delete (actually move to buffer) :%y Select all and copy to buffer. Use p to paste the buffer.