Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defvar hcz-set-cursor-color-color "")
- (defvar hcz-set-cursor-color-buffer "")
- (defun hcz-set-cursor-color-according-to-mode ()
- "change cursor color based on minor mode."
- (let ((color
- (if buffer-read-only "grey"
- (if overwrite-mode "red"
- "orange"))))
- (unless (and
- (string= color hcz-set-cursor-color-color)
- (string= (buffer-name) hcz-set-cursor-color-buffer))
- (set-cursor-color (setq hcz-set-cursor-color-color color))
- (setq hcz-set-cursor-color-buffer (buffer-name)))))
- (add-hook 'post-command-hook 'hcz-set-cursor-color-according-to-mode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement