如何更改emacs上的光标颜色 [英] how to change the cursor color on emacs

查看:175
本文介绍了如何更改emacs上的光标颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Emacs的颜色做了一些修改,现在唯一的错误是黑色背景上的黑色光标,我必须改变它。

I made some changes in Emacs's colors and the only thing wrong now is the cursor that is black on black background and I will have to change that. What do I do?

推荐答案

如果您运行的是最新版本的emacs,您可以使用:

If you are running a recent version of emacs you can use:

; Set cursor color to white
(set-cursor-color "#ffffff") 

#ffffff ,您可以使用任何喜欢的颜色。有关十六进制代码的列表google说: http://www.tayloredmktg.com/rgb/

Instead of #ffffff you can use any color you like. For a list of hex code google Says: http://www.tayloredmktg.com/rgb/

也许你喜欢这个...以下代码会改变每个闪烁时的光标颜色 。只是eval代码及其运行:

Maybe you like this one... the following code changes the cursor color on each blink. Just eval code and its running:

; 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)))
  )



<

Note that this code replaces the emacs function 'blink-cursor-timer-function' from 'frame.el'.

这篇关于如何更改emacs上的光标颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆