emacs scroll other window up
Asked Answered
H

7

48

In Emacs we can scroll inactive window using certain commands

But not all details are listed in the manual.

C-M-v can scroll down the other window

my intention is to scroll up the other window, how could I do that ?

Hydraulic answered 24/4, 2012 at 2:1 Comment(0)
M
58

Try C-M-S-v, which is scroll-other-window-down.

You can find such key bindings by doing C-h b (describe-bindings) which populates the *Help* buffer with a list of all the key bindings and associated commands for the current buffer. A quick search through that for scroll-other showed the binding you mentioned, as well as the one I listed.

Manifestative answered 24/4, 2012 at 2:17 Comment(5)
I tried command + meta + shift + v and the other window does not scroll up. I'm using emacs 24.3 in the terminal (mac os x). The original poster wanted to know how to scroll the other window up, not down.Vaudeville
Well it looks like in the terminal (iterm2 to be exact) you can't get the command shift meta v to work, although this is the correct answer. On a mac I had to use function + up_arrow to scroll the other window up. function + down_arrow also scrolls the other window down.Vaudeville
Thanks @Vaudeville I was having exactly the same problem.Coronado
Did you guys bind function + <arrows> for the terminal. By default it is not working on macOS default terminal.Rustyrut
@Vaudeville Try C-u - C-M-v. See: stackoverflow.com/a/60497723Ilario
T
36

On many terminals you can do M-PageUp and M-PageDn to scroll the other window. It's nice if you're already used to using PageUp/PageDn for scrolling.

Troll answered 10/1, 2014 at 7:19 Comment(2)
Best option so farSensor
FWIW, the default bindings for M-PageUp (i.e. M-<prior>) and M-PageDown (i.e. M-<next>) are scroll-other-window and scroll-other-window-down. See this to learn how to rebind: gnu.org/software/emacs/manual/html_node/emacs/…Personage
C
10

You can alternatively give a negative argument to C-M-v. Negative arguments can be given with almost any modifier combination. In that case you can type C-M-- C-M-v.

Chrysler answered 24/4, 2012 at 2:48 Comment(1)
The negative argument has to be given each time for e.g. if scrolling more than a page. It's a bit more to type.Eastertide
F
4

I use this (everyday) :

(define-key global-map [(meta up)] '(lambda() (interactive) (scroll-other-window -1)))
(define-key global-map [(meta down)] '(lambda() (interactive) (scroll-other-window 1)))
Formate answered 28/7, 2017 at 2:35 Comment(1)
Yes, very practical. I've bound those lambda on C-M-<next> and C-M-<prior> as scroll-other-window and scroll-other-window-down are already bound to C-M-<prior> and M-<prior> and M-up and M-down are reused by org-mode.Lawman
P
3

scroll down, (scroll-other-window)

scroll up, (scroll-other-window '-)

scroll-other-window is the native C API of Emacs, so it should work out of the box. Check its documentation.

Feel free to assign hot key for them

Potful answered 13/8, 2014 at 0:23 Comment(0)
I
2

You could do C-u - C-M-v (i.e. scroll-other-window with ARG -) if C-M-S-v (i.e. scroll-other-window-down) does not work for you, as could happen when using Emacs in a terminal.

Excerpt from C-h f scroll-other-window:

Negative ARG means scroll downward. If ARG is the atom '-', scroll downward by nearly full screen.

Ilario answered 2/3, 2020 at 22:47 Comment(0)
P
0
  • M-<prior> runs the command scroll-other-window-down (fn option up-arrow on Mac)
  • M-<next> runs the command scroll-other-window (fn option down-arrow on Mac)
Pickens answered 27/2 at 19:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.