How can I replace py-hungry-delete-backwards for the traditional backward-kill-word in python-mode.el? I tried to define the C-DEL key in the python-mode hook but it just get ignored.

This is, I want to use the backward-kill-word command with C-DEL in a python environment.


  • Please show the actual code you've tried.
    – Stefan
    Feb 10 '17 at 18:16

Well, I found the solution in a bugreport:

(add-hook 'python-mode-hook
          (lambda ()
            (define-key python-mode-map (kbd "<C-backspace>") 'backward-kill-word)))

For some reason my implementation of a similar hook was not working.

  • backward-kill-word should exist as M-backspace too. Feb 11 '17 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.