Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Created April 8, 2013 17:30
Show Gist options
  • Save PuercoPop/5338664 to your computer and use it in GitHub Desktop.
Save PuercoPop/5338664 to your computer and use it in GitHub Desktop.
;; Thanks to tali713
(defun backward-kill-word-or-kill-region ()
"When no region is active call backward-kill-word, otherwise kill-region. To
make it behave like the shell "
(interactive)
(call-interactively (if (region-active-p)
'kill-region
'backward-kill-word)))
(global-set-key (kbd "C-w") 'backward-kill-word-or-kill-region)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment