Use CTRL+Backspace to delete backward word and CTRL+Delete to remove forward word in ZSH shell

Written on Wednesday July 24, 2019 - Permalink - Tags: linux, teminal, zsh

Problem

You would like to be able to delete whole words in the terminal using keyboard shortcuts (CTRL+Backspace, CTRL+Del).

Solution

Just add to your ~/.zshrc file above lines:

bindkey '^H' backward-kill-word
bindkey '^[[3;5~' kill-word