Hacker News new | ask | show | jobs
by tshadwell 3588 days ago
in a similar vein, I often close browsers with ^W, expecting to delete a word. Thanks Vim.
5 comments

And bash, and bc, and anybody else who uses readline [1] or its conventions.

[1] https://en.wikipedia.org/wiki/GNU_Readline

This actually works on OpenBSD, along with ^A, ^E and ^U, in Firefox and Chromium. I suspect it might work on a macOS too, but I haven't tried.
Wow I've been annoyingly using DE to delete a word.

Thanks for this.

FYI, this only works in insert mode, for the word you just typed (equivalent to ctrl-backspace, basically). And diw/diW (delete inner word, delete inner non-space-characters-word) may actually be faster depending on the context since you don't need to get to the beginning of the word.
if it makes you feel better, I often try to close a terminal tabs with ^W from browser habits and delete words ;)
Time to rewire that brain of yours to use 'daw' instead.