Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: TopSpace – Scroll above the top line in Emacs (github.com/trevorpogue)
7 points by emacs28 on Feb 21, 2022 | hide | past | favorite | 5 comments
This is an Emacs minor mode I made in my spare time this past year. It lets you scroll above the top line to vertically center top text in Emacs.

I made it out of my own necessity for the feature and it is very useful when using Emacs in full-screen with tall/large monitors. As monitors have been getting larger for many years now, I'm actually amazed that this kind of feature isn't more available in text editors or other software like internet browsers etc.

Let me know what you think or if you have any suggestions!




Indeed it is a nice feature! It's useful not only with large monitors, but also when one needs to visually compare two snippets that appear in two files at different offsets close to the beginning / end.

Although I haven't seen it implemented before -- granted I don't often investigate text editors -- some editors / pagers (`vim`, `less`, Sublime?, etc.) support keeping a number of lines always visible between the cursor and the top / bottom of the view; some also support keeping the cursor always centered vertically. But as said, none of them seem to support scrolling past the beginning of the file.

BTW, I've just "stolen" your idea and implemented in my own Python-based editor (<https://github.com/volution/simple-console-editor>).

Thanks! :)


Glad to help! Thanks for sharing, I will try to take a look at your editor. Don't tell other Emacs people, but I like programming in Python much better than Elisp


Is the idea that when you are in the top nlines and hit Ctrl-L you'd still like it to screen center? I know that feeling!


Yeah exactly! The cursor can be recentered independently of what line you're on with this mode (in particular at the top nlines). Actually your comment made me realize there is a bug when hitting Ctrl-L which I just fixed so thanks :D


Ha. I will give it a whirl. That actually has bugged me for about 15 years.

My bad habbits mean i often Ctrl-L when pondering something and so my eye habits are to be looking at that line.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: