Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Created December 20, 2012 18:21
Show Gist options
  • Save PuercoPop/4347457 to your computer and use it in GitHub Desktop.
Save PuercoPop/4347457 to your computer and use it in GitHub Desktop.
(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 (list (point) (mark)))
(if mark-active
(kill-region point mark)
(backward-kill-word 1)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment