Bring back the Insert key on Emacs
Back in the olden days, there was an Insert key on Mac keyboards. (There still is on PC keyboards, although in many programs it doesn’t actually do anything anymore.) If you were editing text, you had two different modes, overwrite and insert. If you were in insert mode, then when text was in front of the cursor, typing would insert text. If the | character represents the cursor:
banana |crazypants
And you typed plaid, you’d get:
banana plaid|crazypants
This is what you expect in modern editing, right? But, if you were in overwrite mode and did the same thing, you would get:
banana plaid|pants
Crazy(pants), right? But the thing is, once in a while this is still useful, and it’s basically gone away. The Insert key has become the Help on Mac keyboards; if you have a mechanical keyboard that has an Insert key like I do, it (probably) acts like a Help key.
Well, screw that, at least in Emacs. Everybody who uses Emacs can use ^H, or in Emacs parlance C-h, to get help, right? So if you’re on a Mac, you can restore the Insert key with one line in your init.el file:
(keymap-global-set "<help>" #'overwrite-mode)
If you’re not on a Mac, your Insert key probably works as expected already. At least in Emacs.
All well and good, but you know what would be better? Make the cursor reflect the change, so you don’t have to check the mode line.
In my init.el file, I tell Emacs to use a vertical line cursor:
(customize-set-variable 'cursor-type '(bar . 2))
Since overwrite-mode has a hook that gets called when it’s toggled, it’s trivial to change the cursor based on that. I turn it into a box. The line/box combo seems (to me) to be visually very suggestive of what’s going to happen: in overwrite mode, the box highlights the character it’s going to replace, while in normal insert mode, the vertical line is where the character you’re going to insert will go.
;; change cursor based on overwrite mode
(defun wm/update-cursor-type-for-overwrite ()
"Set cursor-type to box when overwrite-mode is on."
(setq cursor-type (if overwrite-mode 'box '(bar . 2))))
(add-hook 'overwrite-mode-hook #'wm/update-cursor-type-for-overwrite)
This is something I remember fondly from earlier versions of BBEdit—I don’t know whether current versions still support this if you have a keyboard old enough to send a true Insert key. But if you’re in Emacs, you can force the issue. Party like it’s 1989!
To support my writing, throw me a tip on Ko-fi.com!
©
2026
Watts Martin
·
License: CC BY-NC-SA 4.0
Contact: Mastodon ·
Bluesky ·
Email