Risposte:
Per cambiare il cursore o il cursore, quello che vuoi fare è:
Apri il tuo file .emacs e questa riga di codice:
(setq-default cursor-type 'bar)
E per cambiare il colore:
(set-cursor-color "#ffffff")
Certo, puoi cambiare #ffffff
qualsiasi colore esadecimale.
Il tipo di cursore può essere impostato per un dato buffer (usando la variabile buffer-local cursor-type
), come indicato nella risposta da @King. (Questa risposta utilizza setq-default
per impostare il valore predefinito per tutti i buffer.)
Oppure può essere impostato per un determinato frame , come parametro frame cursor-type
.
È possibile impostare il tipo di cursore predefinito per tutti i frame aggiungendolo all'opzione default-frame-alist
. Per esempio aggiungere questo elemento alla alist: (cursor-type . bar)
.
Ecco un comando (dalla libreria oneonone.el ) per impostare il tipo di cursore per il frame corrente:
(defun 1on1-set-cursor-type (cursor-type)
"Set the cursor type of the selected frame to CURSOR-TYPE.
When called interactively, prompt for the type to use.
To get the frame's current cursor type, use `frame-parameters'."
(interactive
(list (intern (completing-read
"Cursor type: "
(mapcar 'list '("box" "hollow" "bar" "hbar" nil))))))
(modify-frame-parameters (selected-frame) (list (cons 'cursor-type cursor-type))))
Il colore del cursore è sempre per frame , non per buffer.
Nella libreria oneonone.el
troverai anche le opzioni per cambiare automaticamente il tipo di cursore quando cambi un buffer tra sola lettura e scrivibile, o tra la modalità di sovrascrittura e la modalità di inserimento, o per cambiare il tipo in un cursore a riquadro (più evidente) quando Emacs è inattivo .