Vim Tip: Select everything

Post by Nico Brailovsky @ 2009-07-11 | Permalink | Leave a comment

There's an easy way to select the whole contents of the document: "ggVG". May seem like a lot at first glance but let's review it part by part:

  1. gg: Go to the beggining of the document
  2. V: Enter visual mode
  3. G: Go to the end of the document

Easy, isn't it? Now you can press any other command to copy, delete or whatever you like.