Emacs模式下的“自由”光标定位

5

有没有一种模式可以让我通过鼠标单击或按键在屏幕上的任何位置(包括行末)放置光标?

编辑:

一个基于picture-mode的小模式,确切地做到了问题所问。

(define-minor-mode free-point-mode
    "Place the cursor anywhere on the screen, irrespective of linebreaks, by clicking or using the arrow keys"
  nil nil
  `((,(kbd "<mouse-1>") . picture-mouse-set-point)
    (,[remap right-char] . picture-forward-column)
    (,[remap left-char] . picture-backward-column)
    (,[remap previous-line] . picture-move-up)
    (,[remap next-line] . picture-move-down))
  (require 'picture))

(defadvice picture-mouse-set-point (after no-region activate)
  (deactivate-mark))

如果你将其作为答案,我可能会接受它。它也可以作为覆盖模式,但是基于它创建一个小模式应该很容易。 - sabof
1个回答

8

picture-mode 可以让您在屏幕上的任何位置放置光标。不要被名称所迷惑,它与图像无关:

如果要编辑由文本字符制成的图片(例如,在程序中作为注释的寄存器分区的图片),请使用命令 M-x picture-mode 进入图片模式。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接