Ctrl-w everywhere
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.
Written by Brian Riley
Related protips
2 Responses
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/44093/d42a7264714dee5006b9c99d2567a320.jpeg)
On a PC, we use Ctrl
+Backpace
:)
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/66883/e3becce0fdbf4a45842cd8bf9af30d5b.jpeg)
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!