Commits

Anonymous committed 8c0ae92

Added `my-kill-whitespace'

Comments (0)

Files changed (2)

files/defuns-edit.el

 (require 'thingatpt)
 
+(defun my-kill-whitespace (&optional forward)
+  "Kill all the whitespace characters backwards until hitting
+  non-whitespace character.  With prefix argument, kill in the
+  forward direction."
+  (interactive "P")
+  (let ((old-point (point)))
+    (if forward
+        (skip-syntax-forward " ")
+      (skip-syntax-backward " "))
+    (delete-region old-point (point))))
+
 ;; line selection functions
 (defun line-select ()
   "Set the active region to current line"
 
 ;; deleting stuff
 (global-set-key (kbd "C-<i-key>") 'backward-kill-word)
+(global-set-key (kbd "C-<backspace>") 'my-kill-whitespace)
 
 ;; keys for specific modes
 (defun add-html-binding ()