rhiiba
Last Updated: February 25, 2016
·
1.227K
· brianriley
Avatar2

Ctrl-w everywhere

osx

Ctrl-w, for the uninitiated, is an amazing productivity secret. There's a point where your typing speed is so fast that it's slower to backspace to a typo and fix than it is to just delete the whole word and start over. Ctrl-w deletes the previous word. Open up a terminal and try it now.

That's right, a terminal. In OS X (Mavericks, at least), Ctrl-w only works in terminal, including vim insert mode. Option-delete does the same trick outside of terminal--but who wants 2 ways to delete the previous word?! Don't worry: you can get Ctrl-w everywhere in OS X; here's how.

Edit ~/Library/KeyBindings/DefaultKeyBinding.dict to look something like this (you may need to create the folder):

{
    "^w" = "deleteWordBackward:";
}

Or add the "^w" entry to any existing bindings you already have. Restart any program, and enjoy the blazing speed at which you can now type and correct with Ctrl-w!

Disclosure: I can't take full credit for this tip. I learned it here.

Say Thanks
Respond

2 Responses
Add your response

12107
D42a7264714dee5006b9c99d2567a320

On a PC, we use Ctrl+Backpace:)

over 1 year ago ·
13931
E3becce0fdbf4a45842cd8bf9af30d5b

Well, ctrl-w is a vim binding, and the equally useful vim binding ctrl-h (delete back one character) is available everywhere in OS X by default, so it's dang nice to know how to make ctrl-w do the same!

over 1 year ago ·