fak*_*ake 29 emacs colors cursor
我对Emacs的颜色进行了一些更改,现在唯一错误的是黑色背景上的黑色光标,我将不得不改变它.我该怎么办?
Zar*_*rza 39
如果您运行的是最新版本的emacs,则可以使用:
; Set cursor color to white
(set-cursor-color "#ffffff")
Run Code Online (Sandbox Code Playgroud)
而不是#ffffff你可以使用你喜欢的任何颜色.有关十六进制代码列表谷歌说:http://www.tayloredmktg.com/rgb/
也许你喜欢这个...下面的代码改变了每个闪烁的光标颜色.只需eval代码及其运行:
; Using in Emacs 24.0
(defvar blink-cursor-colors (list "#92c48f" "#6785c5" "#be369c" "#d9ca65")
"On each blink the cursor will cycle to the next color in this list.")
(setq blink-cursor-count 0)
(defun blink-cursor-timer-function ()
"Zarza wrote this cyberpunk variant of timer `blink-cursor-timer'.
Warning: overwrites original version in `frame.el'.
This one changes the cursor color on each blink. Define colors in `blink-cursor-colors'."
(when (not (internal-show-cursor-p))
(when (>= blink-cursor-count (length blink-cursor-colors))
(setq blink-cursor-count 0))
(set-cursor-color (nth blink-cursor-count blink-cursor-colors))
(setq blink-cursor-count (+ 1 blink-cursor-count))
)
(internal-show-cursor nil (not (internal-show-cursor-p)))
)
Run Code Online (Sandbox Code Playgroud)
请注意,此代码将'frame.el'替换为emacs函数'blink-cursor-timer-function'.
qed*_*qed 14
以上都不适合我,所以我自己做了一点研究.来自EmacsWiki:
14.20显示光标
在文本终端上,光标的外观由终端控制,很大程度上不受Emacs的控制.有些终端提供两种不同的光标:"可见"静态光标和"非常明显"的闪烁光标.默认情况下,Emacs使用非常明显的光标,并在启动或恢复Emacs时切换到它.如果在Emacs启动或恢复时变量visible-cursor为nil,则使用普通游标.
在图形显示上,可以更改文本光标的更多属性.要自定义其颜色,请更改名为cursor的面的:background属性(请参阅面自定义).(此面的其他属性无效;光标下显示的文本使用框架的背景颜色绘制.)要更改其形状,请自定义缓冲区局部变量光标类型; 可能的值是框(默认),空心(空心框),条形(垂直条),(条形.n)(垂直条宽n像素宽),hbar(水平条形),(hbar.n)(水平条n像素高),或nil(根本没有光标).
要禁用光标闪烁,请将变量blink-cursor-mode更改为nil(请参阅Easy Customization),或将行(blink-cursor-mode 0)添加到init文件中.或者,您可以通过自定义列表变量blink-cursor-alist来更改光标在"闪烁"时的外观.列表中的每个元素都应该具有表单(on-type.off-type); 这意味着如果光标在闪烁时显示为on-type(其中on-type是上述光标类型之一),则闪烁时它会显示为off-type.
某些字符(如制表符)是"超宽"的.当光标位于这样的字符上时,通常使用默认字符宽度绘制.通过将变量x-stretch-cursor更改为非零值,可以使光标拉伸以覆盖宽字符.
光标通常作为非闪烁的空心框显示在非选定窗口中.(对于条形光标,它显示为更细的条形.)要关闭非选定窗口中的光标,请将可变光标在非选定窗口中更改为nil.
要使光标更加可见,可以使用HL Line模式,这是一种突出显示包含点的线的次模式.使用Mx hl-line-mode在当前缓冲区中启用或禁用它.Mx global-hl-line-mode全局启用或禁用相同模式.
所以这是这样做的方法:1 M-x customize-face.输入2. cursor输入3.选择你喜欢的背景颜色.4.单击状态,保存以供将来的会话使用.
屏幕截图:




试试这个:
(setq default-frame-alist
'((cursor-color . "palegoldenrod")))
Run Code Online (Sandbox Code Playgroud)
如果你想保留其他值,default-frame-alist你可以马克的建议:
(add-to-list 'default-frame-alist '(cursor-color . "palegoldenrod"))
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21270 次 |
| 最近记录: |