Use scroll margins to give context to your cursor

I add the following line to my emacs config file so the when I move the cursor near to the top or bottom of the window, the window will scroll when I am 3 lines away from edge. The effect is that (however it is moved) the cursor is always given 3 lines of context before the top or bottom of the window, which I find very useful.

(setq scroll-margin 3)

One comment

  1. Back in the dark ages when TPU-mode still worked, you could specify scroll margins as a percentage of the current window. If someone could figure out how to do that I’d love it.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s