我希望把光标固定在屏幕的中心线上,这样当我按下 Ctrl-N 或 Ctrl-P 时,页面本身会向上或向下移动,但光标保持不变。
有没有人有关于如何实现这一点的技巧?
谢谢
Ed
尝试使用光标居中模式:
http://www.emacswiki.org/emacs/centered-cursor-mode.el
如果您正在使用MELPA,则可以通过 M-x package-install
RET centered-cursor-mode
安装。
M-x scroll-lock-mode
可以用来充分利用滚动锁定键:
(global-set-key (kbd "<Scroll_Lock>") 'scroll-lock-mode)
(global-set-key (kbd "C-n")
(lambda (n)
(interactive "p")
(next-line n)
(recenter)))
(global-set-key (kbd "C-p")
(lambda (n)
(interactive "p")
(previous-line n)
(recenter)))