سؤال

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)
هل كانت مفيدة؟

المحلول

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)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top