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
25
votes
3answers
2k views

Smooth (mouse) scroll for inline images?

I display images in-line with begin_src & result blocks. However, for large-images, when I scroll past the bottom of the image, I get a 'jerk' and the whole image is scrolled away. Similarly if I ...
24
votes
3answers
2k views

Let Emacs move the cursor off-screen

This question was originally asked at https://stackoverflow.com/questions/15895313/let-emacs-move-the-cursor-off-screen, but all the answers I got more or less said "it can't be done", which with ...
23
votes
1answer
6k views

Synchronized scrolling in two windows

Is there a way to reflect the navigation commands in the current window in another visible window. I have two related LaTeX files displayed in two windows and would like to scroll through them ...
13
votes
1answer
338 views

Why doesn't M-v following C-v move cursor back to the original position?

M-v following C-v doesn't move the cursor back to the original position. Why is that? Can we make it happen?
8
votes
1answer
406 views

Emacs sometimes starts automatically recentering cursor position

At some unidentifiable point of time (can be in a few days, can be in a few hours) something clicks in Emacs and it starts automatically recentering my cursor position. Like I move my cursor somewhere ...
8
votes
1answer
669 views

Different scroll margins at top and bottom of window?

Q: is there a way to set different scroll margins at the top and bottom of a window? The variable scroll-margin (defined in the C source code) sets how many lines of text that Emacs displays, at a ...
7
votes
2answers
3k 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-...
7
votes
2answers
864 views

Hook that indicates when the cursor has been moved by scrolling

Inspired by this question: Let Emacs move the cursor off-screen, I am considering writing a minor mode that will keep the cursor in a fixed position that is not affected by scrolling operations. I ...
6
votes
3answers
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-...
6
votes
1answer
100 views

How to preserve the visual height of the cursor after an operation?

Q: How do I find the visual line number of point (so that I can restore it after an operation)? By “visual line number”, I'm referring to the number N of lines between the top of the window (or the ...
6
votes
2answers
294 views

How to scroll while using multiple cursor?

I use a lot multiple cursor and sometimes I have to select some words which are off the screen, in sublime text I do not encounter any problem, I can just scroll and continue selecting words. This, ...
6
votes
1answer
1k 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 ...
5
votes
3answers
3k views

How can I scroll a half page on C-v and M-v?

I use Spacemacs, and for some time I've rebound C-v and M-v to spacemacs/scroll-half-page-down and spacemacs/scroll-half-page-up, respectively, to aid my understanding of the buffer as I move through ...
5
votes
2answers
864 views

How to center the current line vertically during Isearch

During search and especially search-and-replace it would be nice to have the surrounding lines as context. But when jumping to the next hit, the cursor sometimes ends at the lowest visible line (or ...
5
votes
2answers
197 views

How to ensure lines are always displayed in groups of 3?

I am writing a major-mode which displays a list to the user. It is similar to tabulated-list-mode, except each entry takes up 3 lines, as opposed to just one: 0 0 Ctrl-} key in emacs 5m ...
5
votes
2answers
610 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 ...
5
votes
1answer
226 views

How to prevent org-mode from repositioning text in the window when cycling visibility?

In org-mode, when I cycle through the visibility of the document via the TAB key (org-cycle), the text sometimes gets repositioned. If there is enough text below the headline such that it will not ...
5
votes
1answer
147 views

How to get `window-end` when the window scrolls?

From the doc of window-end function: Even if update is non-nil, window-end does not attempt to scroll the display if point has moved off the screen, the way real redisplay would do. It does not ...
5
votes
1answer
172 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 (...
4
votes
2answers
479 views

Scrolling during isearch stops searching, losing matches

I use C-s to search for a string. All matches are highlighted. Then I would like to scroll down by C-v, but all matches disappear. I know keeping C-s will move to the next match, but it is too slow. ...
4
votes
2answers
534 views

zs and ze from Vim?

I use evil-mode, but it doesn't support zs and ze shortcuts from Vim (scrolling horizontally to cursor position). How can i map these keys to achieve the same behavior in Emacs? Some explanation of ...
4
votes
2answers
1k views

Terminal Emacs not receiving <wheel-up> or <wheel-down>?

From what I understand, I should be able to get mouse scrolling to work in emacs nox mode with the following: (require 'mouse) (xterm-mouse-mode t) (mouse-wheel-mode t) (global-set-key (kbd "<...
4
votes
0answers
184 views

How to actually scroll with popup-tip :scroll-bar t?

Following this blog post, I am interested in using popup.el for my own purposes. In the post, he mentions to add a scroll bar with the :scroll-bar argument. If I include the :scroll-bar t option in ...
3
votes
1answer
549 views

emulation of scroll-off?

Vim has an option called scrolloff (e.g. set scrolloff=7) which automatically scrolls down or up to keep the cursor/point from getting within a certain distance of the top or bottom of the window. Is ...
3
votes
1answer
105 views

How to vertically center when opening a file:line from emacsclient?

Is there a way to center the vertical scroll position when using emacs client to open a file at a position? eg: emacsclient +$NUM:$COL $FILE --no-wait --alternate-editor=emacs Is it possible to ...
3
votes
1answer
586 views

ansi-term scroll problem on fast output

I use a terminal from within Emacs via M-x RET ansi-term RET. The problem is that when I run a program which echoes a lot of output, ansi-term first scrolls with the output (such that the last line of ...
3
votes
1answer
855 views

How to recreate iA Writer-style typewriter scrolling in Emacs?

The popular Mac editor iA Writer (https://ia.net/writer/mac/) has many nifty features that I rather like. So far, I've been able to recreate the look and feel for the most part -- except for the ...
3
votes
1answer
138 views

More useful vertical scrolling in emacs

I am trying to compare two log files, side by side in two emacs buffers. The logfiles are similar in context, but some have extra debug inserted. This makes simple use of pgup/pgdown painful as things ...
3
votes
1answer
69 views

Can buffer boundaries be displayed at the top and bottom of windows?

I know that Emacs can display the buffer boundaries in the fringe, by displaying angles at the boundaries, and arrows where the buffer can be scrolled. Is there some way to display these boundaries, ...
3
votes
1answer
174 views

Making scrolling easier to follow when pair programming

When pair programming with emacs I've found it is hard for the person who is not typing ("driving") to follow scrolling. I've seen this both as the "passenger" and the "driver". How can I make ...
3
votes
0answers
74 views

Hook variable for horizontal scrolling

There is the hook variable window-scroll-functions for functions to be called before redisplay after vertical scrolling. Is there a similar variable for horizontal scrolling?
3
votes
0answers
59 views

Synchronised scrolling of HTML file and eww buffer

I am editing a HTML file. I have done C-x 3. Now, in the other split window, I want to open a browser, such as eww. And as I move in the HTML file, I want the browser window to show the ...
3
votes
0answers
373 views

Scrolling in tmux in emacs

I'm using emacs to run ansi-term with an ssh'ed tmux inside. I can scroll using my prefix C-b + [ as per this thread, but I would like to be able to scroll with the mouse immediately. This seems to ...
3
votes
0answers
926 views

fast moving cursor?

What can I add to my .emacs to make the cursor move more quickly? Specifically, I'm looking for faster rates for (holding arrow-keys and C-arrow keys (ie skipping over whitespace with my current ...
2
votes
1answer
257 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 ...
2
votes
2answers
245 views

Temporarily disable scrolling

Is there a way to temporarily disable scrolling in an emacs buffer? I would like to "lock" a particular line to be (say) the top of the displayed portion of the buffer, so that if I accidentally try ...
2
votes
1answer
16 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-...
2
votes
1answer
41 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 ...
2
votes
1answer
81 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 ...
2
votes
2answers
327 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.
2
votes
1answer
232 views

get buffer scroll position and height (aka min and max on-screen buffer locations)

I'm interested in the region of a buffer that is visible on-screen. How do you get the current scroll position of a buffer? I.e. the line number of the topmost line in the viewable area? (Given ...
2
votes
1answer
143 views

Using ggtags tag lookup along with centered-cursor-mode

I am using centered-cursor-mode to center the cursor at 10 lines above center at all times. I am trying to have ggtags respects this setup after each tag lookup. When I have the cursor at any point ...
2
votes
2answers
719 views

How to move point to the end of another buffer, using `with-current-buffer` and `goto-char`?

I'm trying to implement «effective append» for log buffer, e.g. if a point is at point-max position then insert text and move point to new point-max, otherwise append text and preserve point position. ...
2
votes
0answers
65 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 ...
2
votes
1answer
145 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-...
2
votes
1answer
249 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?
2
votes
1answer
145 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?
2
votes
0answers
140 views

Horizontal Scroll Wheel on Mouseover Buffer

My mouse has a horizontal scroll function, where I can tap the scroll wheel left and right to scroll horizontally. By default, it seems Emacs does nothing with that. The scroll wheel produces <...
2
votes
0answers
89 views

Is it possible to use the mouse wheel for company mode?

I'm using the Cocoa version of Emacs. When company mode presents a list of completions you can use the mouse to select one. It would seem natural to be able to use the mouse wheel to scroll through ...
1
vote
2answers
172 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 ...