41

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 ?

50

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.

5
  • 4
    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.
    – user798719
    Jun 27 '13 at 16:17
  • 6
    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.
    – user798719
    Jun 27 '13 at 16:21
  • Thanks @user798719 I was having exactly the same problem.
    – JW.
    Mar 12 '14 at 11:41
  • Did you guys bind function + <arrows> for the terminal. By default it is not working on macOS default terminal.
    – h3dkandi
    Oct 23 '19 at 7:37
  • @user798719 Try C-u - C-M-v. See: stackoverflow.com/a/60497723
    – Flux
    Mar 2 '20 at 22:50
31

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.

2
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.

1
  • 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.
    – user650654
    Aug 23 '19 at 2:57
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)))
1
  • 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. Jul 9 '18 at 5:34
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

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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