Skip to content

Instantly share code, notes, and snippets.

@fisher
Last active December 5, 2015 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fisher/04d6966491748efa5ad3 to your computer and use it in GitHub Desktop.
Save fisher/04d6966491748efa5ad3 to your computer and use it in GitHub Desktop.
emacs cursor change in insert/overwrite modes
;; 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