Skip to content

Instantly share code, notes, and snippets.

@Y4suyuki
Last active February 5, 2021 01:13
Show Gist options
  • Save Y4suyuki/96ab4a384bdd284417f62a5361f6943f to your computer and use it in GitHub Desktop.
Save Y4suyuki/96ab4a384bdd284417f62a5361f6943f to your computer and use it in GitHub Desktop.
toy elisp for emacs intro lt
;; https://stackoverflow.com/questions/4642835/how-to-change-the-cursor-color-on-emacs
(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)))
)
(setq blink-cursor-interval .05)
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment