Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Have a look at SavePlace. It saves the last position of the cursor when a file is closed and re-positions the cursor at the same place when reopening the file.