有可用的新包装上的GNU ELPA呼吁scroll-restore,试图解决这个问题.到目前为止,我遇到了一些错误,但是这个包似乎在大多数情况下都是广告宣传的.
您可以通过安装它来测试它
M-x package-install RET scroll-restore RET
Run Code Online (Sandbox Code Playgroud)
安装软件包后,您可以启用次模式
M-x scroll-restore-mode
Run Code Online (Sandbox Code Playgroud)
就个人而言,我将它绑定到Scroll Lock键上,因为它似乎非常适合!这是我添加到我的init文件中的内容:
(require 'scroll-restore)
(scroll-restore-mode 1)
;; Allow scroll-restore to modify the cursor face
(setq scroll-restore-handle-cursor t)
;; Make the cursor invisible while POINT is off-screen
(setq scroll-restore-cursor-type nil)
;; Jump back to the original cursor position after scrolling
(setq scroll-restore-jump-back t)
;; Toggle scroll-restore-mode with the Scroll Lock key
(global-set-key (kbd "<Scroll_Lock>") 'scroll-restore-mode)
Run Code Online (Sandbox Code Playgroud)
这是此处发布的答案的直接副本:https://emacs.stackexchange.com/a/2273/93
严格来说,您不能将光标移出屏幕,因为底层 C 代码不允许您这样做。
这就是说,我怀疑你的问题可以得到解决。基本上有2个方面:
pre-command-hook技巧自己完成。顺便说一句,我欢迎 Emacs 中提供一些功能的补丁。我讨厌其他编辑器的“自动跳回”行为,但最好记录“预滚动”位置,然后提供一种跳回该位置的方法。
| 归档时间: |
|
| 查看次数: |
1865 次 |
| 最近记录: |