Answers:
可以为给定的缓冲区设置游标类型(使用局部缓冲区变量cursor-type
),如@King的答案所示。(该答案用于setq-default
设置所有缓冲区的默认值。)
或者可以为给定的帧将其设置为frame参数cursor-type
。
通过将其添加到option中,可以将其设置为所有帧的默认光标类型default-frame-alist
。例如,将此项目添加到列表中:(cursor-type . bar)
。
这是一条命令(来自库oneonone.el),用于设置当前帧的光标类型:
(defun 1on1-set-cursor-type (cursor-type)
"Set the cursor type of the selected frame to CURSOR-TYPE.
When called interactively, prompt for the type to use.
To get the frame's current cursor type, use `frame-parameters'."
(interactive
(list (intern (completing-read
"Cursor type: "
(mapcar 'list '("box" "hollow" "bar" "hbar" nil))))))
(modify-frame-parameters (selected-frame) (list (cons 'cursor-type cursor-type))))
光标颜色始终是每帧的,而不是每个缓冲区的。
在库中,oneonone.el
您还将找到在只读和可写之间,在覆盖模式和插入模式之间切换缓冲区时自动更改游标类型的选项,或者在Emacs空闲时将其更改为框形游标(更明显)的选项。 。