Question

I want the current line to be deleted when Alt, and the letter d is pressed twice.

How can I achieve this inside my Emacs configuration file?

Currently all I have is this in my .emacs:

(global-set-key (kbd "M-9") 'prev-window)
(global-set-key (kbd "M-0") 'other-window)
Was it helpful?

Solution

You can use your own keymap:

(defvar somename-map (make-sparse-keymap) "Keymap for M-d")
(define-key somename-map (kbd "M-d") 'kill-line)
(define-key somename-map (kbd "M-w") 'kill-word)

(global-set-key (kbd "M-d") somename-map)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top