Skip to content

Instantly share code, notes, and snippets.

@ashawley
Created February 28, 2013 16:56
Show Gist options
  • Save ashawley/5058193 to your computer and use it in GitHub Desktop.
Save ashawley/5058193 to your computer and use it in GitHub Desktop.
Whitespace problems, I feel bad for you son.
;; Billy Mays here talking about zap to whitespace.
;; Deletes your whitespace forward.
;; Got to fix indentation before you merge? No problem!
(global-set-key "\C-c " 'zap-whitespace-forward) ;; C-c SPC
;; But I'm still not done.
(defalias 'zap-whitespace-forward 'ash-delete-syntax-forward)
;; There's more!
;; Delete word characters forward, delete punctuation forward,
;; delete newlines forward.
(defun ash-delete-syntax-forward (arg)
"Delete characters of same syntax at point forward ARG times."
(interactive "*p")
(delete-region (point) (progn (forward-same-syntax arg)
(point))))
;; No shipping and handling if you call now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment