Emacs Asked by ruby_object on September 2, 2021
I am sick of pressing Insert
instead of Backspace
and running into problems in certain modes.
How can I fix it?
One option is to have some visual indication that overwrite mode has been activated, so I can press Insert again
and correct my mistake.
If it is the position of the key that is the problem, then you can unbind the key so that it does not enable overwrite-mode
any longer:
(global-set-key (kbd "<insert>") nil)
If you still want to be able to enable the mode with a key, you can bind some other key to it, perhaps a function key:
(global-set-key (kbd "<f8>") #'overwrite-mode)
although you will have to figure out what would work for you.
Answered by NickD on September 2, 2021
In the end, I used https://www.emacswiki.org/emacs/AlarmBell and added some code to overwrite-mode-hook. So now I get a visible alarm, which may be better than completely disabling the key. Time will tell if this is better than the other answer.
(defun double-flash-mode-line ()
(let ((flash-sec (/ 1.0 20)))
(invert-face 'mode-line)
(run-with-timer flash-sec nil #'invert-face 'mode-line)
(run-with-timer (* 2 flash-sec) nil #'invert-face 'mode-line)
(run-with-timer (* 3 flash-sec) nil #'invert-face 'mode-line)))
(add-hook 'overwrite-mode-hook #'(lambda () (double-flash-mode-line)))
Answered by ruby_object on September 2, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP