How to make Vim jump to last position on reopening file

It is bit frustrating when you reopen a file and Vim positions itself at the top of the file again. It would be nice if Vim remembered where you were the last time you opened this file and jumped to that position right away.

This functionality can be enabled in Vim by placing these lines in your vimrc file: