Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to trigger a scroll in emacs when my cursor gets within 4 lines from the top or bottom of the terminal.

My .vimrc file contains this line:

:set scrolloff=4

What do I add to .emacs to acheive the same?

PS. I promise not to add it with:

vi ~/.emacs
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I think scroll-margin will help -- look for it in the Emacs docs on Textual Scrolling.

Put this in your .emacs:

(setq scroll-margin 4)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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