VI / VIM Delete all text

To delete all content from current position to the end of file on bash, you can take the following steps:

  • Open file in vi or vim

    $> vi fiele
    $> # or
    $> vim file
  • Switch to visual block mode
  • Press G (Shift+g)
  • Mark text to delete with arrow keys top and down or just press END to mark everything to the end of file
  • Press (Shift+d) to delete selected lines

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.