snowgoose
snowgoose

Reputation: 165

In Emacs split windows, how to browse the other window?

I used C-x 3 to split to left and right windows. The cursor is in left window and I can use C-n, C-p to move the cursor. How can I stay in the left window and move the code in right window up and down?

I have done this before but I lost all my emacs files. So I cannot figure it out right now. Thanks.

Upvotes: 1

Views: 320

Answers (2)

LotAbout
LotAbout

Reputation: 717

I've googled for the answer, Re: How to scroll other window backwards? C-M-v does forwards

Still, use scroll-other-window function and add parameters to it. Below are the details:

(defun scroll-other-window-up-line ()
  "Scroll the other window one line up."
  (interactive)
  (scroll-other-window -1))
(defun scroll-other-window-down-line ()
  "Scroll the other window one line down."
  (interactive)
  (scroll-other-window 1))
(global-set-key (kbd "M-p") 'scroll-other-window-up-line)
(global-set-key (kbd "M-n") 'scroll-other-window-down-line)

Hope it can help.

Upvotes: 3

Miserable Variable
Miserable Variable

Reputation: 28761

scroll-other-window is your friend, bound to C-M-v by default.

Upvotes: 1

Related Questions