How to move through words and break on punctuation on terminal? I changed laptop and I cannot configure my Terminal the way it was.
I had this shortcut to delete words, and when deleting ab-cd.ef_gh, it would go ab-cd.ef_ then ab-cd. then ab- then nothing. So it would break on hyphens and on other such characters. But the behaviour now is to delete the full sequence ab-cd.ef_gh instead of doing it &quot;one by one&quot;. How can I do that?
I found an answer on Super user
The issue was that Mac went from bash to zsh. There is nothing about a shortcut to &quot;delete part of a word&quot;. The solution is to use the common &quot;delete word&quot; shortcut and define what a word is: bash defines a word to be a-zA-Z0-9 but not zsh which defines words as anything in between spaces (so ab.cd or /ef/gh/ij).
for the sake of completeness, add to your .zshrc:
autoload -U select-word-style
select-word-style bash