From: Rik <gitaarik@posteo.net>
To: zsh-workers@zsh.org
Subject: Make `Ctrl + W` and `Ctrl + Shift + H` in zsh behave the same as in bash
Date: Sat, 21 Mar 2020 14:29:25 -0500 [thread overview]
Message-ID: <63c88bc3-ab0b-dd26-4dcd-4c834b5bfaad@posteo.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]
Hi everyone,
I've recently started using zsh and I like it. However, coming from
bash, some little things I miss.
*The problem:*
In bash behavior is like this:
* Ctrl + W deletes the word behind the cursor up to the next space
* Ctrl + Shift + H deletes the word behind the cursor up to the next
seperation charcater like ., ,, -, / etc.
In zsh both Ctrl + W an Ctrl + Shift + H behave like the latter one in
bash. I would like the same behavior as in bash.
*This is what I've tried:*
SPACE_WORDCHARS='~!#$%^&*(){}[]<>?.+;-_/\|=@`'
backward-delete-word() WORDCHARS=$SPACE_WORDCHARS zle .$WIDGET
zle -N backward-delete-word
bindkey "^W" backward-delete-word
This works, however, it breaks the functionality that deleting a word
puts the word on the paste buffer, so I can't then paste this word with
Ctrl + Y. This is quite important functionality for me. To be honest I'm
not completely sure how this zle function works and what .$WIDGET does.
Would anyone know a way how I can make this work while retaining the
cut/paste behavior?
Many thanks,
Rik
next reply other threads:[~2020-03-21 19:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-21 19:29 Rik [this message]
2020-03-21 20:06 ` Daniel Shahaf
2020-03-21 20:12 ` Rik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=63c88bc3-ab0b-dd26-4dcd-4c834b5bfaad@posteo.net \
--to=gitaarik@posteo.net \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).