2 ms·
> 8. alt-w - delete the word behind of the cursor He means “ctrl-w”. But since that only works in bash, not in Emacs or other tools with Emacs key bindings, i
by teddyh 10y ago
> 8. alt-w - delete the word behind of the cursor
He means “ctrl-w”. But since that only works in bash, not in Emacs or other tools with Emacs key bindings, it makes more sense to use (in his terminology) “alt-backspace”. This does the same thing, and works both in the shell and in Emacs-like environments.
- blockloop 10y agoAh yes. Thank you for the correction.
- u801e 10y agoThe default key bindings in bash are listed in the readline section of the bash man page (they mostly match the emacs key bindings).
- syrrim 10y agoAnother advantage to using alt-backspace over ctrl-w is that the former has the same semantics as alt-b. ctrl-w considers a word to be anything surrounded by spaces, whereas alt-b and alt-backspace consider a word to be any consecutive string of word characters.
- Lio 10y agoIt may be worth noting that C-w also works in Vim insert mode. So, for me, it works in both shell and editor.