Last active
February 5, 2021 01:13
-
-
Save Y4suyuki/96ab4a384bdd284417f62a5361f6943f to your computer and use it in GitHub Desktop.
toy elisp for emacs intro lt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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