Questions tagged [scrolling]

is for commands to move text up and down and sideways in a window. Scrolling forward moves the buffer text upwards and scrolling backward moves downwards. Horizontal scrolling moves the buffer text left or right. Emacs provides many functions, key bindings, and programming facilities for scrolling.

Filter by
Sorted by
Tagged with
0 votes
1 answer
42 views

How to show more of the buffer in the current window?

Sometimes I have the current buffer in the current window displayed sub-optimally: there is a lot of buffer not shown, and there is a lot of empty space at the bottom below the EOB. E.g.: the buffer ...
user avatar
  • 5,487
2 votes
1 answer
76 views

How to disable ggtags' *ggtags-global* buffer scrolling?

when I do next-error, the *ggtags-global* buffer scrolls down one line. I hope that the *ggtags-global* buffer doesn't scroll, whether it's executing next-error, previous-error, or compile-goto-error. ...
user avatar
0 votes
0 answers
54 views

Buffer divider staggered upon split window and scroll

Whenever I split windows or scroll with a split window, the buffer dividers and text end up staggered horizontally. Here is a screenshot of a file without the split window or issue shown. And here is ...
user avatar
0 votes
0 answers
31 views

Reset horizontal scroll after line motion

I currently satisfice by disabling auto-hscroll-mode, but I want it back. I know you can make it hscroll only the current line by setting it to 'current-line. Doesn't fix the problem. Problem: it's ...
user avatar
0 votes
1 answer
65 views

Touchpad vertical scroll gesture scrolls too much lines in GUI on Windows 10

How can I change that? I probably need something like fractional scrolling? Look at that video https://streamable.com/lfic9h
user avatar
  • 152
1 vote
1 answer
125 views

mwheel-scroll bindings between GUI and terminal?

Using an Emacs daemon (28, pgtk branch) switching between GUI and terminal, I can't get mouse scrolling to work on both. They work on each individually, but the issue is with the mouse-wheel-{up,down}-...
user avatar
  • 11
3 votes
2 answers
152 views

How to scroll to the beginning of the line in Emacs

I have buffer and I end up at 1616 column (I have one very long line, bug string). Is there a way to scroll the beginning of the line with a single commands. Is there a way to reset the buffer without ...
user avatar
  • 661
3 votes
1 answer
44 views

how to make `C-l` override `centered-cursor-mode`?

I love centered-cursor-mode. It keeps my cursor in the center of the screen always. However, on rare occasions, I need to use C-l recenter-top-bottom to "scroll" in order to view text lower ...
user avatar
2 votes
0 answers
184 views

Prevent Emacs from scrolling past the last line

Obviously Emacs never scrolls "above" the first line of the buffer. By contrast, it shows a bunch of empty space after the document if you scroll to the last line: I want to make the bottom ...
user avatar
1 vote
1 answer
57 views

How to distinguish a scroll from a change of buffer in a function called from ‘window-scroll-functions’?

I've written a function that recenters the point each time it makes a long jump and I added it to the hook window-scroll-functions. The length of the jump is determined by comparing the return value ...
user avatar
  • 1,414
1 vote
1 answer
85 views

How to make Isearch highlight more matches when I scroll?

upon having used Isearch or C-u C-s to highlight a word, when I use then C-v or M-v for scrolling the highlights remain due to setting (setq-default isearch-allow-scroll t lazy-highlight-...
user avatar
  • 439
0 votes
0 answers
73 views

Scroll by visual line in `centered-cursor-mode`?

Mouse scrolling with visual-line-mode in centered-cursor-mode is jumpy as anything when you're writing prose. A single line of text can be 10 or more visual lines. Editing in refill-mode or auto-fill-...
user avatar
1 vote
0 answers
69 views

Emacs 27 scrolling issue

In Emacs 27, in -nw mode at least which is what I use, I've found an issue with scrolling. If you open emacs to see two files at once: emacs -nw -q file1 file2, and then scroll down the left window ...
user avatar
1 vote
0 answers
52 views

view-scroll-half-page-forward messes up scrolling

I have the following in my config (setq scroll-preserve-screen-position 1) ;;scroll window up/down by one line (global-set-key (kbd "s-n") (kbd "C-u 1 C-v")) (global-set-key (kbd &...
user avatar
  • 439
0 votes
0 answers
190 views

Scrolling lag on Linux

Emacs scrolling is lagging for me on Linux but not on macOS. I'm using Ubuntu 20 and also tried Solus but behavior is the same. Faster system helps but not enough. What so special about emacs build on ...
user avatar
0 votes
1 answer
319 views

How to get scrolling without jumps (by one line) in info mode?

I'm new to Emacs and trying to learn it using the built-in manuals (tutorial, manual and lisp intro). I used (setq scroll-step 1) to avoid jumps in the normal mode, yet when viewing info - the scroll ...
user avatar
  • 101
1 vote
1 answer
40 views

How to customize scrolling for any action that moves the point?

Say I have an action that moves the point (adds 100 to it for example). It should be possible to wrap this with a function or macro that gives additional behavior, eg: (global-set-key (kbd "<...
user avatar
  • 7,199
0 votes
1 answer
38 views

Fractional vertical scrolling

I found this link About fractional verticle scrolling for emacs. However there was not any explanation about how to configure this for scrolling of normal files. How do I configure a fractional scroll ...
user avatar
  • 288
1 vote
1 answer
200 views

Can page-down clamp the last line to the bottom of the window?

When using page-down (internally scroll-up-command), sometimes the window ends up in a state where end end-of-file is at the top of the screen. Is there a way to page-down, clamping window position ...
user avatar
  • 7,199
1 vote
1 answer
171 views

How to get emacs to keep cursor in the middle of buffer during search?

(I am using Aquamacs 3.5 which is based on GNU Emacs 25.3.50.1, in case this matters.) While searching (isearch-forward) in a buffer it often happens that I need to see some lines before/after the ...
user avatar
0 votes
0 answers
70 views

mac-mwheel-scroll screws centered-positon-mode when using mouse pad on a macbook laptop

I am able to scroll using navigation buttons and external mouse on a Mac with this code that keeps the cursor at a specific line at all times. I am using this code since it is much faster than ...
user avatar
  • 554
2 votes
1 answer
124 views

Linked, Split screen scrolling for a single buffer?

I would like to be able to have a C-x 3 split to have two windows in a frame both windows view a single buffer window on left ends at line n window on right starts at line n +/- configurable offset ...
user avatar
  • 1,173
1 vote
1 answer
637 views

How to scroll using mouse while keeping cursor on same line/position?

I am using this minor mode to scroll and keep cursor on same line, mwheel-scroll however screws up the smooth scroll since it moves the cursor to a different line, scrolling return the cursor back to ...
user avatar
  • 554
0 votes
1 answer
96 views

How to disable a minor/major mode so that mwheel-scroll don’t take effect?

I am trying to have a simple solution to center the cursor at all times. I found that centered-cursor-mode was too slow and found this simpler solution. The only problem is mouse scrolling no longer ...
user avatar
  • 554
1 vote
0 answers
73 views

scroll-preserve-screen-position screws up evil-scroll-down (C-d) in evil

centered-cursor-mode has been extremely sluggish so I found that this setup achieves the same without the slowness: (setq scroll-preserve-screen-position t scroll-conservatively 0 maximum-...
user avatar
  • 554
0 votes
0 answers
293 views

Why is scrolling line-by-line so much slower compared to vi-mode?

I was wondering if anyone has faced this issue before or is just me loosing my mind? It seems that C-n and C-p are so slow and sluggish compared to the j and k keys when using evil-mode. Is there any ...
user avatar
1 vote
2 answers
111 views

How to prevent scroll up doing nothing when the value is too big?

When calling (scroll-up N) with a large value that would exceed the buffer length - nothing happens. For example: (global-set-key (kbd "<f4>") (lambda () (interactive) (scroll-up 10000))) ...
user avatar
  • 7,199
0 votes
1 answer
268 views

Possible to smooth scroll using pixel and line offsets?

I'm running into an odd problem scrolling by pixels, it seems calling scroll-up doesn't properly handle pixel scrolling (set-window-vscroll). This is a simple test that attempts to scroll up by ...
user avatar
  • 7,199
2 votes
1 answer
104 views

How to perform interactive auto-scroll?

Is it possible to activate a blocking 'scroll' mode that uses the vertical position of the cursor and a timer? This is handy because you can move the cursor to a certain Y-delta to maintain a fixed ...
user avatar
  • 7,199
1 vote
1 answer
80 views

How to repeatedly move forwards or backwards by a screenful of text?

I tried C-u 1 C-v, which based on the documentation should repeat C-v one time. Unfortunately, it only ends up scrolling a line instead of a screenful. Any guidance appreciated.
user avatar
  • 133
0 votes
1 answer
318 views

After change from Ubuntu to Lubuntu the mouse wheel (scroll) doesn't work without pressing CTRL together

When I try to scroll with mouse I receive a message saying Wrong type argument: commandp, mouse-5 or Wrong type argument: commandp, mouse-4. This happens after I tried a lot of random fixes. Before ...
user avatar
  • 209
0 votes
2 answers
425 views

How to change line COUNT for for evil-scroll-up

How to change line COUNT with C-u or C-d for evil-scroll-up or evil-scroll-down? From Spacemacs help: C-u (evil-scroll-up COUNT) C-d (evil-scroll-down COUNT) If COUNT is not specified the function ...
user avatar
  • 1,333
0 votes
1 answer
232 views

Line numbers break scroll margin

I'm trying to set a scroll margin to emacs with the scroll-margin variable, but I've noticed that when you do that and you have display-line-numbers-mode enabled, the scrolling doesn't work properly ...
user avatar
  • 1,914
5 votes
1 answer
498 views

Automatically scroll *compilation* window, beside source-buffer window

I edit C in two windows side-by-side, source on left, compilation results on right. I have F5 bound to recompile. Currently I have to do: F5 to run make, Move to *compilation* buffer in right ...
user avatar
1 vote
0 answers
98 views

cannot rebind M-p [closed]

I try to customize the scrolling experience within Emacs and for that rebound M-n and M-p to a new functionality, namely (global-set-key "\M-n" "\C-u20\C-v") (global-set-key "\M-p" "\C-u20\M-v") ...
user avatar
  • 439
2 votes
0 answers
72 views

"Negative" scrolling, or: actually recentering first line

Usually, there's some extra "virtual" space shown at the bottom of a buffer, which makes the visual appearance of a file longer than it actually is. This is quite convenient, e.g., if you're trying ...
user avatar
4 votes
2 answers
1k views

Is there a way to increase speed of scrolling when holding down C-n/C-p/C-f/C-b?

Title is basically the question. If I hold down C-n, C-p, etc., for a second or two, the speed at which it scrolls is too slow for my liking. Is there a way to make it scroll faster if I hold one of ...
user avatar
2 votes
1 answer
232 views

Execute function when (after) window scrolls

I need to execute a function every time a window scrolls. I mean the function to be executed at point "after" the window has been scrolled (with C-v, M-v or with the <down> key). I tried: (add-...
user avatar
7 votes
2 answers
5k views

Smooth scrolling by pixel-lines

With GNU Emacs 26.1 installing either smooth scroll while adding (require 'smooth-scroll) (smooth-scroll-mode t) to my .emacs, or smooth scrolling with (require 'smooth-scrolling) (smooth-...
user avatar
  • 473
1 vote
2 answers
221 views

Scroll vertically while keeping horizontal position

I'm viewing a file containing visually aligned columns in truncate line mode, and would like to scroll vertically without changing my horizontal scroll position. But scroll-down always moves the ...
user avatar
1 vote
1 answer
151 views

In-sync editing the same file in two frames

For a lecture, I'll have a setup with two frames (one on my notebooks's screen, the other on the projector) showing the same file. When editing the file in the "master" frame I need the "slave" frame ...
user avatar
  • 23
0 votes
0 answers
299 views

Horizontal Scroll Bar Mode with trackpad

How can I use my trackpad to scroll left and right, when in horizontal-scroll-bar-mode? I am running GNU Emacs 25.3.3 (x86_64-apple-darwin13.4.0, Carbon Version 157 AppKit 1265.21) of 2017-09-28. ...
user avatar
  • 1,775
6 votes
1 answer
2k views

can scrolling be smoother than single line in emacs/org-mode?

Using the trackpad, the scrolling in emacs/spacemacs is notably less smooth than in modern browsers and other editors. I have to confess that this jerkiness irks me more than I would prefer but I have ...
user avatar
8 votes
4 answers
1k views

How to autoscroll a window to always show the end of a growing buffer?

Context: I have a window that shows the output of a shell command. As new lines are added, I'd like the window to always show the most recent lines. Example: (let ((temp-window (or (get-buffer-...
user avatar
  • 2,460
0 votes
1 answer
105 views

Cursor position variable

Here's my function: (defun scroller-down () "Scrolling down conditional for buffer and minibuffer." (interactive) (if (active-minibuffer-window) (ivy-scroll-down-command) (scroll-down-...
user avatar
2 votes
2 answers
402 views

Scroll only current line when truncating lines

When using (set-default 'truncate-lines t), and when moving to the end of the long line, is it possible to make Emacs scroll only that line, while the other lines stand still? nano does this.
user avatar
  • 441
5 votes
1 answer
191 views

(progn (scroll-up 1) (goto-char 0)) is different from (scroll-up 1) then (goto-char 0)

In any buffer, try to eval-expression the expression (scroll-up 1) and then eval (goto-char 0). The window scrolls up, then point is moved to the beginning of the buffer. Now, try eval-ing (progn (...
user avatar
3 votes
1 answer
473 views

How do I make a buffer automatically scroll to its end?

I have a buffer in which the pressed keys echo, and I want the cursor in it always be at the very end. How can I accomplish this?
user avatar
  • 620
1 vote
1 answer
185 views

Align lines of two separate files in two split-windows?

Is there a way to align line numbers of separate buffers, one in each split window?
user avatar
  • 141
1 vote
0 answers
243 views

org-mode and insert-sliced-image

I read in the Emacs manual online about using insert-sliced-image to create smooth scrolling with inline images. I would like to use this to override org-toggle-inline-images, so that I can get ...
user avatar
  • 1,775