Just a small tidbit. If you ever need to delete all lines from the cursor, except the last n lines in Vim, you can use the ex command

:,$-nd

Where n is number of lines you want to retain from the bottom. For example, if you have a footer on the last line, you can use

:,$-1d

To delete all but the last line.