Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scroll line by line in GNU Emacs?

Tags:

emacs

To put it simply, I'm trying to get scrolling in emacs like in vim and most other editors; when I'm for example, two lines from the bottom/top, and I press down/up (Ctrl-p,n, ,) it goes only one line up or down, not half the screen.

like image 392
Rook Avatar asked Jul 15 '09 01:07

Rook


People also ask

How do I scroll by n lines in Emacs?

The number of lines of overlap left by these scroll commands is controlled by the variable next-screen-context-lines, whose default value is 2. You can supply the commands with a numeric prefix argument, n, to scroll by n lines; Emacs attempts to leave point unchanged, so that the text and point move up or down together.

What is the default Scroll margin in Emacs?

The variable scroll-margin restricts how close point can come to the top or bottom of a window. Its value is a number of screen lines; if point comes within that many lines of the top or bottom of the window, Emacs recenters the window. By default, scroll-margin is 0.

Why does Emacs show truncated lines on my screen?

If a window shows truncated lines, Emacs performs automatic horizontal scrolling whenever point moves off the left or right edge of the screen.

Why does Emacs adjust point when scroll command leaves point?

If the value is t, Emacs adjusts point to keep the cursor at the same screen position whenever a scroll command moves it off-window, rather than moving it to the topmost or bottommost line. With any other non- nil value, Emacs adjusts point this way even if the scroll command leaves point in the window.


1 Answers

See some of the suggestions on the Emacs Wiki:

  • Emacs Wiki: Smooth Scrolling
(setq scroll-step            1       scroll-conservatively  10000) 
like image 72
ars Avatar answered Sep 27 '22 22:09

ars