Last active
August 29, 2015 14:22
-
-
Save etscrivner/0bd46b65003f243c3a65 to your computer and use it in GitHub Desktop.
Emacs snippet to kill a line backwards to the first whitespace character.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun kill-back-to-indentation (arg) | |
| "Ignore ARG. Kill lines backwards to the first whitespace character." | |
| (interactive "p") | |
| (let ((start (point))) | |
| (back-to-indentation) | |
| (kill-region start (point)))) | |
| (global-set-key (kbd "C-c DEL") 'backward-kill-to-start-of-line) | |
| ;;; Example (Python): (The cursor is $) | |
| ;;; | |
| ;;; class MyClass(object): | |
| ;;; def print_info(self): | |
| ;;; logger.info$('%r', info) | |
| ;;; | |
| ;;; Hit C-c DEL | |
| ;;; | |
| ;;; class MyClass(object): | |
| ;;; def print_info(self): | |
| ;;; $('%r', info) | |
| ;;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment