zsh-workers
 help / color / mirror / code / Atom feed
* Make `Ctrl + W` and `Ctrl + Shift + H` in zsh behave the same as in bash
@ 2020-03-21 19:29 Rik
  2020-03-21 20:06 ` Daniel Shahaf
  0 siblings, 1 reply; 3+ messages in thread
From: Rik @ 2020-03-21 19:29 UTC (permalink / raw)
  To: zsh-workers

[-- 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-21 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-21 19:29 Make `Ctrl + W` and `Ctrl + Shift + H` in zsh behave the same as in bash Rik
2020-03-21 20:06 ` Daniel Shahaf
2020-03-21 20:12   ` Rik

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).