我用C-x 3分割成左右窗口。光标位于左侧窗口,我可以使用C-n,C-p移动光标。如何保持在左侧窗口中并在右侧窗口中上下移动代码?
我以前做过这个,但是我丢失了所有的emacs文件。所以我现在无法理解。感谢。
答案 0 :(得分:3)
我已经用Google搜索了答案,Re: How to scroll other window backwards? C-M-v does forwards
仍然使用scroll-other-window
函数并向其添加参数。以下是详细信息:
(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)
希望它可以提供帮助。
答案 1 :(得分:1)
scroll-other-window
是您的朋友,默认情况下绑定到C-M-v
。