Have you ever switched tabs in VSCode and forgotten where your cursor was?
This happens to me all the time, especially when jumping between multiple files in large codebases.
So⦠I built a tiny VSCode extension to solve it.
π» What is Cursorghost?
Cursorghost is a lightweight VSCode extension that remembers your cursor position in each file tab β and restores it automatically when you switch back.
No setup needed. Just install it, and it works.
π Marketplace Link
π§ Why I built this
I got tired of constantly losing my cursor position and manually scrolling back to where I was editing. VSCode doesnβt remember the position across tabs by default, so I decided to write my own solution.
I wanted it to:
- Be automatic and seamless
- Work across all file types
- Require no config
- Be easy to install and forget
π οΈ How it works (under the hood)
In short:
- It listens for
onDidChangeActiveTextEditor
- It stores the current cursor line whenever you switch away
- When you come back, it restores the last known position
All written in TypeScript. The source is open on GitHub:
π GitHub - kupuma-ru21/cursorghost
π How to use it
- Open VSCode Extensions and search
Cursorghost
- Click install
- Switch tabs and feel the magic! β¨
No configuration required.
π§© Ideas for future features
- Diff view support
- Multi-cursor support
- Exclude certain files/types
Iβm open to feedback and PRs!
π Final thoughts
Sometimes itβs the little things that make your workflow feel smoother.
I hope Cursorghost saves you some frustration like it did for me.
If you try it and find it helpful, please βοΈ the GitHub repo and share it with others!
Let me know what you think β and thanks for reading π
π» Built by @kupuma-ru21
Top comments (0)