Last active
December 5, 2015 20:58
-
-
Save fisher/04d6966491748efa5ad3 to your computer and use it in GitHub Desktop.
emacs cursor change in insert/overwrite modes
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
;; vertical bar cursor by default | |
(set-default 'cursor-type 'bar) | |
;; don't stop blinking at all | |
(setq blink-cursor-blinks 0) | |
;; override insert key to change cursor in overwrite mode | |
(defvar cursor-mode-status 0) | |
(global-set-key (kbd "<insert>") | |
(lambda () (interactive) | |
(cond ((eq cursor-mode-status 0) | |
(setq cursor-type 'box) | |
(overwrite-mode (setq cursor-mode-status 1))) | |
(t | |
(setq cursor-type 'bar) | |
(overwrite-mode (setq cursor-mode-status 0)))))) | |
(hl-line-mode) | |
(set-face-background hl-line-face "gray6") | |
(add-hook 'dired-mode-hook (lambda () (hl-line-mode))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment