how can I change the cursor color depending on insert or overwrite mode?
I looked at this page
and put as recommended 3 lines in the Emacs init file at the end of the custom-set-variables block as well at the end of the custom-set-faces block. In both cases the color of the cursor was black both in insert and overwrite mode.
This is my Emacs init file
(custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(blink-cursor-mode nil) ; Cursor nicht blinken lassen '(inhibit-startup-screen t) ; Keinen startup screen für Emacs anzeigen '(x-stretch-cursor t) ; Cursor bei Tabulatoren breit machen '(show-trailing-whitespace t) ; Leerzeichen am Zeilenende anzeigen '(sentence-end-double-space nil) ; Keine zwei Leerzeichen nach einem Punkt '(require-final-newline (quote ask)) ; Zeilenende an letzter Zeile erzwingen '(column-number-mode t) ; Zeilennummer und Spalte in Statuszeile anzeigen '(show-paren-mode t) ; show matching parantheses '(transient-mark-mode t) ; show marked region (fails; work around see below) '(require 'cursor-chg) ; Load the library '(toggle-cursor-type-when-idle 1) ; Turn on cursor change when Emacs is idle '(change-cursor-mode 1)) ; Turn on change for overwrite, read-only, and input mode (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(region ((t (:background "light gray" :distant-foreground"gtk_selection_fg_color")))))