On my previous MacBook I had a keybinding in iTerm2 which would delete a word when I press Option + Delete. Unfortunately I don't have access to my previous MacBook any more to see how it was done.
When I have a string like
something
and the cursor is at the end it would delete the whole word (expected behavior).
When the string is /etc/nginx/nginx.conf
it would delete nginx.conf
leaving only /etc/nginx/
(which is also expected).
Unfortunately the best thing that gets even close to this behavior is adding a custom binding in iTerm2 to send Option + Delete
and send Hex key 0x17
. This will however always delete the whole string /etc/nginx/nginx.conf
and not just nginx.conf
from it.
I tried many conbinations with .inputrc
, which at the end I couldn't make work, but even if I did it would have worked only in the local shell. Logging in to a remote server via SSH would still have the same behavior (delete the whole word).
The behavior I am describing works well without any additional settings in Notes
where slashes seem to be a word separator.
When I navigate to General -> Selection I removed the / from the Characters considered part of a word
but this didn't change anything.
Asked by Atanas Stoyanov
(3 rep)
Jul 11, 2025, 09:57 AM
Last activity: Jul 11, 2025, 02:07 PM
Last activity: Jul 11, 2025, 02:07 PM