Last Updated: September 02, 2017
·
714
· ermanno

Prefer backward-kill-word over Backspace

An alternative to the analogous item in Steve Yegge's list of tips effective-emacs, taking advantage of region-bindings-mode. Rather simple, but I didn't see this particular setting anywhere else.

(require 'region-bindings-mode)
(region-bindings-mode-enable)
(global-set-key (kbd "C-w") 'backward-kill-word)
(define-key region-bindings-mode-map (kbd "C-w") 'kill-region)

By using the region-binding-mode package we can retain the familiar C-w keybinding for cutting a region of text when the mark is active, while still having it bound globally to the 'backward-kill-word function, when it is not.

1 Response
Add your response

Waiting more Emacs tips!

over 1 year ago ·