Skip to content

Instantly share code, notes, and snippets.

@tomoya
Last active August 29, 2015 14:11
Show Gist options
  • Save tomoya/098be003b71458479285 to your computer and use it in GitHub Desktop.
Save tomoya/098be003b71458479285 to your computer and use it in GitHub Desktop.
(defun delete-word (arg)
"Delete characters forward until encountering the end of a word.
With argument, do this that many times."
(interactive "p")
(delete-region (point) (progn (forward-word arg) (point))))
(defun backward-delete-word (arg)
"Delete characters backward until encountering the end of a word.
With argument, do this that many times."
(interactive "p")
(delete-word (- arg)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment