vim tips and tricks

text selection

If you want to do the same thing to a collection of lines, like cut, copy, sort, or format, you first need to select the text. Get out of insert mode, hit one of the options below, and then move up or down a few lines. You should see the selected text highlighted.

V       - selects entire lines 
v       - selects range of text
ctrl-v  - selects columns
gv      - reselect block

After selecting the text, try d to delete, or y to copy, or :s/match/replace/, or :center, or !sort, or...