In the vim configuration article we have seen a simple configuration of vim using the .vimrc file.

Now we will add a very useful feature.

Using this feature when you open a file vim will move the cursor in the position where it was when the file was last closed. We will use the .viminfo file to allow vim remember the last position:

 

At the end of the file we will add a few lines to retrieve last position:

 

That's all,

now when you will open a file with vim, vim will jump to the last used position.

Gg1