Skip to content

Instantly share code, notes, and snippets.

@dwcoates
Created January 14, 2017 02:05
Show Gist options
  • Select an option

  • Save dwcoates/26249b7c8a3519dba1bd5de1f835280a to your computer and use it in GitHub Desktop.

Select an option

Save dwcoates/26249b7c8a3519dba1bd5de1f835280a to your computer and use it in GitHub Desktop.

(defun my-kill-thing-at-point (thing) “Kill the `thing-at-point’ for the specified kind of THING.” (let ((bounds (bounds-of-thing-at-point thing))) (if bounds (kill-region (car bounds) (cdr bounds)) (error “No %s at point” thing))))

(defun my-kill-word-at-point () “Kill the word at point.” (interactive) (my-kill-thing-at-point ‘word))

(global-set-key (kbd “s-k w”) ‘my-kill-word-at-point)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment