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
    Ctrl+v
  • 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 DĀ (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.