1

I want to be able to do this because I am used from other editors to use the cursor as a visual bookmark, so that after scrolling by letting the cursor off screen I can come back to its place later. I know that in Vim I can use marks but I think that when using a mouse to scroll it is more easy to put the cursor in a place and let yourself know the cursor remains there when scrolling.

A similar question is this, but my question is different. Another acceptably similar question is this but it is not very clearly similar and it has a single answer which is the accepted one and is not useful when put to my question.

2
  • 3
    I understand your point, but you should really have a look at marks. They are literally bookmarks for your files. Give a try at it! You'll learn and you can use them in your day-to-day editions.
    – nobe4
    Apr 29, 2016 at 19:52
  • 3
    The cursor is always somewhere on the screen. That's how Vim is designed and there's no way around that.
    – romainl
    Apr 29, 2016 at 21:04

1 Answer 1

5

I am used from other editors to use the cursor as a visual bookmark, so that after scrolling by letting the cursor off screen I can come back to its place later.

If you're just scrolling through the file and want to bookmark specific place, there's really no way around using Vim's marks. Sorry about that.

However, if you want to bookmark a place where you're editing (e.g. to quickly scroll and reference some other part of the text, then jump back and keep editing), Vim has got two niceties for you! It saves your last editing position as '^ mark, and it provides a gi command to quickly start Insert mode at that mark. Using those is labor-free and should cover at least part of your use-cases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.